QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#600946#4276. Balls and HolesHuangHanShengAC ✓28ms4128kbC++20685b2024-09-29 20:05:022024-09-29 20:05:08

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3864kb

input:

2
1 1
2 1 2

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

2
2 1 2
2 2 1

output:

0

result:

ok 1 number(s): "0"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

2
1 1
1 2

output:

1

result:

ok 1 number(s): "1"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3736kb

input:

3
2 3 1
3 3 1 2
3 1 2 3

output:

1

result:

ok 1 number(s): "1"

Test #5:

score: 0
Accepted
time: 0ms
memory: 3796kb

input:

3
2 1 2
2 2 1
2 1 3

output:

0

result:

ok 1 number(s): "0"

Test #6:

score: 0
Accepted
time: 1ms
memory: 4068kb

input:

4
3 2 1 3
1 1
3 3 2 1
3 3 2 1

output:

6

result:

ok 1 number(s): "6"

Test #7:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

4
1 3
3 3 1 2
3 2 1 3
1 2

output:

5

result:

ok 1 number(s): "5"

Test #8:

score: 0
Accepted
time: 0ms
memory: 4064kb

input:

5
1 2
1 2
2 3 4
4 4 1 2 3
1 3

output:

9

result:

ok 1 number(s): "9"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

10
3 3 4 1
3 3 2 4
5 5 4 2 3 1
4 2 1 3 4
2 5 2
3 5 3 1
3 5 3 4
5 4 3 2 5 1
5 3 2 4 5 1
5 5 1 3 4 2

output:

27

result:

ok 1 number(s): "27"

Test #10:

score: 0
Accepted
time: 1ms
memory: 4108kb

input:

50
5 3 5 1 4 2
5 5 3 4 2 1
4 3 1 4 5
1 1
5 1 2 3 4 5
3 2 4 1
5 4 5 3 2 1
3 2 5 3
3 1 5 4
5 5 2 3 4 1
5 1 5 4 3 2
4 5 2 1 4
4 5 2 4 1
4 4 1 2 5
3 2 3 1
4 5 2 1 3
3 5 1 4
5 4 3 5 2 1
1 2
4 5 2 1 3
2 2 4
2 4 2
1 1
1 2
1 4
2 4 2
4 1 4 3 2
4 1 4 3 5
2 3 1
3 4 1 3
2 1 2
3 5 2 4
2 2 1
4 1 4 3 2
4 1 2 4 5
1...

output:

721

result:

ok 1 number(s): "721"

Test #11:

score: 0
Accepted
time: 1ms
memory: 3812kb

input:

50
7 2 10 9 5 6 3 1
10 1 6 4 7 9 2 10 3 8 5
10 2 1 10 7 8 4 6 3 9 5
4 3 8 9 5
3 4 5 2
10 3 7 1 4 10 2 9 5 6 8
5 1 9 3 4 7
8 2 5 3 8 6 4 7 1
1 10
10 3 8 6 2 9 10 4 5 1 7
7 4 10 9 8 6 3 2
8 4 9 6 3 1 7 10 5
7 10 5 6 3 4 1 7
9 3 1 10 8 7 6 4 2 5
2 1 2
7 3 5 8 4 1 2 10
5 8 2 3 10 5
10 10 2 8 1 5 3 4 7 9...

output:

596

result:

ok 1 number(s): "596"

Test #12:

score: 0
Accepted
time: 0ms
memory: 4116kb

input:

300
11 14 7 1 15 13 19 6 20 11 3 17
19 4 8 2 15 6 11 12 9 16 13 17 7 14 20 3 10 19 18 1
3 7 5 6
2 19 5
5 18 20 16 7 2
11 1 8 2 6 16 19 15 20 11 12 14
8 17 6 19 9 7 1 12 10
20 20 15 4 18 12 6 2 19 14 10 17 9 13 11 5 8 16 7 1 3
8 5 20 16 18 11 8 2 14
9 14 2 17 4 12 19 20 18 7
10 9 20 10 16 2 18 11 5 4...

output:

23348

result:

ok 1 number(s): "23348"

Test #13:

score: 0
Accepted
time: 27ms
memory: 3824kb

input:

5000
10 28 4 20 14 40 26 3 18 50 23
22 19 18 7 15 4 28 39 22 17 37 42 41 10 27 9 50 47 14 49 35 34 44
25 46 28 16 12 6 33 18 13 27 4 35 38 31 14 25 3 19 30 7 49 11 1 2 42 29
30 15 45 20 1 22 28 8 47 16 36 13 17 6 48 46 12 7 43 19 42 11 30 27 31 3 2 44 49 23 32
47 11 10 35 32 21 46 50 9 3 24 20 12 13...

output:

6339644

result:

ok 1 number(s): "6339644"

Test #14:

score: 0
Accepted
time: 25ms
memory: 3836kb

input:

