Turtle and Three Sequences
2003F2800· international gm3s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
4 22 3 4 21 3 3 21 4 2 3
Output
5
Sample 2of 3
Input
7 31 4 5 2 3 6 71 2 2 1 1 3 21 5 6 7 3 2 4
Output
13
Sample 3of 3
Input
5 31 2 3 4 51 1 2 1 25 4 3 2 1
Output
-1
58%
2003F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)