No.398 Halfpipe (2)
タグ : / 解いたユーザー数 87
作問者 :
koyumeishi
/ テスター :
りあん
Problem Statement
One of the snowboarding events is called the halfpipe.
In the halfpipe, each of 6 judges scores a competitor's run out of 100 points, and
the average of the 4 scores remaining after removing one lowest score and one highest score is the score of that run.
(Note: Some competitions may not use this scoring method.
Reference)
For example, if the scores of the 6 judges are {10, 20, 30, 40, 50, 60},
the lowest score 10 and the highest score 60 are removed, and the average of {20, 30, 40, 50} (=35.00)
is the score of the run.
Even if multiple judges give the same lowest (highest) score, only one of them is removed as the lowest (highest) score.
Example) {50,50,60,70,70,70} -> {50,60,70,70}
Example) {51,51,51,51,51,51} -> {51,51,51,51}
Now, since computing the score from the judges' scores was done in Halfpipe (1),
let us consider the reverse this time.
Given the score $X$ of a run, compute how many possible combinations of the judges' scores achieve it.
Here, each judge's score is an integer between 0 and 100, inclusive, and the judges are distinguished from one another.
Input
$X$
The score $X$ is given to two decimal places.
$0.00 \leq X \leq 100.00$
[Added 2016/07/15 23:20] No input is given for which the answer is 0.
Output
Output the number of combinations of scores for which the score of the run is $X$.
Sample
Sample 1
Input
0.00
Output
601
The input is given exactly to two decimal places.
[0, 0, 0, 0, 0, 0]
[S, 0, 0, 0, 0, 0] ($1 \leq S \leq 100)$
[0, S, 0, 0, 0, 0] ($1 \leq S \leq 100)$
[0, 0, S, 0, 0, 0] ($1 \leq S \leq 100)$
[0, 0, 0, S, 0, 0] ($1 \leq S \leq 100)$
[0, 0, 0, 0, S, 0] ($1 \leq S \leq 100)$
[0, 0, 0, 0, 0, S] ($1 \leq S \leq 100)$
These add up to 601 combinations. Note that the judges are distinguished from one another.
Sample 2
Input
100.00
Output
601
[100, 100, 100, 100, 100, 100]
[S, 100, 100, 100, 100, 100] ($0 \leq S \leq 99)$
$\vdots$
[100, 100, 100, 100, 100, S] ($0 \leq S \leq 99)$
There are 601 combinations in total.
Sample 3
Input
49.25
Output
6998725305
Be careful of overflow.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。