You have a targeted position implies that the distance between the user and the target is r
(say). Now, you want the projectile to hit the target in a certain time t
. Let's say the projectile was thrown at a velocity v
. Below are the calculations that yield the result of how much velocity and angle of projection are required to achieve the hit in the given time t

The question says
have a curve trajectory with a max height.
Theoretically, the maximum height is achieved when the angle of projection is 90 degrees with respect to the ground and the cosine of 90 is 0. Substituting the value of cos(theta)
in the resultant equation results in the value of velocity being infinity, which is practically impossible.
Hence, with the given range and time of flight, two variables, the velocity, and angle of projection can be configured. If the maximum height that you want to achieve is specified, the angle of projection is calculated accordingly.