Mimi decides to play a game with the following rules:
A
The
The winner is the person who can output the
Constraints
For all subtasks:
Subtask 1 [10%]
Subtask 2 [10%]
Subtask 3 [80%]
Input Specification
The first line of input will contain a single integer,
The next line of input will contain
Output Specification
Sample Input
Copy
5
1 1 1 1 1
Sample Output
Copy
5
8
9
8
5
Comments
Try using 64 bit integers if you're getting WA on everything except for the test case.