10
Problem E. 3.24
Input file name: standard input
Output file name: standard output
Time limit: 1 s
Memory limit: 1024 MB

Example

standard input standard output
3
6 6 3 6 6 9 8 7 5 4
13 5 9 2 9 8 12 8 12 2
3 2 2 1 2 3 6 3 6 1
2