5000
6 32 20 23 43 10 9
31 26 24 23 35 41 12 6 28 33 46 38 40 47 17 34 31 18 42 5 22 20 29 48 21 4 15 43 36 14 39 45
18 4 15 16 40 1 47 22 9 43 39 21 41 20 48 28 6 8 14
31 32 44 30 18 16 26 24 23 12 4 31 1 42 38 5 33 2 13 34 25 11 46 17 10 47 21 35 7 43 48 29
21 4 42 22 10 40 25 48 47 29 1 26 32 7 3...

output:

6257845

result:

ok 1 number(s): "6257845"

Test #15:

score: 0
Accepted
time: 25ms
memory: 3820kb

input:

5000
48 45 31 6 5 50 15 2 36 32 33 8 27 47 22 43 7 19 39 11 46 18 21 3 26 28 9 41 37 42 12 23 16 13 1 49 20 25 10 34 17 14 48 44 4 24 35 29 40
44 34 30 49 43 22 37 5 39 21 13 45 48 14 16 38 40 33 27 26 10 17 2 15 12 46 29 50 18 9 36 44 47 28 41 20 35 23 11 8 42 32 25 4 19
43 28 43 11 20 40 5 48 42 3...

output:

6417920

result:

ok 1 number(s): "6417920"

Test #16:

score: 0
Accepted
time: 25ms
memory: 3840kb

input:

5000
48 7 12 22 10 50 18 8 34 3 14 28 1 37 19 42 4 17 43 24 39 16 11 44 41 45 49 31 36 25 46 32 5 23 33 35 27 47 21 15 38 20 6 30 48 29 26 40 2
28 42 33 10 20 47 19 16 23 4 29 49 9 18 34 6 12 48 25 46 13 31 1 2 44 40 15 11 24
22 14 6 19 46 9 48 18 30 24 34 37 23 4 27 3 5 12 33 50 15 41 1
8 9 46 37 5...

output:

6362284

result:

ok 1 number(s): "6362284"

Test #17:

score: 0
Accepted
time: 25ms
memory: 3804kb

input:

5000
37 16 31 32 33 38 45 39 21 24 41 6 28 48 17 10 49 27 35 29 25 3 23 44 5 9 34 14 37 13 36 42 40 7 19 8 18 1
28 30 45 20 21 48 12 15 11 39 7 42 23 4 5 22 16 40 44 1 38 17 50 2 41 26 14 24 3
42 26 42 38 23 8 33 12 17 24 20 14 49 22 28 19 4 50 18 13 10 3 15 35 47 40 30 11 32 48 29 21 46 5 41 6 44 4...

output:

6389648

result:

ok 1 number(s): "6389648"

Test #18:

score: 0
Accepted
time: 25ms
memory: 3868kb

input:

5000
3 4 22 11
26 30 46 15 4 29 10 50 14 38 7 18 28 17 2 23 24 8 11 9 21 6 26 5 43 34 41
31 24 16 3 13 7 47 25 12 49 34 50 46 18 1 2 20 37 36 33 31 11 32 44 8 30 15 42 39 26 9 4
35 15 19 6 41 49 45 47 31 44 2 29 25 20 36 32 22 43 4 50 39 10 27 9 28 3 42 16 21 18 40 38 14 48 34 17
50 14 17 7 26 23 35...

output:

6457040

result:

ok 1 number(s): "6457040"

Test #19:

score: 0
Accepted
time: 26ms
memory: 3768kb

input:

5000
24 27 15 12 42 31 45 49 10 46 1 14 21 28 40 9 3 35 43 6 34 11 32 2 24
30 10 6 22 37 5 9 8 19 41 26 27 16 7 23 35 2 12 49 40 14 44 46 45 32 18 47 39 33 24 31
41 22 34 19 16 4 21 31 45 18 5 50 14 12 27 42 13 15 29 28 43 10 32 1 35 24 17 26 9 46 40 39 38 48 7 6 25 23 47 3 41 33
27 11 10 40 38 45 4...

output:

6389257

result:

ok 1 number(s): "6389257"

Test #20:

score: 0
Accepted
time: 22ms
memory: 3912kb

input:

5000
37 38 7 8 41 20 47 23 18 40 14 3 39 30 45 44 49 13 27 33 19 42 34 4 28 12 2 43 6 35 29 16 1 17 10 11 26 15
24 42 23 33 1 31 10 3 18 4 38 32 13 50 19 47 24 22 11 20 5 49 7 29 35
12 1 41 21 39 10 5 42 7 36 35 4 32
45 6 21 8 31 2 36 47 7 33 43 10 22 20 13 23 37 19 28 3 49 16 30 32 44 35 26 14 29 4...

output:

6434201

result:

ok 1 number(s): "6434201"

Test #21:

score: 0
Accepted
time: 25ms
memory: 3708kb

input:

5000
23 19 14 45 38 32 22 39 30 17 4 6 5 50 44 15 42 1 23 33 29 26 16 10
20 30 31 3 27 37 36 7 10 1 8 6 33 14 47 11 22 26 34 16 50
10 33 37 16 28 47 23 6 40 41 9
2 45 30
13 18 11 30 5 42 35 38 20 21 14 29 25 46
11 40 22 31 42 32 48 49 12 4 13 33
47 12 48 29 2 42 10 34 15 18 24 21 45 8 28 14 32 30 23...

