Problem J
Juggling Sequence
The Juggling Sequence is an integer
sequence with
-
, -
For every
:-
If
, then , -
If
, then .
-
Let’s sort the juggling sequence in non-decreasing order.
What is the
Input
The first line of the input contains a single integer
Output
For each test case, print a single integer — the
Explanation of the sample input
With
Sample Input 1 | Sample Output 1 |
---|---|
3 6 1 6 2 6 6 |
1 1 10 |