cf/mirror

Teleporters (Hard Version)

CF
1791G21900· candidate master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
10
5 6
1 1 1 1 1
8 32
100 52 13 6 9 4 100 35
1 1
5
4 5
4 3 2 1
5 9
2 3 1 4 1
5 8
2 3 1 4 1
4 3
2 3 4 1
4 9
5 4 3 3
2 14
7 5
5 600000000
500000000 400000000 300000000 200000000 100000000
Output
2
3
0
1
3
2
1
1
2
2
1791G2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)