Calculate force2d with given time, 2 positions, mass...

For example.
I have a cannon.
The cannon can rotate up and down to change the force angel.
The cannon can shoot balls (with different mass) to a hole (the hole does not change position - it means the cannon always shoots balls into the hole even different of ball’s mass and cannon angel).
So that I want to find Force vector to make Rigidbody2D.AddForce work.

Please help.

This is not a Unity question - it’s a mechanics question.