cf/mirror

Kim's Quest

CF
1912K1800· expert3s1024 MB⌨ stdin/stdout

Examples

Sample 1of 5
Input
3
1 2 3
Output
1
Sample 2of 5
Input
5
2 8 2 6 4
Output
16
Sample 3of 5
Input
5
5 7 1 3 5
Output
0
Sample 4of 5
Input
11
3 1 4 1 5 9 2 6 5 3 6
Output
386
Sample 5of 5
Input
54
2 1 1 1 1 2 1 2 2 2 2 1 1 1 2 1 1 2
2 1 2 2 2 2 2 2 2 1 1 1 2 2 1 1 1 1
2 2 1 1 2 2 2 2 2 1 1 1 2 2 1 2 1 1
Output
0
1912K.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)