cf/mirror

Battling with Numbers

CF
1866B1400· specialist1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4
2 3 5 7
2 1 1 2
2
3 7
1 1
Output
8
Sample 2of 3
Input
2
1299721 1999993
100000 265
2
1299721 1999993
100000 265
Output
1
Sample 3of 3
Input
2
2 5
1 1
2
2 3
1 1
Output
0
1866B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)