Ticket 4862
Problem 1658 -f
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
1000
33 5
011000111110100010111111000100101
18 8
100100000100011001
36 12
011110111110101001010111110011011101
39 24
011110100000101100101111010011101010101
37 4
1001000110111110111110001001110100111
28 23
0010110111010101100101000010
37 17
1110100010111010001101111011100100000
17 14
01001111111011101
38 15
01111010110111001000001000101111110101
18 13
100110111001010001
19 12
1110000100100010101
29 5
00011111100011110101100101001
15 15
001101101001110
22 11
1001111100101010010000
37 3
0111010001110000110010010101101101000
23 4
10000100011001001011010
28 16
0110110011101110001000000110
36 18
101000011110110111101110111011110100
20 6
00101110010110101000
20 16
01000001011011010010
35 31
01001000110101110110011001110010110
27 4
110110111011101101011110000
23 22
11110010010001000100010
24 5
100111100010011010010101
28 15
1100010000011011011100110110
27 18
001011010001110111010100111
18 10
011011101000100000
37 36
1111010011011100101111001010101010000
20 10
00001001000100100110
34 6
1001101011001100000010100111100110
33 4
010000110001010001111100110101101
38 16
00110001111010100101111101010010001000
15 13
100111100010111
37 30
1001100000011101110101010101001101111
37 2
0010101110010101110001010011000011011
37 13
1101010011000010100111110101100011100
27 25
110000001111011111101100101
34 7
1100000011011010000001110000001001
33 1
010101101101000111100011010000011
17 7
01000001010010100
25 12
0100111011101001000010010
39 12
111011101001001111000110001010001111001
32 30
10100001110101100110010001010100
24 14
000001001011100101000000
27 27
010101011000010100001000001
27 24
000010110100010100011101000
15 10
001110011001001
32 25
10000010001101010101011001101110
19 16
1011101100010001000
19 9
1000110000101011011
16 9
0010011101110111
39 15
101101000100110010010000000011100111101
37 36
0100001101111001000011111111110001010
34 34
0011000110010101010111010001000101
34 15
1110110011101001001100010110101000
23 2
11110101111100110000010
22 5
1101011101001110101100
27 18
111011010111111011100000100
18 2
100111000100100001
36 35
000110011111111110110110100000000100
35 35
10101001101001000001010011111101101
34 15
1010010110110001111100011110001010
16 8
1110101110110101
17 4
11011100010001111
15 7
100000110011101
36 16
110111000011000101100111111111101000
26 9
00010010111100010110010100
15 4
000110011010000
15 10
001101001110010
36 1
011000010100001001101011010001110001
25 19
1010111101010001110010111
33 19
011011001000001000111111010011010
24 24
100110000010000100010000
38 27
10010010111001101111001100101001110100
34 28
1110111011100101100011101000011000
15 8
011000000110001
19 19
1111011111100101011
40 22
1100000100001011011100000110111110011011
19 2
0111011010110010011
23 1
00110110011010001001110
23 13
01001000101111110100010
35 15
01001011001101100111001110110001001
18 1
001110011010011100
23 10
01000101111000101101101
29 15
10100100101100000011111100101
28 19
1110010110110010110011100110
33 3
001000001101110110101110001111100
20 2
11000011010111111000
16 3
0110001100011000
29 4
00011001011010011110111010100
19 11
0101000111001010110
38 24
01100101000101010100010001100101100111
16 9
1010100111010010
32 32
00101110110010111000100110111111
32 24
01100110100111010101000101111110
31 13
0010001001000100111101000010001
37 6
1101011000101110010111001110101000101
26 1
00111010001110100110001000
27 16
100010001000010111111101101
35 18
11101010111110000000111111110010100
35 20
11111100000011011101110101010100000
36 21
000101101111000111001001001000100111
29 29
00001100001111110011010011101
35 19
00101011101001111101111110101110011
34 6
1011101000110101011011001101111100
24 17
100001100100100001111110
22 8
1000010111011010000010
18 16
001101100111011111
15 11
011110111000011
20 9
11111110101101000111
20 17
00010111010000110011
38 20
11001000000010010000011110001001100100
38 20
01100010111000101000010001111111010011
30 13
000011110110000101000000001101
22 21
1101101000100000010010
26 15
10000110011101100011011111
23 10
11101100000110001000110
23 9
00110110101000000010111
39 23
101100000100001100100101000101010001110
39 13
111111111110010101010101110010111100000
27 23
001100010001011110101100000
29 27
10010001100001010110101111101
20 17
00110110000011111110
33 1
110010000001111100010111011010000
28 12
1011000010111000000000111010
38 8
01101101101101100001011011110111101010
36 35
101100101001110110001010010111010010
21 21
100101100101111001011
20 16
11011010110110001011
15 1
110011001001011
20 19
01100100111000110100
37 22
1110011110110000011001100110001111000
38 32
01000011000000101111101000011001001000
17 11
11111011000101010
36 27
111101100110001010010001100001101111
27 9
001011100100000110111010011
22 9
1011100011110011011110
25 18
0110011000010110011111000
18 2
110000000100101110
39 8
000101001010010101010011110011011000010
19 6
0000111010000001001
36 9
001110011101010111011101111101000111
38 17
11001010100011110111011011100000100100
31 14
1110011001110111011101101011010
37 26
0111101101111111011111110111110010001
39 15
101101001110101111111011010101111100010
18 16
110100101111110111
29 16
01000111110100000001010010011
32 1
00110000010010111110111000001100
23 4
00111101100111010110101
21 3
000010100000100001001
38 8
10011000000101010111111110000111101000
40 31
0011010001000100001111011101001010111101
24 24
111111111001101100001100
37 15
1110000010111110010111100000110110010
26 5
11101011111101111011001000
30 29
000111001101110011010011100010
20 11
11100110110001011110
31 22
1110101110011100110011101011001
16 10
1101010100001011
19 6
0001000101111110000
33 29
001100101100110001110011100000111
25 15
1001111101110100010011100
33 27
011100100101101100001101011000111
21 12
011111111000110111110
32 27
01011101011111110110110001111111
26 14
01011101011001111010100001
37 16
1100001111001010100001000101111001110
32 14
11110111001100110011100101011110
30 8
100001110010111101000010000101
38 22
00110101110100101011010100000010101110
36 14
110100011011100100010101010000001110
19 14
1000011100011111001
30 30
010001101101111000101011011011
40 28
0001111101100010011110101000100000001000
37 30
0011001111000111101100001011110100111
33 22
010010011101110010100001001011000
26 19
01100010100101010001011111
17 16
10111110111000010
40 2
1111101100110110011110001101110110110001
22 20
1011111010001010011100
25 7
1100101011100100100111011
36 17
111110000100110101010100010110000111
19 9
0110100011111111101
25 17
1100101011111000000000011
15 14
100110101011100
19 3
1110111010001100100
16 1
1101111000010011
37 32
1110010010011100111100011100101011010
37 9
0011000111101011111100101101111101011
21 21
001101110111001110000
32 3
10000000110010000000100100100010
23 17
01101001110100100001110
29 12
01001010000000101110110110111
38 33
00100111100101110100000100111110000000
16 3
1111100111110101
39 23
001011100110011011110011101010110000001
19 2
0001001111011101101
30 7
111110110011011100010010011000
26 24
11001110010001111100000100
38 29
11000010110101100001101111111110110100
18 2
000010000100110100
22 17
1110000011110000110111
16 13
0110000110111111
27 18
010011011000000010101101101
28 13
1001111101000100101111010110
35 35
11111101001111000111100111100111100
36 26
010110000001001010010010010101110110
24 23
111101110011001110001011
29 19
01000001010001011001010111000
21 3
010110111100110001101
26 10
11111111111100010011100010
35 13
00111011010000101010100110101101100
29 11
00101100011011101101010101000
37 22
0001100111110100011000000001110101100
20 2
01111101111000000011
27 26
110100010101111010010011100
34 25
1001011100010100110101101100101000
16 15
1100100110000011
33 7
010000111110011110110011100011000
27 24
110000111000100101000001011
22 13
1011111100010111100010
31 26
0001101001001010010100000000010
20 20
10110010000010011010
24 12
111110100101010101110001
30 21
011100001010110110111010011100
37 5
0111111010111000011110011110010000100
16 1
0010110000000001
27 21
110011001110010010110010100
38 32
11111101110001111011111110000000001111
22 20
1100001011000110100111
21 17
110101011100001101001
15 9
101111100010111
20 17
10010000111101001100
25 6
1010000001101001000010110
26 25
11011000010110111101110100
27 6
001000000011010110011100001
38 15
11100000010110011011000110010110101110
22 14
0100010110100100101110
20 10
11000110010100111011
27 25
001110101110100110010010011
32 16
01010100110011011101111001011101
40 18
1111110011000001111010110001111010100110
33 8
110000111110010110111011000010111
33 19
111110010011010101101001110011110
16 11
1100011101110110
37 19
0000100111000011100011110000000010011
20 7
11011110000110100101
32 6
10010110011010011000000100101110
17 4
01011101001000101
18 10
001000001111100010
21 9
010001101010101001110
30 15
000010011001001011010001100101
35 26
01011010001100110010010111110001100
20 15
11111101010011010100
35 2
00111011100101111101110110110110011
29 24
00100100001100100100101000101
37 25
0111111010010001010000101101001101100
22 3
0100000111010101010010
31 3
1110011001111110011001001010010
22 21
1001101001100010100010
23 21
00000100000000100011011
25 23
1110100001001101110101011
18 17
000101000111110110
34 13
1011011001110001000010111011110000
26 24
11110011000010110111100001
21 12
011000011111101010110
34 24
0010010010111101010101010011010100
36 12
011001101000111011101010110111101001
40 24
0110111010001100101101001010110000110100
19 9
1011110100111111100
33 27
111101010101100010100100011011101
40 4
0101001010000111010011110101001100011000
29 5
10111010110010110000100110011
30 11
101011110101100111110111000101
17 13
10111001100110111
38 13
00111110011111100101110110000110101101
24 15
000101111101110011100100
15 15
111011101111010
23 7
00011111101001010110000
34 20
1110100110100001100000100011110111
15 10
110111011011100
20 7
11101100011111000001
28 27
0000001000000100000111011100
33 26
011101000000110011000110111111011
28 11
1001000000010001100010000010
18 14
000010110100110010
38 15
00011100100100100010111011010001111101
38 25
10101010011111101000100000101001101011
18 7
110001001011000100
38 11
11001010010101001111101000111111000111
33 7
110100101110001111100010110111001
16 13
0101101011000001
18 13
000110001010110111
22 19
1000101011001000111000
17 6
10110000000101110
30 13
010001101001011010001011100010
36 30
001101110110111111001010101101100110
17 2
00000010001111110
34 14
1101011010011011100000111110111101
40 8
0010010001001001100100000110100010001110
20 12
00110100100011001011
20 8
11101000111100100110
15 6
110000010110010
28 26
1101111001000010110010100001
23 15
00010101110001101101111
32 31
10011011011001100110111100110011
26 7
10110110010110010100101001
26 12
10100111000011001001100110
33 17
011110001010110010110101011001101
16 5
0101111000110111
23 16
10110010101001011001010
33 3
100001011010001100110001100111001
38 9
10011010001001000011011111110010001111
21 3
000001011110101100001
26 4
01100001000010110100101110
40 23
1110101001011111110011111111100110101011
35 26
01111011011111100111000111111011011
34 33
0101101100101011111000011000110010
33 19
011000011111000100010111010011000
38 6
10100101111001111100011111011001111000
32 31
01001101100010101111010111101011
40 3
1110000111011010111110100000011101011101
36 16
010101100101110100110100111110010101
36 8
101100011110100111111100100111011101
31 9
1001100011010101001001001001110
19 9
0000000111001011111
29 13
00101111011010100010000010011
23 18
11100000111100111100010
18 12
001110100011100010
34 34
1001110101100000110111010000101001
24 24
000011011010100101001111
38 5
11001110001011100111011101011010000100
26 9
01010010110001001010101000
31 28
0101110111001101011100101111000
34 24
1000100010000001111001010111101011
18 12
010101110110101111
29 12
10110000001001000010011110100
38 20
10000001100000110001100001010001000010
18 2
000100010110101000
29 24
10101000101001001000010010100
20 4
11000010000001101011
29 2
01100010010101111000110101100
16 9
1101000101111111
37 9
0100110001011010011110111111110000110
30 13
010000011001101011011101011100
26 25
10010000001110111111010111
27 16
001010110010100010000111000
34 14
1010101111011110110101000001100100
29 22
11100110100001010001000100010
23 2
01000001001101001110010
28 11
1001100111011000011001011100
16 7
1010001100101110
29 16
00100000111101111001101100011
17 14
11001000000011000
40 26
1100101100001110110001001101111101000000
26 14
00101111011011001101010001
26 19
10001001011010100100001011
18 10
100001010011101000
30 10
110110010110111011111110111101
27 14
000000111100010101101100110
37 29
0101000110011111011000110101000100101
20 17
11001111000110100101
29 13
01011110010011100110001111111
27 22
011111010110100100001001110
15 8
110111010101000
27 24
000001101011111110101010110
25 2
1110101000000010101100110
16 13
0110110100010011
34 16
1001110011101010000110010101101000
21 19
001010111000000101110
39 2
001101001110000111110001101100100001110
39 31
011101000000101101111001000000010101001
21 12
111001101011111100110
30 3
101110010000000101001110101010
37 14
1101101011000100101010010000001110010
40 32
0101000100010101111000111001110000101110
24 12
011111011100100011111110
18 14
010000101100101100
28 25
0011101110001001001101011101
28 21
1101100010011101011100101000
21 9
001011000000110001010
21 18
110110110001010010100
20 16
11100010010011110110
36 15
001001110011011001100001010011101000
27 16
010010000111010000011000000
37 3
1110001001110011110000111110101110111
39 25
001100100010010011100001110010111111011
37 8
0000101010000111010110011100001111101
27 22
010101010010101111110100001
15 15
011100001000001
26 11
10001100001001001101100001
31 11
1110010011101110011011001101010
22 12
0101101110011100110101
26 9
11100010110000100101100110
36 20
110111010101100110100001111111111111
40 6
1010110101100010110110110111001111010000
18 2
000100011011000010
24 21
110000100111000100111101
36 14
000111110010011111110011011100001001
38 34
11010010100001010100001001011110010011
27 25
010100001000100001110011100
29 2
00111100101010100110110010000
20 5
10001001010001001001
37 14
0010101001000000010011001010100100110
20 11
00110110011111000011
37 20
1110111110010111100111110001010111111
28 20
1110100100111110100101101011
20 17
01101011001110101010
30 7
000100101011100010011100111100
25 9
0101101010001101111100101
22 17
0111100011111110100011
28 22
0111111101111011001101010100
26 24
11000001011010011100010111
17 16
10110101101010000
35 18
00010101101110010111100010011010101
23 13
10001001101011111100100
26 26
01001100010001000101101011
30 26
110111010000001101101111111000
22 8
1011000101000001001010
26 1
01011001010011010000000000
32 11
10000010111011011101111101111000
31 22
0011110110001010011110010101000
31 15
0001001011011100100111010111011
22 11
0101000000011001110010
15 1
001000111110100
34 22
1101101010010010101001001011111011
18 6
110001011000111100
15 11
101011101011000
33 5
001110001011011110110110100111101
32 18
01100011110101110100000010000001
19 16
0100111100110010001
35 13
10000010110001001010110100111100000
25 9
0000001011110011101010011
17 12
00000010011100101
39 29
100111110000011110011001011011100110010
28 1
1000111011000111001101110000
38 19
01101010010111001110110010101111010001
24 9
101110011110010001110110
27 4
101101110000000100011000111
33 14
000100100010000001100001101010000
30 10
000000001100111000110110000001
35 8
00000000010011101011100010001110011
34 28
1100101010010001010110110010110011
36 17
000101000100000100101000000000111011
33 32
011010100000010110101111110000000
25 8
0011110100110001011111011
30 7
010010001010100000000100001011
16 6
0100001001101110
20 8
01111100110100111000
27 12
000001100101111100101000001
29 16
11011000011010100101110101110
22 19
0000101001010110001011
28 23
0100000000011100010001001110
35 4
01001010011001010100110111010111111
19 17
1001101010011101111
30 9
010111000000101010000110001011
38 24
10010000010010110110101111001000001100
26 2
10010000000111010100010110
26 15
00000101010110100000100100
25 24
0000111101100101000001110
35 7
11111101111001001101100110000110001
32 28
00010011111111111001101100011010
27 11
101100110011011110110001011
27 14
110001111100110101011101100
39 23
111001110011100111010101000001100001010
35 31
00110000010000101101110101000000001
29 21
00110110011111111110011111110
24 16
011111000111011011111001
23 12
11110001011010010111111
25 7
1100100100110010000010000
20 6
01111100101101110000
36 14
011111000000111011011101111110001011
32 30
10100011000101010001111100111010
36 9
101000001011010011001011111001010111
25 10
0101111000011100110101001
31 10
1011001110001111110010100001101
37 37
0100100010010110011110011101000101000
33 31
010110010000110010101010111101100
27 20
000111011000000111101010100
39 18
110011110101010111011010011100001100000
37 29
1011100111110000100101100011101101000
17 12
01101001111010011
29 3
01100010100000010101110100001
19 8
1100111101110110110
37 4
1011011000111101100101010011001111110
29 19
00010010011011101100001101001
17 16
10100110111001101
20 13
00110111101010101010
34 16
1110100010010100010111101010011100
40 32
1010100111101110100011011001010010010011
19 8
1110000000011101010
35 17
01001011010100001001001111000110011
29 12
01101101100011011100000111110
30 7
111101000000100000100110001100
40 7
1111000011000001101010111111100001110010
33 25
011100011100110111011011111010110
15 2
100011111011001
16 4
0111110111100111
16 1
0101000000110010
16 4
1011001010101101
22 6
1100000100000100000111
37 35
0000010100111111000111000110101101111
18 2
010101110111100110
31 10
1010000110111100110101001000100
15 12
000010001100010
29 21
10111001100001101111101001111
34 18
0110001000100011101110000111101000
29 7
00110000011011111111000100110
24 2
111001111011001001010010
23 4
01100100010100100101000
17 14
11010111101111001
33 9
101111101011010101001110100111110
15 15
011110101010011
17 15
11111111111101010
17 8
01110001110011100
21 6
010100011100110000110
31 16
1101101111010011000011010110010
31 2
0010000110101100100000000011000
24 7
110111101100000001111011
17 4
11100011011010011
27 22
011101001111110011110000100
30 22
111010111100110001000110000101
29 21
01011100111101010100011000011
20 15
00101111111100111100
25 4
1100111010001101010001110
29 26
11010010001101101001010111000
35 5
01010001111001111010110000101101001
22 8
1100101111101010110011
38 25
01110010100000101110011110101100110111
35 23
10011101011001000110101100100001011
40 25
0110001111110001001110100000110000110110
28 8
1001111101111110011011111010
35 28
10101100000001010010001111100101110
31 24
0100111010111100000110101011001
24 4
001100000000111110101110
29 16
11111001100110100101000110010
17 16
11010110111101110
19 13
0101101110111101100
35 3
00101011010111000111000011000110100
29 4
11101011101111111011000011110
18 7
000110011110000100
39 32
111101110001110000001000100101110100010
21 14
010000110111011001011
18 15
011001100111110001
39 35
011011011000010100001001000111111011010
38 28
01111101011100010010101000010110011100
16 6
0000001000110001
34 1
0110101000110001011111001100111100
30 15
111000011100110001011010101011
21 15
101000100100101100111
24 7
001011000101101111001101
28 3
1101011010101100111001011010
15 10
001111100000000
20 5
11100111001101010001
30 7
011000010101110010011011001000
29 23
00100010001010000101100010011
22 12
1100110100010011110110
15 14
111000001101100
28 8
0011001000100011111001000000
21 2
111110111011101010111
28 18
0100011001111100001101111101
35 27
01110010000101001000111111110001010
22 21
1011011001101011100101
29 16
11110001110001100101001111100
26 19
10101010110010101101010110
35 31
00010111011111000100101100101111011
28 18
0011010110000010101010110100
29 26
00110110001000110001100101101
29 3
01000010011101001001110101011
16 15
1100011110011110
20 19
11010110100000001111
38 13
01110011000110100100111011101000110001
24 6
100111010011101100101110
33 30
010001001101100011011110100100100
29 12
01001111110110000000010000010
39 38
000001011110110100010000101011010011001
35 27
01011101101101100100111001011110010
15 9
011000010000000
19 11
1011010000101100001
29 17
10111110011010010110001011011
22 1
0011000111100111110000
39 3
110001101100010011011101111100110100000
22 16
0010001101001011000000
39 19
011101111010011111101011001001100110011
30 20
100000110110011010010101110100
31 18
0010101000010011000101001011111
29 18
00000101011101101110010101001
18 10
011000100000000011
15 1
010111111010010
24 1
001010011111100001011110
35 21
01000000111010101001101011110100111
22 10
0000000000101010000000
27 14
011001011011110001101000010
24 22
010010010001110011101001
20 10
11010001111011011110
18 18
000001111111101110
39 2
110001111000000101110000101110011000110
40 23
0110010000000111001001011101001110111110
30 9
001111001111110110001110010000
32 29
01010100101001111111111001110010
38 17
01101101001001000101000111001001110101
19 3
1010111001100011000
33 24
001001011010101111011001110010111
20 20
10111110111001001110
16 6
1101110101001101
21 2
000001001010111010011
40 25
1111101011111000001000011101001110111011
35 30
10110100010001101001110101111100011
33 29
101110011110010000111010011000111
15 3
000101110000101
39 31
110001000011110101100101000010110011010
16 8
0101010010101100
17 7
10000011011110000
32 8
10011111011101111111001110101010
38 22
01010110011100100101011100110001011000
16 4
1111101001001111
31 13
0110010100101001110101111101100
35 5
11010011101110100110010100010111010
29 24
11000011010110101101001011001
27 16
110011010011001110010101000
30 14
101010101111000111110011010111
29 9
01100001011011011001010101000
28 8
1101100101101001101010100000
16 2
0101010100110001
26 17
00000010001101101110100110
26 3
10111111100100010100000100
21 5
111000011001100111100
30 23
011010101100000111010101010010
30 30
010110111110110111100010111100
40 16
0001010100111000100001101100111001111011
31 15
1011101001100101000011001000110
15 6
100000111111101
38 25
10010110101101000110101111110100000110
22 15
1011011010010010100011
17 4
01011100111110100
23 1
01110110010111010001011
22 16
0110010011101101001101
31 10
1001100001001000011110101110000
16 11
1010100100100011
32 15
01010100110000011111000001010101
27 26
011000110001010001000000101
22 20
0000110111101101101001
30 26
000110000000110001101011011010
22 9
0101000001000011010111
39 31
001110000010011111001010101000111111001
39 5
100001111101101101100010111011011010001
38 28
01001010101000010111011001011001010011
36 32
001111101101100001110000111101010011
26 13
01000011101001111110011010
35 13
00101111000011101000010001000010000
35 19
11101000100001010111010101100000101
22 4
1010110101001010110100
28 18
0001101100011100010101111111
20 10
11000011100011000101
31 30
1100110100000001001001000000000
36 30
100111000011010000001100011001100010
36 15
000010001010101001100100001011111101
21 10
111111110011111101111
24 24
011000111101110010111101
29 27
00011011110110110100101111110
15 3
111010010000001
31 1
0110101011111100101101101101001
16 4
0111110010101110
27 24
000110000111100000111001100
37 25
1110101011101001000011110101100010000
39 13
011101001010110111010101001111111001001
37 27
0110100011101110000111001100011010111
35 25
00110011011100011110101101100110101
21 13
001101100010001110110
24 16
001000010111001000111001
28 1
0111010000111100011001110100
22 9
0001010010000111001100
33 4
010111000001000011001111010100111
18 2
011011001001001100
18 4
011100111011100000
32 3
11011001111001101111101100101010
19 16
1010101100110000100
21 13
010101111011101001111
20 19
00101000100101010010
32 7
11100110011010001001110111010010
37 26
0101001100001011100101101001100111100
20 19
10110101100110000111
25 1
0010110111111111001111100
20 15
11010000001001001100
29 1
01011101100010010100010000100
37 1
0010111000000011000010110010001011110
36 20
010100101101010001000110110110001001
30 30
011001111110001010110111100101
24 9
111101101100110100010000
24 16
100001101011100011000111
26 12
00000001100101010100000010
34 28
0100100110011101011011010011011010
40 9
1101110010100000011110101111010111011001
37 25
1110100100110000011110101001010111111
29 15
01010001101000011000010110010
15 12
000000001111000
26 14
11111101100101101110010000
29 13
01010000011101111101000111101
31 1
0100101001000010001100110010011
39 31
101010111001110101011101110101010100011
33 16
100001111001000010101111111011100
36 12
001011001111011010111000000000011010
19 11
0001000101000001100
25 16
0111011011100001101110110
40 34
0100111111110010100001001010110010110011
36 22
000010110010100000001110110010000001
20 2
11010111000100110110
32 8
10001001110111101001110110010111
38 9
11010101000011001111011000011110100100
33 30
101100011100011011100011101100000
21 7
011100110010011010001
39 24
101001001100001111011010101101101010101
31 6
0100110000100010100100001000011
18 7
011101101110001000
36 32
110110011110101000011110110111011111
39 23
010100001101111011101011110100001100010
28 23
1100101111110110110000110100
18 6
100111000110001001
21 16
010011001100011100011
25 19
0011000001101001001111101
31 30
1011001111101001011001001011111
21 3
000100000000111011101
18 7
110010100111101000
20 4
10000101111100111111
40 38
1110001111101101110110011000001101001001
23 3
01001100100111010101110
22 10
0010110101111110100100
24 6
110010101101000101111000
16 13
1111111010111111
17 4
00101011011010100
30 25
100111111000100101111001000111
40 6
0110010101010001011111000111001001010011
20 5
00000111011011101111
31 20
0110110000110111110110100111100
37 16
1011011111010000101011111110011000111
29 20
01101111110100000101111100010
20 13
01001000111000101111
22 16
0100100000100000000000
29 10
00001000111000011010110000000
35 10
00001011001110110101101110010001000
23 13
11001101101000000111000
34 31
1101100010001001011000010001101111
17 15
00010111101100101
40 30
0011001001110010111010010101010110111101
29 8
11011101100010000011010010001
17 10
00101011100100111
19 4
0011101100011111101
16 5
1010000011100110
36 28
000000001111101001001000001111001000
20 3
11101010001001010001
17 4
11001001000111010
40 30
0010010001000101011110011110101010001011
34 21
1110011000001010000011010100011101
39 38
011111000110110101001101001001001101000
37 3
1000101110001010100111111110011101011
37 6
1111010101010111110100101100110101011
39 13
000100110011000110110110100111110111011
23 21
01000010101001000111011
33 19
011110010111110101001001000111101
20 16
10011000000110111110
40 39
0110010101010111001010101110110101000011
19 10
0001001100101001101
28 18
1111010010011100000010100110
34 16
1011011001101010001010001000100010
39 24
101011100101100100111001110110010001101
21 8
010000100000111101100
32 24
11011010111010110100011110011000
19 6
0110011000001000011
24 11
101100011001111011100100
23 21
10000010000101011100111
32 8
00011100010000011010011011100100
20 1
11110010111000011011
27 27
011101111010010000100001111
24 12
101010111010101101010111
27 10
010100001100011001011011011
21 4
010100110100111011100
16 11
0100101101001001
15 3
101100000101001
16 3
1000110110011011
28 2
0101001100011111001011101000
28 3
0001111001101000001010101011
37 34
0001010100000000011011010011101010111
16 14
1001100011100011
36 4
011100111001101100000000010110011111
29 26
00010001000010000101011110111
33 15
110001100110100101001101110011111
15 2
100001001111010
23 19
10001001001010111011110
34 16
0111100110111010101011101010100001
22 15
0101011110000000000001
25 23
1010000111010100000011110
25 9
1001000110001000100000000
29 9
10110110111000010110100110001
28 8
0001001110110101011101001010
22 4
0011110010001101110110
20 6
11001010001110011110
28 1
1011100010000100111110100011
31 27
1010101100100100100111000110101
26 22
00100110101101110001101000
34 15
1001110011011001010011010000011011
24 4
010101011111000010010000
31 18
0001000010110001100100111100101
16 3
0001010001110111
35 20
11101110001101111011001111010001011
34 32
0100000101011011110001101000001010
31 7
1100000000011111101010100101100
32 1
01001000101001011001001001100011
31 1
0110100111011000010011000001010
35 5
10000001111100001000101100111010101
37 37
1000010010001011101110110111011111110
22 12
1000010110101010110010
29 12
10000101111100101010001110110
22 8
0111111000101110000001
23 20
00010101101010110110111
17 3
10111101001000110
33 11
110101011000110110000011010101100
27 6
010111101101000111001001110
29 17
10111110100010000011001001101
20 10
01101000111111110010
25 12
0111010011010001111101010
19 7
1111100000001110111
17 14
11001100000001110
16 5
1100110000101101
37 18
1011101101110101100100011001001010000
23 21
00101110100001110001101
18 5
001100001101111000
36 36
100100000000111011100000010010011101
23 11
01011010101100000010011
27 10
101100000000101101100110110
19 17
0100001101010001001
21 16
011001100101101001011
38 20
01111001001000010111110000011111101100
31 10
1101110001001111010010111101000
19 17
1101111100111110101
17 5
11101110100111011
26 23
11011110000010100111111101
40 9
0010100011101001001000110111111101110000
36 32
111110011111001111010001010100010100
33 33
101110000111100100100101010001111
29 14
10100001010010001110101010001
26 12
10001001010000001010000011
22 19
0111000110001011000101
29 21
01001010001100100111111111011
24 3
110000111101111101011000
35 11
01101101000101111111111100101001011
22 6
0000101110001110100011
39 4
100101110111100000010101110111010100110
27 11
110100110011100101000010000
34 32
0101001000011100111001011111010110
15 3
001100111111001
17 7
10101000110110000
26 24
11001110010100111100100001
28 6
1011011100011001001000110111
34 24
0011100101011110000001001011101011
24 4
000000101011001110001000
15 5
010111011010110
35 3
00011111111010111111001001011010011
16 15
0111110110110100
40 33
1111010011010101001000110101110001010100
34 4
0101010111001000000000000101100010
33 23
100111111100011100001110011110011
36 1
001000001010001000111011101100110011
31 2
1001111110100000011110110100101
22 2
0000001011110111011110
35 13
11100000011101101110010001000101111
15 8
000010011001111
26 15
11101010010000011011011101
38 17
00110000001001111101011001111000011101
17 5
10011011011011100
35 30
11111001010100011100010010111010010
38 24
00110001101101000011011011100000011000
39 16
000010101000011010000110111110000000100
35 13
10110111101001101111000110001000011
30 13
110011111010011101111001101100
40 13
0101001010000101011110010000000000111101
40 35
0101010101011010001100000100001000001010
18 17
001001111011100101
36 9
110001000000010100101010101100111001
27 15
111111101001100100001011100
33 21
001000011011010110011011100111001
34 19
1001001001101110100000000001001101
29 8
00010100110101110101011110111
35 22
10101010011011010110010101011110010
37 35
1000111000100010111000100111100010110
18 13
110000111101010111
27 22
111000111011101001101001111
15 2
110010111011010
34 8
0101011010100110101101110101001000
32 3
01000010010011111100110101100101
31 21
0100100010000111101010000100001
32 31
11111100111010110110010011101100
24 5
111011101101101010011111
38 30
10110001010101000111100110100010111001
22 18
1101110010100101011001
18 9
011111101011000101
30 13
101110010101101010000001111000
17 9
10000100001000111
37 23
1100001101101010000100110100101000111
19 3
0100100111110110001
36 20
000001110001101100100000101011111101
28 12
0010011100110110010001110111
23 12
01111010110111001111101
23 22
11001000111101010101000
16 13
0111001011000001
17 1
10001100010000000
21 12
111000011101111111110
32 18
01111011100000100001010101100110
30 21
111101100101110110101100010000
39 16
111010110111011011100001000000101110000
20 2
01100100011101101101
31 18
0111110001100001011101100101001
20 16
00110101011010100010
23 16
00110010011011010110010
28 15
0100111000001010100101101100
40 20
1111110110100010101100001110000011111110
21 2
101110011110111011101
17 4
11011010101110100
21 1
000000001001000000101
36 25
011010111010111010010100101011111001
32 25
01101101101100000111011100001101
27 24
010110001100110010011101001
35 19
00001111010100010000010111011101101
24 16
010110101111010111100101
16 5
1100101010000001
27 15
010110000110000010100100101
30 18
001010101101100011001011011010
23 15
01111000001111001101010
38 3
01111000101000111111010001011101111101
28 6
1111000010101101110000110010
23 12
01001100001101110100000
27 11
100000000110110111110010011
17 15
00011011101100101
33 22
010111100110101100011100111110011
15 9
111110100111111
36 28
110101010110010010110000000110010100
19 1
0011001001101001000
24 22
111000000011010000100100
33 14
110001100000000110011001101000101
28 17
1101111111001011100011011010
38 32
00100101101010100111000100100110111101
21 17
000001101000000111100
32 28
01010001111111110000100001100101
35 9
01000101001011110000111101100000000
19 14
1101110010111011100
17 7
10100001001101000
37 7
1001111011001100111110010101100100110
27 22
101111010001101101010010001
29 25
11110101100101000111001100101
18 6
010101100111010111
24 16
011111011010100001111011
40 4
0110001101001110011000010100100000000001
34 18
0010110010101011010111010111110101
15 9
011000011001000
31 5
1000000011111010101100100111001
32 15
01110100011000100000001111011011
20 10
10101110110000111001
26 6
11011101010011001011010010
15 12
110011010010111
30 26
001011001101101101010001000111
15 2
111100111101010
34 8
0001000110000101110011001111011011
17 16
11110111001011111
32 26
00011101111011001111000011100000
31 12
1100001111110100001100100110100
17 10
11111101100100011
16 15
1101100100001000
34 6
1111101001001011010000001001100011
24 5
111101111111111100001110
38 27
10011100000101111100101100111110111110
23 3
00001100110011000001010
26 16
00001011100011001001001100
29 2
00000100001010001001101110010
15 3
011101010111001
20 5
11111010000110111001
30 6
001011111011100100110101010010
35 27
00100011001100111011111110011000101
16 6
1010101110111000
30 28
111010111101110110101101001110
37 18
0110011011000101011100010000101010001
22 17
1101110001110101111110
35 4
01110101100100100110000011010110111
17 16
00100011000001111
26 16
11001010111101110101111100
24 20
111000000101011111010001
29 5
10011111000000011110111001101
36 27
001001001100001111011011010110111100
16 8
1011111110000001
29 4
10111110110010000011110101001
40 29
0000110011001001011000110101011110111000
29 3
00110100001101111111110111100
28 23
0001000011010000101111000001
32 7
01111010101110110101011101011100
30 14
010000101110010100010111111000
28 28
1011100111101110101100011000
15 8
010101100111110
22 18
0010001010101000010110
21 2
000110100011110111100
22 14
1100001101110010111100
36 32
111010011010110001001101110011011100
Expected Output
-1
-1
1
5 16
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
1 15
1
7 17
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
1 18
-1
-1
1
3 12
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
1 27
-1
-1
-1
-1
-1
-1
-1
-1
1
1 34
-1
-1
-1
-1
-1
-1
1
1 35
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
1 24
-1
-1
-1
1
1 19
1
10 31
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
1 32
-1
-1
-1
-1
-1
-1
-1
-1
1
1 29
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
13 32
-1
-1
-1
-1
-1
-1
1
7 19
-1
-1
-1
-1
-1
-1
-1
1
1 21
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
11 18
-1
1
1 24
-1
-1
-1
-1
-1
1
1 10
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
1 30
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
1 21
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
5 22
-1
1
1 35
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1
1 20
1
2 13
-1
-1
-1
-1
-1
2
1 1
4 22
-1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