Problem N
Skrift
Languages
en
is

Bjarki is going to write an
Bjarki forgot his eraser at home so now he is in trouble. He asks his friend Unnar to go to A4 to buy an eraser for him. Unnar is so good hearted that he takes him up on it and goes to A4. On the way to A4 Unnar realizes that he has no idea how much Bjarki will erase and is unsure what to do. He decides to first go to Didda the Oracle and ask her.
Didda is a strange woman. She told Unnar that Bjarki’s
writing could be described by
Now Unnar calls you and passes all this info onto you, asking for help. How many milligrams of eraser should Unnar buy?
Input
The first line of the input contains three integers
It is guaranteed that the sum of all the
Output
Print a single integer, how many milligrams of eraser Unnar
should buy to be sure it’ll be enough. The answer will never
exceed
Scoring
Group |
Points |
Constraints |
1 |
3 |
|
2 |
7 |
|
3 |
10 |
|
4 |
10 |
|
5 |
15 |
|
6 |
25 |
|
7 |
30 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
4 2 4 2 4 2 2 1 1 1 2 2 2 1 3 |
8 |
Sample Input 2 | Sample Output 2 |
---|---|
3 2 3 1 3 2 2 1 3 2 3 1 3 |
7 |