High speed, needs steep angle to achieve a given horizontal distance. Slow speed needs shallow angle.
For an angle theta to the horizontal, flight time T is given by vertical travel. Ignoring any air resistance,
v = u + at gives t = V0*Sin(theta)/9.8 and double this for coming down. V0 is total projectile speed and acceleration, a is 9.8 m/s/s.
Horizontally, there is no acceleration or deceleration since we are ignoring air, so the distance R = V0*Cos(theta) * t
Hence R = 2*V0*V0*Sin(theta)*Cos(theta)/9.8
You have a fixed R and you want the combination of V0 (which is speed = sqrt(Vx^2 + Vy^2)) and theta that satisfy this question.
2*Sin(theta)*Cos(theta) = Sin(2*theta) so the equation simplifies to:
R = V0^2*Sin(2*theta)/9.8
And hence for a fixed R and projectile velocity V0 (muzzle velocity)
Theta = Sin-1(R*9.8/V0^2)/2
If you know R then you can find theta for V0 and vice versa. There isn’t always a solution (not fired fast enough – you need V0 > sqrt(9.8*R) so roughly a velocity bigger than 3.1 times the square root of the range for the inverse sin to be <1 and the angle lower than 90 degrees). Apologies if there are any typos.
Proper projectile dynamics needs to factor in wind speed and direction, air density and earths rotation. Local gravitation may play a small role from 9.81 m/s/s too.