80. Interplanetary Cosmic Ballistic Missile

Time Limit: 1 seconds

Memory Limit: 1024 MB

Rating: 1500

Problem Statement

They say the best weapon is one you never have to fire. I prefer the weapon you only need to fire once. The Galactic Defense Commander is trying to throw an Interplantary Cosmic Ballistic Missile (ICBM) at a alien spaceship. Due to the sheer distance from the command centre, the force of gravity decreases by $0.3 m/s^2$ every $10$ kilometers in the air. Luckily, the Commander has found an old cannon lying around, allowing him to not tear all the ligaments in him body. Given the missile is $X$ kilograms and the force of the cannon is $Y$ newtons applied over a time period of $1$ second, what is the maximum range (in meters) of the ICBM?

Input

Input 1: Mass of the ICBM ($kg$) Input 2: Newtons of Force applied to the ICBM by the cannon. ($N$) $X > 1$, and will always be an integer. $0 \le Y \le 10000$ Gravitational Force at Sea Level is set as $10$. It remains constant until the ICBM reaches an altitude of $10000$m, then decreases by $0.3$ to become $9.7$. Air resistance is negligible.

Output

Maximum range that can be reached by the ICBM, rounded to the nearest meter.

Sample Cases
Sample Input 0:
12
2023

Sample Output 0:
2842
Explanation

Mass of ICBP is $12kg$. Total Force applied on ICBP by cannon is $2023N$. Maximum distance travelled by ICBP is $2842$ metres, rounded to the nearest meter.

Sources

KL Coding Cup October 2024 > Problem 18

Submit | Back