cf/mirror

REQ

CF
594D2500· grandmaster3s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
10
1 2 3 4 5 6 7 8 9 10
7
1 1
3 8
5 6
4 8
8 10
7 9
7 10
Output
1
4608
8
1536
192
144
1152
Sample 2of 2
Input
7
24 63 13 52 6 10 1
6
3 5
4 7
1 7
2 4
3 6
2 6
Output
1248
768
12939264
11232
9984
539136
594D.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)