Ticket 14165
Problem 1694 -d
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
6
9
1 2 1 4 1 3 4 3 
3 6
3 8
7 7
6 13
1 14
3 8
7 14
9 12
11 13
9
1 1 2 2 4 6 3 5 
4 7
1 2
1 13
4 10
5 8
6 15
1 14
3 11
3 8
17
1 1 3 1 1 5 4 2 1 8 2 8 11 2 15 4 
9 9
1 3
5 9
2 15
7 8
7 15
1 7
4 11
8 12
6 7
7 14
4 6
2 4
10 10
7 11
2 12
7 13
13
1 1 3 2 5 5 5 7 7 6 11 6 
11 11
3 13
6 15
1 4
7 15
7 15
3 5
5 10
6 6
6 6
4 7
13 13
5 10
14
1 1 3 3 5 4 3 5 1 4 5 3 11 
2 4
4 9
1 8
6 14
6 7
8 13
7 9
8 13
2 7
2 3
4 11
1 9
2 8
6 12
6
1 1 2 3 3 
3 5
4 12
1 14
2 5
8 11
9 9
Expected Output
5
3
9
7
9
3
Generator Parameters
--L_or_R_high 15 --L_or_R_low 1 --n_high 20 --n_low 2 --t_high 10 --t_low 1