output:

6376130

result:

ok 1 number(s): "6376130"

Test #22:

score: 0
Accepted
time: 25ms
memory: 3908kb

input:

5000
17 32 21 42 36 5 30 9 46 48 29 15 26 19 39 4 16 35
40 15 39 35 47 44 13 14 17 45 25 40 49 7 50 12 19 43 20 5 26 9 21 6 1 46 10 11 41 4 37 33 18 32 23 42 29 48 3 34 8
22 6 49 50 19 18 3 34 24 38 30 10 11 41 22 42 31 12 21 15 23 40 13
6 39 35 50 28 8 38
21 37 20 4 15 22 48 29 18 44 14 10 24 42 41...

output:

6405143

result:

ok 1 number(s): "6405143"

Test #23:

score: 0
Accepted
time: 28ms
memory: 3888kb

input:

5000
14 31 4 40 38 39 11 47 50 29 24 16 34 36 8
11 20 50 33 37 1 18 25 9 23 49 22
8 3 36 35 49 34 31 14 12
10 34 14 21 26 12 45 2 44 16 50
6 12 37 14 42 50 24
22 41 17 39 28 50 40 42 37 12 38 9 32 5 48 36 21 22 3 16 11 30 19
19 33 35 20 42 19 32 43 6 40 24 13 31 48 22 23 10 15 12 17
46 23 27 28 30 5...

output:

6369827

result:

ok 1 number(s): "6369827"

Test #24:

score: 0
Accepted
time: 23ms
memory: 3836kb

input:

5000
13 17 5 34 26 6 37 3 48 39 25 8 28 24
31 30 11 6 3 46 20 38 12 4 15 45 40 24 5 17 9 29 47 32 28 21 26 8 19 42 2 27 14 49 44 33
32 27 43 44 32 26 41 16 33 19 22 8 3 11 39 49 29 20 42 34 24 14 38 35 12 18 4 10 30 9 28 6 25
19 6 4 28 24 21 26 36 35 48 13 46 32 19 5 47 25 49 8 29
13 6 29 40 31 48 1...

output:

6358323

result:

ok 1 number(s): "6358323"

Test #25:

score: 0
Accepted
time: 26ms
memory: 3824kb

input:

5000
44 36 14 35 9 47 20 42 16 34 41 24 13 12 6 46 23 15 22 48 25 43 29 21 39 26 3 2 44 33 38 10 50 4 8 7 27 28 49 37 1 19 45 32 40
19 36 30 43 20 13 42 46 31 1 32 17 9 24 22 44 6 5 35 25
29 44 33 20 37 35 10 13 27 45 18 22 11 34 50 16 2 21 4 48 19 1 40 9 23 43 49 42 39 15
50 2 27 34 14 24 18 8 29 1...

output:

6405879

result:

ok 1 number(s): "6405879"

Test #26:

score: 0
Accepted
time: 23ms
memory: 4124kb

input:

5000
6 13 15 29 42 23 30
32 1 20 24 21 15 35 43 32 12 33 47 3 6 40 22 28 26 42 49 8 13 14 48 10 7 16 4 41 25 31 37 27
12 32 25 34 19 42 41 16 26 4 35 6 14
13 45 39 10 13 3 19 20 30 5 46 47 1 17
33 36 15 34 22 9 49 16 19 47 4 14 35 3 42 45 10 40 18 28 33 27 26 8 5 23 46 38 12 29 50 30 44 7
12 34 27 5...

output:

6401832

result:

ok 1 number(s): "6401832"

Test #27:

score: 0
Accepted
time: 25ms
memory: 3824kb

input:

5000
41 10 5 8 46 14 30 4 39 16 12 29 26 38 47 35 22 31 49 24 33 13 11 42 20 18 37 17 28 15 32 3 45 9 43 34 41 40 2 6 25 36
17 7 13 15 39 28 26 1 23 27 9 38 29 48 36 30 11 43
23 18 31 5 30 27 24 28 26 23 25 3 19 20 21 1 36 41 7 16 35 12 4 43
4 32 19 36 16
41 6 29 5 8 24 3 34 43 18 47 11 42 4 22 36 4...

output:

6375277

result:

ok 1 number(s): "6375277"

Test #28:

score: 0
Accepted
time: 25ms
memory: 3836kb

input:

5000
11 21 27 3 19 41 26 9 17 30 33 37
43 16 32 6 18 35 47 39 29 5 10 28 1 38 4 15 45 31 14 11 23 44 40 30 49 24 8 25 41 13 27 9 22 12 43 19 46 34 48 33 26 36 50 37
7 50 11 42 30 25 19 48
12 47 19 21 3 37 41 24 32 44 40 29 39
50 36 12 22 3 17 41 11 37 2 16 15 7 29 14 34 19 43 4 46 49 32 50 24 21 6 3...

