cf/mirror

Serval and Kaitenzushi Buffet

CF
2085D2000· candidate master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
5 2
3 6 4 1 2
7 1
3 1 4 1 5 9 2
4 3
4 3 2 1
6 2
1 3 5 2 4 6
6 1
1000000000 1 1000000000 1 1000000000 1
Output
6
16
4
6
3000000000
2085D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)