cf/mirror

Balanced Problem

CF
2029G3000· legendary gm3s1024 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
3 3 2
1 2 4
L 3
R 3
L 1
3 3 2
5 1 4
L 3
R 3
L 1
5 4 5
1 1 1 1 1
L 3
R 2
L 5
L 4
10 12 9
10 9 8 7 6 5 4 3 2 1
L 2
L 4
R 4
R 4
L 6
R 8
L 3
L 2
R 1
R 10
L 8
L 1
1 1 4
1000000000
L 1
Output
2 6
1 9
0 1 3 5 5
0 0 0 6 25 32 35 44 51
1000000000 1000000000 1000000000 1000000000
2029G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)