PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#BS0000384. Điều chỉnh quỹ đạo Mặt Trăng (Destroy the Moon to Save the Earth)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đ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 TT days the Moon needs an additional displacement of DD km relative to its position at the original speed SS. Negative DD means it must travel ∣D∣|D| km less. Determine how much mass to add or remove.

Input

One line contains integers T,S,DT,S,D: time (days), original speed (mm/s), and additional displacement (km).

Output

Let XX be the magnitude of the mass change truncated to an integer. Print Remove X tons if mass is to be removed and X>0X>0; otherwise print Add X tons (including X=0X=0).

Subtasks

  • Subtask 1 (20 points): 1≤T,S≤1091\le T,S\le10^9; −109≤D≤109-10^9\le D\le10^9. D=0D=0.
  • Subtask 2 (30 points): 1≤T,S≤1091\le T,S\le10^9; −109≤D≤109-10^9\le D\le10^9. DD is divisible by 54T54T.
  • Subtask 3 (50 points): 1≤T,S≤1091\le T,S\le10^9; −109≤D≤109-10^9\le D\le10^9.

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 2500000000/630720000≈3.9637242500000000/630720000\approx 3.963724 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 2100000000/1083456000≈1.9382422100000000/1083456000\approx 1.938242 mm/s. Add the corresponding mass; truncating its magnitude gives 1 tons.