No.191 Election Deposit
Problem Statement
In a certain region, Koda City in Yuki Prefecture, a city council election is being held.
To run in a city council election, something called an election deposit is required.
(Election deposit: Wikipedia)
To stand as a candidate, one must deposit $30$ man-yen (1 man-yen = 10,000 yen) at the deposit office.
If the candidate's vote count exceeds $1$ over $10$ of the total number of valid votes, the deposit is returned in full;
if it is $1$ over $10$ or less, the deposit is forfeited in full and paid to the city.
Normally a procedure is required for the return, but here it is assumed to be returned automatically.
In Koda City, Yuki Prefecture, $N$ people ran, and each candidate received $C_i$ ($1 \le i \le N$) votes.
Find the total amount of deposits paid to Koda City, Yuki Prefecture after the election ends.
(Unrelated to the problem: the deposit amount and the forfeiture criteria differ depending on the type of election.)
Input
$N$ $C_1\ C_2\ \dots\ C_N$
All inputs are given as integers.
$1 \le N \le 100=10^2$
$0 \le C_i \le 1000000=10^6$
Output
Output the total amount paid to the city (in units of man-yen).
Print a newline at the end.
Sample
Sample 1
Input
4 500 300 200 100
Output
30
The total number of valid votes is $1100$, so the forfeiture threshold is $1$ over $10$ of that, which is $110$ votes.
Therefore, only the deposit of $30$ man-yen of the candidate who received $100$ votes is paid to the city.
Sample 2
Input
5 400 250 200 100 50
Output
60
The forfeiture threshold is $100$ votes, so the deposits of the candidates who received $100$ votes and $50$ votes are paid to the city.
Sample 3
Input
5 200 200 200 200 200
Output
0
There are also cases where the deposits of all candidates are returned.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
yoza