cf/mirror

Balance (Easy version)

CF
1732D11500· specialist3s256 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
15
+ 1
+ 2
? 1
+ 4
? 2
+ 6
? 3
+ 7
+ 8
? 1
? 2
+ 5
? 1
+ 1000000000000000000
? 1000000000000000000
Output
3
6
3
3
10
3
2000000000000000000
Sample 2of 2
Input
6
+ 100
? 100
+ 200
? 100
+ 50
? 50
Output
200
300
150
1732D1.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)