import math


def suma(ax, ay, az, bx, by, bz):
    rx = ax + bx
    ry = ay + by
    rz = az + bz
    return rx, ry, rz


def mult(ax, ay, az, n):
    rx = ax * n
    ry = ay * n
    rz = az * n
    return rx, ry, rz


def norma(ax, ay, az):
    n = math.sqrt(ax * ax + ay * ay + az * az)
    return n

r0x = float(input("Ingrese posicion inicial x: "))
r0y = float(input("Ingrese posicion inicial y: "))
r0z = float(input("Ingrese posicion inicial z: "))

fx = float(input("Ingrese la fuerza resultante x: "))
fy = float(input("Ingrese la fuerza resultante y: "))
fz = float(input("Ingrese la fuerza resultante z: "))

m = float(input("Ingrese la masa: "))
t = float(input("Ingrese el tiempo: "))

ax, ay, az = mult(fx, fy, fz, 1 / m)
rx, ry, rz = mult(ax, ay, az, t * t / 2)
rx, ry, rz = suma(r0x, r0y, r0z, rx, ry, rz)
vx, vy, vz = mult(ax, ay, az, t)
rapidez = norma(vx, vy, vz)
print("La posicion resultante en el tiempo ",
      t, " es (", rx, ",", ry, ",", rz, ")")
print("La rapidez del objeto en el tiempo", t, " es ", rapidez)
