This problem appears to be unsolvable without knowledge of the initial distance between the ship and the sub. However, when the relative speeds are given, then it becomes solvable.
Bearings are measured from due North, and they run counterclockwise. Trig functions assume angles are measured relative to the x-axis, and run clockwise.
We start by realizing that if the torpedo travels at a bearing of 240 degrees, then it will travel along a parallel path towards the ship, overtaking it at some point, then passing it without ever making contact. Hence, the bearing to aim the torpedo is somewhat greater than 240 degrees.
The solution will be found by noting that regardless of how far apart the ship and sub are to begin with, when the ship and torpedo meet, their distance South of the x-axis will be the same. Let t be the common time of travel. Traveling at speed v at an angle of -30 degrees, the Ship's distance South will be
Traveling at speed 5v at an angle of θ degrees, the torpedo's distance South will be
5*v*t*sin( θ )
When they meet, these two expressions will be equal:
5*v*t*sin(θ) = v*t*sin(-30 deg)
Solving, we get
sin(θ) = sin(-30 deg) / 5
θ = arcsin [ sin(-30 deg) / 5 ]
= -5.74 deg.
Converting to Bearing, -5.74 deg + 270 deg = 264.26 deg, ans.
Note that when the torpedo's speed is only 1% higher than the Ship's, we would expect to get a nearly parallel track:
θ = arcsin [ sin(-30 deg) / 1.01 ] = -29.67 deg, which is very close to -30 deg, as expected.