output:

6331860

result:

ok 1 number(s): "6331860"

Test #29:

score: 0
Accepted
time: 25ms
memory: 3840kb

input:

5000
43 5 13 31 12 41 21 28 19 4 35 2 29 6 25 27 33 37 18 20 39 43 10 22 23 42 44 15 3 8 48 14 32 49 34 7 38 11 36 17 46 16 45 50
30 24 26 2 35 29 8 43 15 45 4 16 11 38 46 41 36 10 40 5 3 28 18 14 22 13 19 42 6 23 33
31 28 20 10 43 50 48 37 21 18 30 35 38 7 47 5 25 12 11 16 32 29 49 34 23 39 2 41 13...

output:

6339756

result:

ok 1 number(s): "6339756"

Test #30:

score: 0
Accepted
time: 25ms
memory: 4088kb

input:

5000
31 2 49 19 23 28 39 9 32 40 36 18 22 33 21 50 3 6 45 44 26 30 41 31 42 5 48 7 16 27 46 1
45 11 47 34 39 8 18 42 24 46 36 35 49 44 33 22 40 14 1 4 25 20 12 16 37 17 38 29 6 13 9 10 28 3 5 31 43 26 2 19 32 15 50 27 21 23
50 47 50 12 10 20 25 24 15 8 35 37 2 34 13 28 32 7 40 27 44 48 31 29 16 38 3...

output:

6394429

result:

ok 1 number(s): "6394429"

Test #31:

score: 0
Accepted
time: 26ms
memory: 3804kb

input:

5000
35 21 20 18 22 37 44 47 32 17 8 6 30 15 2 24 33 48 5 26 50 11 39 34 23 40 42 38 29 10 45 25 41 14 35 19
45 24 41 47 39 5 32 18 12 33 19 4 36 14 1 46 40 9 48 17 6 43 15 10 38 27 45 26 8 21 34 35 2 16 28 50 20 42 22 23 31 25 49 3 37 11
27 10 28 44 43 23 7 47 46 34 16 40 18 3 6 42 38 9 22 11 48 1 ...

output:

6434432

result:

ok 1 number(s): "6434432"

Test #32:

score: 0
Accepted
time: 25ms
memory: 3832kb

input:

5000
11 5 35 46 23 50 42 21 14 2 22 20
2 41 35
38 5 3 42 31 35 37 30 4 39 49 9 24 46 13 32 29 40 12 25 34 1 6 23 47 10 21 14 33 27 17 20 48 44 18 36 22 50 28
7 1 38 22 35 23 6 25
22 27 31 48 43 41 32 14 16 22 11 34 36 5 8 40 2 6 15 20 9 28 33
4 40 26 3 30
8 16 15 49 45 17 46 19 29
11 5 33 7 20 36 40...

output:

6452445

result:

ok 1 number(s): "6452445"

Test #33:

score: 0
Accepted
time: 25ms
memory: 4120kb

input:

5000
37 27 8 34 36 12 26 7 31 23 16 10 5 4 43 44 1 41 42 22 3 37 6 2 19 24 50 35 29 46 11 28 39 13 21 15 45 47
14 49 48 9 31 50 38 20 32 19 8 44 33 7 28
9 32 6 50 22 34 26 13 27 46
35 49 4 36 21 3 26 32 45 47 37 38 20 19 12 18 9 41 33 39 27 6 48 31 1 11 40 10 7 30 14 17 22 50 42 29
41 44 18 49 1 33 ...

output:

6352997

result:

ok 1 number(s): "6352997"

Test #34:

score: 0
Accepted
time: 25ms
memory: 3828kb

input:

5000
10 22 15 30 13 6 18 21 1 8 12
23 36 4 29 44 20 7 42 49 24 21 2 8 41 1 17 40 16 45 19 35 28 10 12
30 39 44 3 27 33 29 22 8 12 48 45 34 18 1 11 19 9 13 38 32 37 14 2 4 10 50 15 36 21 7
49 41 22 11 8 21 15 33 35 48 12 23 16 38 26 2 27 24 32 18 34 19 43 28 44 3 47 7 29 37 4 36 30 49 13 31 46 9 39 1...

output:

6368672

result:

ok 1 number(s): "6368672"

Test #35:

score: 0
Accepted
time: 25ms
memory: 3828kb

input:

5000
2 29 37
40 1 22 23 18 7 14 15 3 20 26 41 21 46 37 32 8 11 42 24 9 13 2 50 43 12 28 6 27 25 34 49 45 48 19 38 10 31 4 36 47
5 33 17 13 48 28
40 36 9 47 46 22 25 30 6 31 27 12 48 50 37 7 5 45 34 43 16 49 8 44 13 18 33 38 17 15 41 35 40 23 19 4 42 2 32 10 26
16 42 32 19 39 29 1 38 11 25 35 34 37 1...

output:

6334147

result:

ok 1 number(s): "6334147"

Test #36:

