cf/mirror

Resourceful Caterpillar Sequence

CF
2053E1900· candidate master2s512 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
2
1 2
5
1 2
1 3
2 4
2 5
12
1 6
11 2
4 8
12 3
2 7
6 12
8 1
2 3
5 12
9 2
10 3
10
1 2
2 3
3 4
4 5
5 6
4 7
6 8
4 9
4 10
25
1 16
11 22
6 14
3 1
20 14
23 17
25 19
10 11
3 18
10 6
2 21
4 5
11 12
4 9
9 13
8 6
6 1
3 7
8 19
10 24
15 13
1 2
3 4
17 8
Output
0
6
40
27
171
2053E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…