No.745 letinopia raoha
Problem Statement
Piano Tile Ohara-kun is hooked on a certain rhythm game.
In this rhythm game, score is added by touching objects called notes with good timing.
The judgments are, from best to worst, perfect, great, good, and miss.
A perfect adds 100 to the score.
A great adds 50 to the score.
A good adds 0 to the score.
A miss adds 0 to the score, and 100 is subtracted from the life.
Initially, the life is 1000.
When the life reaches 0, the player fails and the song is interrupted (this is called a clear failure; conversely, being able to play the song through to the end is called a clear).
The life never recovers along the way.
In this rhythm game, the score added is doubled each time the combo count (the number of consecutive great or perfect judgments) increases by 100 starting from 1 (the score added is doubled from combo count 101. The pattern is such that from combo count 201 through combo count 300, the score added is twice the score that was added from combo count 101 through 200).
Piano Tile Ohara-kun has now made A perfects, B greats, C goods, and D misses.
Write a program that outputs Possible and the maximum possible score if a clear is possible,
and Impossible if a clear is not possible.
Input
A B C D
Non-negative integers A B C D are given.
0<=A<=400
0<=B<=400
0<=C<=400
0<=D<=10
[210121] Since the values are non-negative integers, the ranges were corrected to be 0 or greater.
Output
Output Possible and the maximum score, each on its own line,
or
Impossible.
Print a newline at the end.
Sample
Sample 1
Input
101 0 0 0
Output
Possible 10200
First, for the first 100 times, 100 is added to the score each time.
For the last, 101st time, 100 * 2 is added to the score.
Therefore, the answer is 100 * 100 + 100 * 2 = 10200.
Sample 2
Input
349 222 3 4
Output
Possible 517800
Sample 3
Input
400 0 0 10
Output
Impossible
Since there are 10 misses, the life becomes 0 and the result is a clear failure.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
asdf1