score: 0
Accepted
time: 25ms
memory: 4116kb

input:

5000
28 50 1 25 19 9 41 26 39 37 44 6 30 46 10 42 16 31 40 43 4 28 38 35 11 47 32 29 23
30 45 37 46 35 16 48 7 21 2 30 40 49 50 3 27 4 15 10 42 26 41 31 29 47 11 19 39 18 14 8
19 3 2 29 50 12 36 39 19 14 20 23 44 1 11 43 7 25 31 21
28 14 44 12 19 7 48 10 37 25 31 27 49 30 24 32 22 36 40 50 35 13 26 ...

output:

6437648

result:

ok 1 number(s): "6437648"

Test #37:

score: 0
Accepted
time: 26ms
memory: 3864kb

input:

5000
20 5 7 17 15 26 40 24 42 32 2 23 14 12 4 19 50 25 13 33 9
22 17 39 14 23 41 38 47 21 50 35 13 43 22 10 45 9 24 18 33 4 46 26
9 45 17 1 30 49 12 13 9 38
9 30 42 3 38 47 21 1 6 39
33 39 21 40 1 3 30 31 19 47 5 8 26 35 11 49 13 6 23 24 36 42 10 41 20 45 38 9 27 2 28 12 25 16
8 50 22 9 23 49 5 48 2...

output:

6358889

result:

ok 1 number(s): "6358889"

Test #38:

score: 0
Accepted
time: 22ms
memory: 3840kb

input:

5000
2 14 32
27 5 4 23 3 49 48 30 11 34 16 36 42 31 29 26 19 14 17 44 7 25 37 39 32 47 21 8
26 38 21 48 7 11 32 39 3 1 37 49 18 42 22 14 26 46 19 50 29 40 44 6 25 33 30
49 18 11 7 49 27 47 31 33 8 46 20 1 6 10 45 42 35 2 24 43 37 41 16 39 32 17 19 36 40 4 15 48 13 34 25 3 38 26 30 28 29 12 21 9 50 2...

output:

6379184

result:

ok 1 number(s): "6379184"

Test #39:

score: 0
Accepted
time: 25ms
memory: 3912kb

input:

5000
38 11 34 37 2 1 13 12 39 36 18 47 8 48 32 23 6 17 43 7 21 19 33 20 5 9 28 38 49 27 31 15 50 40 14 26 24 42 45
1 24
36 50 18 17 29 35 7 42 36 47 14 25 41 4 8 19 46 44 9 34 23 31 28 39 1 13 45 15 26 37 21 49 40 12 10 6 24
36 4 10 28 5 14 46 9 24 34 11 31 35 25 29 26 3 12 45 18 17 49 23 40 37 22 4...

output:

6447730

result:

ok 1 number(s): "6447730"

Test #40:

score: 0
Accepted
time: 22ms
memory: 4128kb

input:

5000
38 6 47 17 25 24 15 23 10 3 14 16 48 2 40 31 12 13 41 27 7 28 19 37 44 8 21 49 36 26 34 30 4 38 42 45 33 20 1
32 29 36 24 6 18 42 28 23 32 39 2 41 9 50 7 19 37 10 27 31 26 15 5 44 30 46 43 45 49 16 40 48
23 1 7 36 2 48 6 47 43 45 30 8 17 27 33 15 37 4 18 50 34 49 10 16
9 9 22 18 12 24 34 16 21 ...

output:

6396988

result:

ok 1 number(s): "6396988"

Test #41:

score: 0
Accepted
time: 25ms
memory: 4124kb

input:

5000
19 28 2 37 23 18 39 30 38 16 40 33 31 12 8 21 43 48 41 42
33 35 45 16 5 14 44 9 36 28 17 32 22 48 49 1 30 20 26 19 27 3 2 15 47 18 37 43 8 34 12 7 21 6
12 45 11 34 8 6 39 27 49 24 29 42 33
40 24 39 7 50 21 26 28 6 49 12 42 37 15 19 32 33 23 11 20 45 47 31 13 38 40 22 29 30 4 9 41 46 17 10 8 18 ...

output:

6365283

result:

ok 1 number(s): "6365283"

Test #42:

score: 0
Accepted
time: 25ms
memory: 4116kb

input:

5000
28 3 42 49 19 32 44 46 29 23 15 24 18 41 13 27 5 33 39 31 7 10 28 45 36 12 9 37 14
17 7 46 24 35 15 38 20 22 30 18 14 39 16 8 28 36 2
20 8 49 36 1 40 23 32 31 37 41 20 39 45 12 9 11 10 3 27 13
33 23 41 19 28 14 25 47 34 42 4 44 1 38 27 35 48 30 6 17 18 33 49 22 20 15 50 12 45 21 37 26 5 46
39 5...

output:

6369107

result:

ok 1 number(s): "6369107"

Test #43:

score: 0
Accepted
time: 25ms
memory: 3768kb

input:

