Dragon Reactor Shutdown
Preview mode. Log in to edit, run, submit, and save progress.
Dragon Reactor Shutdown
A safety operator is shutting down unstable dragon reactor cores during a timed emergency drill. Each core starts with energy h. The operator has two kinds of emergency actions available for that core: a coolant pulse changes the current energy to floor(h / 2) + 10, and a discharge bolt reduces the current energy by 10. At most n coolant pulses and at most m discharge bolts may be used. The core is considered safe once its energy becomes 0 or below. For every drill record, decide whether the available actions are enough to make the core safe. Input Format: The first line contains t, the number of test cases. Each test case contains three integers h, n, and m. Output Format: For each test case, print YES if the core can be made safe, otherwise print NO.
Examples
1 100 3 4
YES
Explanation: Starting from 100, the operator can use coolant pulses to reach 60, then 40, then 30. Four discharge bolts then reduce the energy to -10, so the core is safe.
Approach hint
Start with the simplest clear approach, explain the trade-off, then move toward the cleaner answer.
Common mistake
Skipping assumptions, edge cases, or trade-offs can make an otherwise good answer feel incomplete.