cf/mirror

Infinite Sequence (Hard Version)

CF
2071D22500· grandmaster2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
9
1 1 1
1
2 3 10
1 0
3 5 25
1 1 1
1 234 567
0
5 1111 10000000000
1 0 1 0 1
1 1000000000000000000 1000000000000000000
1
10 41 87
0 1 1 1 1 1 1 1 0 0
12 65 69
1 0 0 0 0 1 0 1 0 1 1 0
13 46 54
0 1 0 1 1 1 1 1 1 0 1 1 1
Output
1
5
14
0
6666665925
0
32
3
2
2071D2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)