Polar Explorer
Time limit1sMemory limit128 MB
Given planet radius, fuel, and the angle to the crash site, decide if the round trip on the shorter arc fits and report leftover fuel or reachable miles.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
You are a two dimensional explorer posted near the north pole of a distant two dimensional planet. The surface of the planet is a perfect circle, so there is no terrain on it to survey.
Then a distress call arrives from an alien ship that has crash landed somewhere on that surface. You built your own equipment, and all it reports is the angle between you and the crash site, measured at the center of the planet.
Your planet rover gets a measly 5 miles per gallon. From that angle and the gasoline you have left, decide whether you can drive to the crash site and back before the tank runs dry.
The rover travels along the surface and takes the shorter of the two arcs, so for an angle of degrees the central angle it actually covers is degrees.

Input
The input holds a series of data sets, at most 100 of them, with no blank line between data sets.
One data set has three parts.
- Start line: a single line
START - Input line: a single line
X Y Z- () is the radius of the planet in whole miles
- () is the gasoline left in the rover in whole gallons
- () is the angle between you and the crash site in whole degrees
- End line: a single line
END
A single line ENDOFINPUT follows the last data set.
The circumference of a circle of radius is , and is .
Output
Print one line for each data set.
If the gasoline covers the round trip, print YES X, where is the fuel left once you are back, written as a whole number of gallons with the fraction dropped.
If the gasoline is not enough, print NO Y, where is the distance you can travel on the fuel you have, written as a whole number of miles.