Kim's Quest
1912K1800· expert3s1024 MB⌨ stdin/stdout
Examples
Sample 1of 5
Input
31 2 3
Output
1
Sample 2of 5
Input
52 8 2 6 4
Output
16
Sample 3of 5
Input
55 7 1 3 5
Output
0
Sample 4of 5
Input
113 1 4 1 5 9 2 6 5 3 6
Output
386
Sample 5of 5
Input
542 1 1 1 1 2 1 2 2 2 2 1 1 1 2 1 1 22 1 2 2 2 2 2 2 2 1 1 1 2 2 1 1 1 12 2 1 1 2 2 2 2 2 1 1 1 2 2 1 2 1 1
Output
0
58%
1912K.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)