cf/mirror

The Enchanted Forest

CF
1687A1600· expert2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
4
5 2
5 6 1 2 3
5 7
5 6 1 2 3
1 2
999999
5 70000
1000000000 1000000000 1000000000 1000000000 1000000000
Output
12
37
1000000
5000349985
1687A.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)