5000
34 20 11 31 40 36 37 9 30 34 15 8 44 28 24 2 49 45 46 38 21 42 39 4 16 50 35 1 26 22 23 33 43 6 12
39 22 50 35 33 31 36 16 42 39 3 28 44 30 4 26 10 5 12 24 47 7 11 19 8 1 29 46 18 34 27 25 20 41 37 48 9 21 49 15
29 27 49 15 12 22 39 20 29 4 16 35 45 25 8 34 37 3 19 33 30 32 48 14 41 42 2 38 5 6...

output:

6361262

result:

ok 1 number(s): "6361262"

Test #44:

score: 0
Accepted
time: 26ms
memory: 3796kb

input:

5000
11 3 22 23 46 19 43 41 26 11 1 18
28 16 45 48 34 26 28 14 38 20 27 29 13 7 37 18 23 50 2 9 42 35 49 39 40 1 8 24 47
12 13 14 24 12 16 38 35 10 47 23 27 9
47 45 15 36 18 9 43 6 37 42 33 20 31 21 1 10 12 8 16 4 32 2 14 47 11 3 17 24 30 49 38 40 23 46 13 19 25 50 48 35 28 27 7 34 41 26 39 5
8 34 2...

output:

6368932

result:

ok 1 number(s): "6368932"

Test #45:

score: 0
Accepted
time: 25ms
memory: 3828kb

input:

5000
39 23 14 3 27 47 35 28 6 18 10 48 46 13 39 21 40 11 19 29 17 42 5 2 38 33 45 34 32 41 49 31 43 20 25 8 50 26 16 36
12 3 43 21 5 18 2 4 11 17 31 25 12
27 6 5 49 48 8 44 7 28 35 41 43 46 18 32 3 16 20 19 27 13 14 40 37 34 26 42 29
25 49 9 34 3 18 46 21 13 40 39 10 50 23 41 42 22 2 25 14 6 43 5 38...

output:

6337628

result:

ok 1 number(s): "6337628"

Test #46:

score: 0
Accepted
time: 26ms
memory: 3824kb

input:

5000
28 20 1 21 49 15 41 26 7 11 19 36 5 6 28 39 48 18 31 46 10 2 38 40 17 42 9 32 37
5 10 40 29 2 30
35 49 2 34 6 47 50 25 20 1 38 44 21 30 19 35 9 14 27 12 48 13 23 39 7 18 5 28 3 43 24 40 22 42 32 46
25 5 28 40 48 47 9 30 12 2 49 17 8 46 20 3 34 6 4 10 7 19 22 39 16 31
42 16 14 47 32 11 49 8 36 4...

output:

6382248

result:

ok 1 number(s): "6382248"

Test #47:

score: 0
Accepted
time: 25ms
memory: 3836kb

input:

5000
34 39 24 29 45 33 34 18 48 40 42 3 35 46 2 26 31 1 37 38 32 6 8 47 9 50 30 12 22 25 20 43 44 4 41
3 31 47 36
33 27 30 29 19 18 47 8 9 12 43 44 14 16 35 20 17 38 10 34 39 21 48 4 5 31 45 33 42 22 3 25 11 24
12 33 9 27 32 25 15 38 6 46 36 26 50
5 10 48 37 5 42
6 14 5 30 32 11 13
50 43 1 18 32 8 4...

output:

6395773

result:

ok 1 number(s): "6395773"

Test #48:

score: 0
Accepted
time: 22ms
memory: 3892kb

input:

5000
6 48 27 19 45 11 43
1 39
42 38 30 33 32 50 31 48 8 3 17 18 29 27 4 39 1 11 22 34 49 41 46 23 13 35 15 42 5 7 47 20 2 14 21 36 37 6 28 16 25 24 43
48 45 16 24 35 44 6 36 31 33 11 47 3 18 32 5 48 14 27 1 42 49 50 8 26 22 12 9 15 21 46 23 38 30 29 40 20 34 39 41 25 43 28 17 10 13 4 2 19
18 8 43 42...

output:

6380527

result:

ok 1 number(s): "6380527"

Test #49:

score: 0
Accepted
time: 25ms
memory: 3844kb

input:

5000
17 9 28 18 44 45 39 20 12 33 43 22 31 38 36 2 23 48
10 2 19 34 1 33 12 8 36 47 39
31 50 33 24 40 2 44 29 6 27 21 16 9 10 11 41 31 12 37 14 38 23 3 45 35 7 22 46 1 13 43 39
22 42 34 16 43 37 22 13 15 27 1 33 5 48 30 17 36 50 14 49 3 20 19
5 28 23 41 2 46
24 9 3 34 10 29 17 28 42 7 6 33 16 18 5 2...

output:

6370895

result:

ok 1 number(s): "6370895"

Test #50:

score: 0
Accepted
time: 26ms
memory: 4096kb

input:

