P1431 The watchman's escapeAccepted Tags: NOIP universal group 2007[Display label]Describe
The Demon Hunter, Dean, was so ambitious that he betrayed the night elves and led the Naga tribe, deep in the sea, to rebel. Keeper of the Watchmen
He was trapped in a deserted Big Island when he was killed in a clash with Illidan. In order to kill the Watchmen, Dean began to
A desert island to spell, the islands will soon sink. By then, everyone on the island would have been killed. The Watcher's running speed is
17M/S, at such a speed is unable to escape the desert island. Fortunately, the watcher has a flashing spell that can move 60m within 1s without
Every time you use a flashing spell, you will consume 10 mana points. The Catcher's Mana recovery rate is 4 points/s, only in situ
The rest of the state can be restored.
Now known as the Watcher's magical initial value m, the distance between his initial position and the island's exit S, the island sank time t.
Your task write a program to help the watcher calculate how to escape the desert island in the shortest time, if not escape, then output watch
The furthest distance a person can walk in the remaining time. Note: The watcher's running, flashing, or resting activities are in seconds (s) and each
The duration of the secondary activity is an integer second. The unit of distance is in meters (m).
Format input Format
In the input file escape.in only one line, including three non-negative integer m,s,t separated by spaces.
Output format
The output file Escape.out includes two lines:
The 1th behavior string "Yes" or "No" (case-sensitive), that is, whether the watcher can escape from the desert island.
Line 2nd contains an integer. The first behavior of "Yes" (case-sensitive) indicates the minimum time for the watcher to flee the desert island;
The first behavior "No" (case-sensitive) indicates the maximum distance the watcher can walk.
Example 1 sample input 1[copy] 39 200 4 Sample output 1[Copy] No 197 Sample 2 Sample input 2[copy] 36 255 10 Sample output 2[Copy] Yes 6 limit
1s
Tips
Greedy. Can DP, not interested, it is obvious to find a simple way to do just fine →_→
vijos1431: The Watchman's escape