Ticket 8897
Problem 1679 -b
View hacks & all small testcases

Unable to dry run this testcase?
Try making a new request with small values of n_high, t_high, *_high, etc.


Retry
Input
7 15
6 7 1 4 1 5 9 
1 6 5
2 6
1 3 7
1 1 4
2 7
2 9
1 4 2
2 4
2 9
2 2
2 5
2 1
1 6 4
1 6 8
2 7
Expected Output
33
42
43
41
49
63
56
28
63
14
35
7
10
14
49
Generator Parameters
--n_high 9 --n_low 1 --q_high 15 --q_low 1 --val_high 9 --val_low 1 --x_high 9 --x_low 1