#BS0000384. Điều chỉnh quỹ đạo Mặt Trăng (Destroy the Moon to Save the Earth)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Điều chỉnh quỹ đạo Mặt Trăng (Destroy the Moon to Save the Earth)
Destroy the Moon to Save the Earth
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
An asteroid is approaching Earth. In the hypothetical model, scientists try to intercept it with the Moon by changing the Moon’s speed at time zero. Adding one ton reduces the speed by 1 mm/s; removing one ton increases it by 1 mm/s. Assume uniform linear motion. After days the Moon needs an additional displacement of km relative to its position at the original speed . Negative means it must travel km less. Determine how much mass to add or remove.
Input
One line contains integers : time (days), original speed (mm/s), and additional displacement (km).
Output
Let be the magnitude of the mass change truncated to an integer. Print Remove X tons if mass is to be removed and ; otherwise print Add X tons (including ).
Subtasks
- Subtask 1 (20 points): ; . .
- Subtask 2 (30 points): ; . is divisible by .
- Subtask 3 (50 points): ; .
Examples
Input
10950 1022083 2500
Output
Remove 2 tons
Explanation
Over 946080000 seconds an extra 2500000000 mm is needed. The speed increase is about 2.6425 mm/s, so about 2.6425 tons must be removed. Truncation gives 2.
Input
356 1027123 -525
Output
Add 17 tons
Explanation
The Moon must travel 525000000 mm less in 30758400 seconds. The speed decrease is about 17.07 mm/s. Adding mass and truncating gives 17 tons.
Input
1000 1010023 0
Output
Add 0 tons
Explanation
The additional displacement is zero, so neither speed nor mass needs to change.
Input
7300 1022083 2500
Output
Remove 3 tons
Explanation
Over 630720000 seconds, the Moon must travel 2500000000 mm farther. The magnitude of the speed change is mm/s. Remove the corresponding mass; truncating its magnitude gives 3 tons.
Input
12540 1082726 -2100
Output
Add 1 tons
Explanation
Over 1083456000 seconds, the Moon must travel 2100000000 mm less. The magnitude of the speed change is mm/s. Add the corresponding mass; truncating its magnitude gives 1 tons.