Submit solution
Points:
1.70
Time limit:
3.17s
Memory limit:
512M
Input:
stdin
Output:
stdout
Author:
Problem type
Allowed languages
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
In case the statement didn't load correctly, you can download the statement here: Statement
Sample Input 1
1
11 3
123 3 2 2 7 2 1 5 5 7 456
2 10 2 8
1 1 1 1
1 4 1 3
Sample Output 1
16
123
5
Comments