Takeoff
Time limit2sMemory limit1024 MB
Given the plane mass, passenger masses, and the fuel ratio alpha, find the minimum fuel mass for takeoff or report Impossible.
- Level
Easy2 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
Recently, the first airplane is being prepared for takeoff at the newly opened airport in the city of Yanvarsk. Refuelers face a difficult problem: how much fuel to load into the plane.
Refuelers know the mass of the plane and the masses of everyone who will be on board during takeoff. The takeoff mass is the sum of the plane's mass, the mass of all people on board, and the mass of the fuel in the tanks. By air transport rules, for the plane to take off, there must be at least kilograms of fuel for each ton of its takeoff mass. What is the minimum amount of fuel to pour into the tanks so that takeoff is allowed?
Input
The first line contains three integers: is the mass of the plane, is the number of people on board, and is the mass of fuel needed for takeoff of one ton of the plane. Constraints: , , .
The second line contains integers , the masses of the passengers, with .
All masses are in kilograms.
Output
Print one number: the minimum mass of fuel in kilograms, or Impossible if the plane cannot take off under any conditions.
Your answer must have an absolute or relative error of at most . That is, if your answer is and the correct answer is , it is accepted when .
Note
Explanation of the first input: the mass of the plane with all passengers is 5250 kg. If it is loaded with 1312.5 kg of fuel, its mass becomes 6562.5 kg, and takeoff requires exactly kg of fuel.