F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

The Crazy O2jamer

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 113    Accepted Submission(s): 30


Problem Description
Dreamwind likes playing O2jam very much.

O2jam is a famous music game. In this game, the player will listen to the music, and many notes will appear on the screen and fall down from the top. When the notes move to the line on the botton of the screen, the player should press the correct keys just on time, and the system will judge your rate and give scores. Sometimes there are some long notes, the player should hold the key down from the beginning and leave from the end, the system will judge one long note as two notes. The notes¡¯ falling speed has some relationship with the the speed of music(BPM, beat per minute). If the player has a good feeling of the music¡¯s beat, his rate will be very high and he will get high scores. Different music has different levels. When the chosen level is very high, the form of the notes will be very strong, and the player will ¡°die¡± in the game soon if he has not enough skill.


When you beat a note, you may get a ¡°COOL¡± or a ¡°GOOD¡±, but if you miss one, you¡¯ll get a ¡°MISS¡±. every ¡°COOL¡± will give you 200 scores, and every ¡°GOOD¡± will give 100. The game also have JAMs and COMBO. When you get a ¡°COOL¡±, you¡¯ll also get 1/25 JAM, and every ¡°GOOD¡± will give you 1/50 JAM. After you get one JAM or more, every JAM will add extra 10 scores to every ¡°COOL¡± and 5 to every ¡°GOOD¡±, so JAMs is very important for getting scores.
If you beat notes incessantly, you will get COMBO. 2 notes will be 2 COMBO, 3 notes will be 3 COMBO, and so on. But, if you miss one note, the COMBO will back to zero, and all the JAMs you have will be lost.

For example, you get 45 ¡°COOL¡±s, 65 ¡°GOOD¡±s, then 1 ¡°MISS¡±, then 38 ¡°COOL¡±s, the scores will be 200*25+210*20+105*10+110*50+115*5+200*25+210*13=24055.

Now, Dreamwind will play this game in another style. He wants to get s scores in a game that have n notes (and of course he can get more scores), and let the maximum number of COMBO as small as possible. However, Dreamwind knows he can get at most c ¡°COOL¡±s during this game, but he can control himself freely to get ¡°GOOD¡±s and ¡°MISS¡±s. Can you help him to find out the smallest MAX COMBO he can get?
 

Input
There will be several cases in the input. For each ease, there will be one line with 3 integers n, c, s (1<=n<=50000, 0<=c<=n, 0<=s<=1000000000) as described above.
 

Output
For each ease, you should output one line with a integer: the smallest MAX COMBO that Dreamwind can get. If Dreamwind can not get s scores, just output one line ¡°impossible¡±.
 

Sample Input
5 5 750 5 5 900 6 3 700 10 0 1002 50 30 7982
 

Sample Output
2 5 2 impossible 37
 

Hint

HINT
first case: COOL+COOL+MISS+COOL+COOL, there will be 800 scores and MAX COMBO will be 2.
second case: 5 ¡°COOL¡±s, there will be 1000 scores and MAX COMBO will be 5.
third case: one possible order is COOL+GOOD+MISS+COOL+MISS+COOL, there will be 700 scores and MAX COMBO will be 2.
forth case: he can only get at most 1000 scores, so it is impossible.
fifth case: 30 ¡°COOL¡±s + 7 ¡°GOOD¡±s + MISS + 11 ¡°GOOD¡±s, there will be 7985 scores and MAX COMBO will be 37.
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-04-26 17:31:34, Gzip enabled