cf/mirror

XOR-pyramid

CF
983B1800· expert2s512 MB⌨ stdin/stdout
#dp

Examples

Sample 1of 2
Input
3
8 4 1
2
2 3
1 2
Output
5
12
Sample 2of 2
Input
6
1 2 4 8 16 32
4
1 6
2 5
3 4
1 2
Output
60
30
12
3
983B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)