5000
19 24 18 5 11 16 36 46 20 27 25 34 10 41 39 1 32 35 6 42
33 31 34 6 44 35 49 17 42 28 38 25 30 16 5 29 39 18 7 2 43 12 37 33 47 15 32 50 24 19 10 8 46 11
31 18 25 29 49 21 1 5 10 33 36 45 3 46 50 2 9 47 40 43 42 34 31 32 15 8 39 28 6 14 27 12
15 21 8 9 1 28 43 10 13 44 27 39 30 24 36 25
38 20 3...

output:

6405029

result:

ok 1 number(s): "6405029"

Test #51:

score: 0
Accepted
time: 25ms
memory: 4088kb

input:

5000
8 39 25 47 33 41 15 29 50
43 19 7 21 16 38 3 50 8 33 13 27 5 49 47 9 29 17 14 41 48 45 37 44 4 36 35 22 39 12 28 23 42 6 2 15 20 26 46 31 34 30 24 40
28 15 39 6 31 32 24 37 42 4 28 18 38 45 17 33 29 12 3 21 35 9 20 46 14 11 34 5 49
45 4 38 22 13 36 41 27 40 39 24 16 34 15 10 5 37 14 26 17 43 1 ...

output:

6354985

result:

ok 1 number(s): "6354985"

Test #52:

score: 0
Accepted
time: 25ms
memory: 3832kb

input:

5000
5 34 18 22 8 17
17 46 12 37 45 38 2 9 29 42 13 20 26 48 30 14 27 8
15 16 35 45 7 27 1 33 23 5 32 9 21 19 47 36
4 50 26 8 32
23 25 34 33 7 48 49 37 31 6 28 43 9 17 24 47 46 38 26 44 21 16 35 27
23 35 24 28 49 10 8 21 18 19 12 16 44 13 34 23 39 31 37 32 25 22 40 17
44 20 14 34 1 9 46 18 19 32 17 ...

output:

6341842

result:

ok 1 number(s): "6341842"

Test #53:

score: 0
Accepted
time: 26ms
memory: 3832kb

input:

5000
19 19 31 2 5 26 9 14 24 37 22 38 41 20 17 23 34 11 40 6
23 43 4 15 48 47 17 20 30 6 38 36 31 23 34 10 29 37 32 8 26 44 22 41
40 45 43 2 28 35 41 7 18 10 31 20 49 5 40 50 15 22 26 33 16 34 30 42 48 8 32 36 3 19 6 17 29 23 12 39 21 47 4 1 9
8 23 19 40 2 37 13 36 41
7 23 47 21 14 13 25 2
11 37 50 ...

output:

6298180

result:

ok 1 number(s): "6298180"

Test #54:

score: 0
Accepted
time: 25ms
memory: 3896kb

input:

5000
45 44 9 20 46 22 7 6 3 30 27 32 31 49 36 8 43 33 47 13 17 19 50 14 41 35 25 39 12 42 48 10 11 5 15 18 38 23 34 28 45 16 29 26 2 21
49 9 38 13 49 36 42 14 35 7 39 50 48 21 46 47 15 34 2 27 22 41 3 43 1 11 28 30 16 25 18 10 40 5 26 44 24 33 20 19 31 8 4 6 12 17 23 32 45 37
6 34 1 32 14 36 22
3 23...

output:

6377186

result:

ok 1 number(s): "6377186"

Test #55:

score: 0
Accepted
time: 25ms
memory: 3804kb

input:

5000
28 10 15 24 13 43 8 28 42 44 11 34 9 25 48 36 1 38 41 33 40 17 49 45 46 5 21 29 6
15 14 28 2 37 23 43 9 32 35 21 29 18 3 36 44
38 19 5 25 39 33 48 43 32 35 21 46 3 10 27 17 4 28 40 50 34 31 18 30 13 15 36 8 23 20 14 29 24 1 41 12 11 38 49
27 39 3 18 34 37 40 23 21 6 9 8 36 14 20 4 10 32 25 15 2...

output:

6383844

result:

ok 1 number(s): "6383844"

Test #56:

score: 0
Accepted
time: 27ms
memory: 3828kb

input:

5000
49 3 39 41 28 38 22 30 21 10 31 40 25 49 27 16 7 20 1 13 14 36 8 23 4 17 5 32 50 9 29 35 34 47 46 12 43 37 48 26 15 19 44 33 2 18 11 45 24 6
41 17 4 33 19 24 15 40 2 45 27 14 31 46 39 16 9 3 41 26 11 42 8 18 5 22 36 49 25 35 47 23 48 13 7 38 28 43 10 30 29 44
40 36 31 5 15 26 14 50 32 34 48 18 ...

output:

6377722

result:

ok 1 number(s): "6377722"

Test #57:

score: 0
Accepted
time: 26ms
memory: 3836kb

input:

5000
15 11 39 37 44 5 18 23 34 33 3 12 38 47 24 29
5 18 43 31 32 8
15 23 42 20 14 38 8 19 36 15 50 10 3 47 40 5
19 47 28 21 38 13 42 12 11 32 44 3 27 5 14 26 20 7 34 39
15 19 10 2 23 15 42 38 43 18 34 16 24 28 49 44
32 20 37 36 25 35 9 13 39 50 31 18 16 4 28 30 15 38 19 1 46 47 34 33 26 48 42 5 44 2...

