cf/mirror

Bit Game (Hard Version)

CF
2027E23100· legendary gm2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
7
3
1 2 3
3 2 2
1
13
45
5
5 4 7 8 6
4 4 5 5 5
4
6 4 8 8
12 13 14 12
3
92856133 46637598 12345678
29384774 73775896 87654321
2
65 12
110 31
4
677810235 275091182 428565855 720629731
74522416 889934149 3394714 230851724
Output
4
4
0
6552
722019507
541
665443265
2027E2.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)