We can find the height of the altitude by the ratio of sin. See my attachment. sin of angle = side in front of the angle / hypotenuse sin x = height/distance
If the two pilot is rising in an hour, then the first distance is 400 miles, the second distance is 300 miles.
Find the height of first pilot height/distance = sin x height/400 = sin 30° height = sin 30° × 400 height = 1/2 × 400 height = 200
Find the height of second pilot height/distance = sin x height/300 = sin 40° height = sin 40° × 300 height = 0.642 × 300 height = 192
So the first pilot traveling 400 mph with 30° is more quickly to reach high altitude than the second pilot traveling 300 mph with 40°