output:

6356478

result:

ok 1 number(s): "6356478"

Test #58:

score: 0
Accepted
time: 25ms
memory: 3832kb

input:

5000
25 37 12 50 11 42 10 2 48 29 25 7 15 20 34 33 39 16 1 13 36 4 40 43 14 3
14 31 44 46 11 8 43 2 10 18 34 50 14 24 22
1 33
10 26 7 40 41 32 36 23 27 45 1
3 25 7 8
13 19 21 10 42 50 3 27 9 30 25 37 28 35
27 17 50 15 14 47 38 24 31 23 45 9 37 49 22 7 12 36 13 11 35 8 20 19 48 33 29 27
43 47 50 19 2...

output:

6355823

result:

ok 1 number(s): "6355823"

Test #59:

score: 0
Accepted
time: 25ms
memory: 3868kb

input:

5000
34 15 20 44 24 38 34 12 14 49 32 8 37 3 36 40 22 5 4 29 41 9 28 27 48 1 18 45 30 43 11 21 16 6 46
8 49 13 42 19 26 8 14 7
41 33 18 7 25 36 29 32 9 1 6 17 48 24 35 50 31 14 2 42 43 23 11 28 44 20 37 46 39 21 15 40 26 47 4 19 38 30 12 45 8 49
8 40 16 44 32 9 39 7 19
41 19 46 4 21 43 20 9 42 12 38...

output:

6371501

result:

ok 1 number(s): "6371501"

Test #60:

score: 0
Accepted
time: 25ms
memory: 3828kb

input:

5000
13 34 31 48 47 5 33 20 12 17 38 21 8 45
29 11 2 40 29 30 34 32 46 45 20 43 15 23 28 37 35 26 7 50 6 41 36 21 9 5 17 38 42 25
34 21 17 16 47 23 5 31 2 32 10 39 4 28 44 9 11 6 33 49 35 34 46 45 8 20 18 38 37 1 30 13 22 43 3
40 32 9 13 18 24 11 46 25 8 39 49 31 28 20 29 23 14 12 35 42 5 15 27 34 6...

output:

6363314

result:

ok 1 number(s): "6363314"

Test #61:

score: 0
Accepted
time: 22ms
memory: 3836kb

input:

5000
30 5 34 12 3 43 44 15 32 2 38 46 50 41 30 37 23 42 16 26 19 28 47 8 48 1 11 14 25 22 49
29 26 22 45 40 4 18 43 19 27 15 21 13 39 6 47 32 41 12 33 24 3 8 7 49 16 35 5 1 29
46 18 21 10 27 25 32 35 30 31 23 13 19 28 40 41 22 4 7 47 37 33 49 43 39 9 45 6 5 8 29 14 12 2 24 50 20 1 38 48 36 34 15 11 ...

output:

6456565

result:

ok 1 number(s): "6456565"

Test #62:

score: 0
Accepted
time: 22ms
memory: 3840kb

input:

5000
36 47 31 20 50 12 43 44 8 45 39 9 23 22 15 34 5 19 25 41 48 27 11 49 14 46 10 35 38 21 17 42 13 2 26 18 36
40 21 26 41 40 42 37 30 36 5 29 47 6 49 25 35 27 39 13 34 4 45 19 10 17 11 15 3 20 16 24 22 2 18 46 12 32 48 43 28 23
46 16 3 42 50 38 7 20 46 34 15 18 28 11 24 47 45 9 32 21 35 26 39 27 3...

output:

6374048

result:

ok 1 number(s): "6374048"

Test #63:

score: 0
Accepted
time: 26ms
memory: 3840kb

input:

5000
21 39 24 22 48 30 49 2 37 1 26 38 46 14 29 7 11 43 28 34 40 44
1 27
13 29 5 27 37 50 21 36 47 1 9 34 30 17
49 42 25 20 35 10 24 16 22 49 26 40 18 46 6 23 30 7 41 27 4 21 2 33 36 37 17 48 8 34 45 15 31 1 19 44 13 9 43 11 47 29 3 5 39 28 32 14 50 38
50 30 31 19 21 43 26 5 3 41 8 13 46 29 24 48 7 ...

output:

6403716

result:

ok 1 number(s): "6403716"

Test #64:

score: 0
Accepted
time: 21ms
memory: 3908kb

input:

5000
40 8 40 30 1 33 37 19 15 4 45 26 44 28 21 23 12 31 16 13 49 48 47 24 43 32 7 50 20 25 17 18 10 6 22 39 11 2 9 27 3
48 11 4 27 14 41 34 21 8 18 29 13 1 24 40 15 3 12 20 25 45 42 7 49 30 16 39 32 23 36 50 22 38 35 2 37 33 44 48 47 10 26 5 31 28 46 19 17 9
5 40 44 46 14 13
41 9 22 42 46 28 13 44 1...

output:

6321495

result:

ok 1 number(s): "6321495"