Ticket 5600
Problem 1671 -c
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
20
5 22
7 7 5 7 9 
6 14
5 9 9 7 1 1 
5 8
5 7 7 7 1 
2 29
2 4 
6 11
2 1 9 1 2 3 
3 28
5 8 1 
5 12
3 4 7 2 5 
3 23
5 5 7 
9 19
4 6 8 4 5 7 6 4 6 
9 23
1 5 9 3 6 5 7 1 4 
9 15
7 1 6 5 2 1 8 9 9 
6 25
6 9 4 7 7 6 
9 27
5 4 7 5 2 8 5 6 3 
3 4
2 3 9 
5 16
6 5 6 6 9 
5 30
1 4 5 9 2 
7 19
2 2 3 5 5 1 3 
3 6
6 1 4 
8 30
6 7 3 7 7 1 1 9 
5 2
3 6 3 7 8 
Expected Output
26
25
10
40
22
45
17
29
26
48
29
35
52
3
15
59
39
7
63
0
Generator Parameters
--n_high 9 --n_low 1 --t_high 20 --t_low 20 --val_high 9 --val_low 1 --x_high 30 --x_low 1