You just have to be a bit careful with the signs but deriving the equations
of motion is smply a matter of integrating and putting in the initial
conditions then using simple algebra to eleiminate t.
For themotion of the balls just use the eqursions of motion.