No.1406 Test
タグ : / 解いたユーザー数 355
作問者 :
PCTprobability
/ テスター :
akakimidori
kyoprouno
Problem Statement
You are given a positive integer $N$ and a sequence of non-negative integers $A_1,A_2,...,A_{N-1}$. There are $N$ students, numbered from $1$ to $N$. All of the students took an exam with a maximum score of $100$ points. Each score is a non-negative integer between $0$ and $100$, inclusive. For each positive integer $K$ between $1$ and $N-1$, inclusive, the score of the $K$-th student is known to be $A_K$. Output the number of possible scores of the $N$-th student for which the average score is an integer.
Also, when $N=1$, the sequence $A$ has $0$ elements.
Input
$N$
$A_1$ $A_2$ $...$ $A_{N-1}$
- All inputs are integers.
- $1 \le N \le 10$
- $0 \le A_i \le 100$
Output
Output the number of possible scores of the $N$-th person for which the average score is an integer.
Sample
Sample 1
Input
4
1 2 3
Output
25
One possible score of the $4$-th student is, for example, $6$ points.
Sample 2
Input
5
87 34 2 46
Output
20
Poor student $3$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。