Coast Guard
Time limit2sMemory limit512 MB
Decide whether a coast guard boat can intercept a thief heading straight out to sea 12 miles away, given their speeds and starting distance apart.
- Level
Medium4 of 10
- Topics
- Geometry, Math, Binary search, Implementation
- Solved
- No attempts yet
Problem
A thief snatched the bag of a woman walking on a beach in Nlogônia and fled toward the sea. His plan is plain. He means to take a boat and get away.
The thief is already aboard. He heads perpendicular to the shoreline toward the limit of international waters, which lies 12 nautical miles out, where the local authorities cannot touch him. His boat covers that distance at a constant speed of knots.
The coast guard means to intercept him, and its boat holds a constant speed of knots. Both boats leave the shore at the same instant, with nautical miles between their starting points. Can the coast guard reach the thief before he passes the limit of international waters?
The shore of Nlogônia is perfectly straight and the sea is calm, so both boats sail in straight lines. The coast guard picks its interception point in advance and runs straight to it. Meeting the thief exactly on the limit counts as reaching him.
Input
The input has several test cases and ends at end of file (EOF). Each test case is one line with three integers (), () and (), which are the initial distance between the thief and the coast guard, the speed of the thief's boat, and the speed of the coast guard's boat.
Output
For each test case print one line. Print S if the coast guard can reach the thief before he passes the limit of international waters, or N if it cannot.