QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#403228#6414. Classical Maximization ProblemdXqwqAC ✓181ms50612kbC++233.1kb2024-05-01 22:25:552024-05-01 22:25:55

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 11744kb

input:

3
2
0 0
0 1
1 0
1 1
2
0 0
0 1
0 2
0 3
2
0 0
1 1
2 2
3 3

output:

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

result:

ok ok (3 test cases)

Test #2:

score: 0
Accepted
time: 51ms
memory: 9700kb

input:

10000
2
-107276936 -310501829
419434212 585811870
-65754386 -491212232
381152038 897148193
3
-474045168 493506332
299114415 540203303
165808153 983551
-506936261 -694189769
766718170 -725540031
975267148 -593051087
1
-818952276 -762387923
584023914 -612401389
6
-77701228 -266484128
659434465 6322062...

output:

0
1 2
3 4
0
1 2
3 4
5 6
0
1 2
0
1 2
3 4
5 6
7 8
9 10
11 12
0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
0
1 2
0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
0
1 2
3 4...

result:

ok ok (10000 test cases)

Test #3:

score: 0
Accepted
time: 48ms
memory: 5624kb

input:

10000
1
999855386 999580905
999342928 999615227
21
999601032 999015398
999155628 999176944
999309856 999524434
999121011 999509537
999323572 999685730
999272272 999769606
999450559 999390758
999632027 999178534
999024993 999463838
999784856 999374197
999980525 999366771
999241260 999516879
999599548...

output:

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

result:

ok ok (10000 test cases)

Test #4:

score: 0
Accepted
time: 52ms
memory: 5516kb

input:

10000
5
999984799 999981445
999958394 999984217
999994978 999981258
999955539 999938710
999936554 999963561
999907222 999907508
999938166 999941959
999910567 999986887
999901446 999961092
999994730 999963038
5
999916115 999962400
999948250 999940355
999954204 999920844
999928148 999990369
999978118 ...

output:

0
1 2
3 4
5 6
7 8
9 10
0
1 2
3 4
5 6
7 8
9 10
0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
0
1 2
3 4
5 6
7 8
0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
0
1 2
3 4
5 6
7 8
9 10
0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
0
1 2
3 4
5 6
7 8
9 10
1...

result:

ok ok (10000 test cases)

Test #5:

score: 0
Accepted
time: 48ms
memory: 3780kb

input:

10000
1
999990146 999993828
999995909 999996353
56
999999851 999991179
999997250 999997987
999990590 999997316
999997350 999996856
999997034 999996236
999999396 999996897
999991180 999993309
999991265 999995185
999993952 999994054
999990210 999994471
999993201 999995893
999997170 999998971
999998201...

output:

0
1 2
1
76 111
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 77
78 79
80 81
82 83
84 85
86 87
88 89
90 91
92 93
94 95
96 97
98 99
...

result:

ok ok (10000 test cases)

Test #6:

score: 0
Accepted
time: 49ms
memory: 3612kb

input:

10000
5
999999432 999999813
999999271 999999233
999999043 999999606
999999523 999999406
999999564 999999274
999999641 999999102
999999903 999999858
999999058 999999098
999999974 999999119
999999643 999999620
5
999999370 999999738
999999181 999999907
999999163 999999783
999999393 999999086
999999661 ...

output:

0
1 2
3 4
5 6
7 8
9 10
0
1 2
3 4
5 6
7 8
9 10
0
1 2
3 4
5 6
0
1 2
3 4
5 6
7 8
9 10
1
9 10
1 2
3 4
5 6
7 8
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
1
12 13
1 2
3 4
5 6
7 8
9 10
11 14
15 16
0
1 2
3 4
0
1 2
3 4
1
44 10
1 2
3 4
5 6
7 8
9 11
12 13
14 15
16 17
18 19
20 21
22...

result:

ok ok (10000 test cases)

Test #7:

score: 0
Accepted
time: 55ms
memory: 3600kb

input:

10000
14
-369804569 -904204119
526374829 -824374353
-127549933 -904204119
-68608787 929413707
-68608787 -363454459
526374829 929413707
693313139 -824374353
-127549933 -726843762
526374829 -904204119
526374829 -363454459
526374829 -409731440
693313139 -726843762
693313139 929413707
-68608787 -8243743...

output:

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

result:

ok ok (10000 test cases)

Test #8:

score: 0
Accepted
time: 60ms
memory: 3612kb

input:

10000
5
-536123007 813600068
870612905 -192916365
-891077277 -192916365
-169354047 -86845158
-204880568 -86845158
-909192812 -613162163
-536123007 -613162163
602684169 -613162163
-909192812 813600068
602684169 -86845158
3
-296375355 579758813
-296375355 253508589
-296375355 -927878827
267975935 -927...

output:

5
2 3
4 5
6 9
7 1
8 10
3
3 6
2 1
4 5
5
1 6
4 2
9 3
5 8
10 7
5
2 8
4 5
9 10
7 1
3 6
5
4 1
3 7
5 8
2 6
9 10
2
3 5
6 4
1 2
1
2 1
13
2 7
3 21
6 16
8 25
11 17
13 26
14 15
22 23
10 12
20 24
5 4
9 1
19 18
4
2 3
7 8
9 1
4 10
5 6
3
2 3
6 4
5 1
2
1 4
2 3
5
3 4
2 6
1 5
7 10
9 8
7
1 15
3 16
8 10
5 11
7 13
9 6
4...

result:

ok ok (10000 test cases)

Test #9:

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

input:

10000
13
38708650 -400244265
805800882 -207412170
-922757982 569623504
330308285 -400244265
-922757982 193222226
330308285 -701148819
-28889088 854967427
284328781 704931219
-397379302 854967427
284328781 252366771
-699696493 -701148819
953729077 -601089169
-858131099 -701148819
-397379302 193222226...

output:

12
1 4
2 21
11 20
5 3
13 15
17 18
14 9
16 7
22 26
10 8
6 24
12 25
19 23
18
1 18
2 10
3 21
5 24
6 32
13 27
15 28
16 19
20 33
22 34
25 26
14 9
30 7
11 12
36 35
17 8
23 29
31 4
7
3 6
10 16
13 14
2 1
4 9
8 11
5 7
12 15
3
1 2
3 4
5 6
1
1 4
2 3
2
1 4
2 3
8
1 12
3 10
7 6
15 9
8 5
11 16
14 4
2 13
3
6 7
8 4
...

result:

ok ok (10000 test cases)

Test #10:

score: 0
Accepted
time: 43ms
memory: 3604kb

input:

10000
2
-254673318 743896676
326182652 743896676
115024593 743896676
989112001 743896676
1
453875458 284043499
869627863 284043499
8
-68955663 625858753
-621253434 625858753
-315653340 625858753
-85160525 625858753
-592616333 625858753
114285020 625858753
618762545 625858753
524402507 625858753
1512...

output:

2
1 3
2 4
1
1 2
8
1 6
2 16
3 13
4 14
5 10
7 15
8 11
9 12
12
1 20
2 21
3 9
4 5
6 22
7 13
8 12
10 11
14 16
15 18
17 23
19 24
8
1 15
2 12
3 10
4 9
5 6
7 11
8 14
13 16
6
1 3
2 11
4 9
5 12
6 10
7 8
13
1 16
2 17
3 22
4 25
5 12
6 9
7 14
8 15
10 23
11 19
13 24
18 20
21 26
6
1 10
2 7
3 6
4 9
5 11
8 12
1
1 2
...

result:

ok ok (10000 test cases)

Test #11:

score: 0
Accepted
time: 51ms
memory: 3492kb

input:

10000
10
-302093372 -991014187
542702243 714369751
-370626462 -991014187
-700169063 714369751
-982732066 -991014187
-763837020 -991014187
320477527 -991014187
290144737 -991014187
18975042 -991014187
-339021181 -991014187
-525462052 -991014187
290144737 714369751
-538375359 714369751
15943074 -99101...

output:

10
1 18
2 19
3 10
4 13
5 11
7 17
9 14
15 20
6 16
8 12
10
7 8
18 2
3 11
1 14
19 16
6 5
15 12
17 13
9 4
20 10
18
2 30
3 35
8 19
11 36
13 17
16 23
21 31
25 34
26 9
7 20
33 4
22 27
28 5
32 29
6 18
15 24
10 12
14 1
35
2 68
3 15
6 61
8 55
9 37
10 21
11 60
13 30
14 57
18 66
20 63
22 50
25 43
26 70
27 41
32...

result:

ok ok (10000 test cases)

Test #12:

score: 0
Accepted
time: 53ms
memory: 12004kb

input:

10000
5
192354975 -209258445
955055576 -209258445
286707627 -209258445
-574795734 -209258445
-305243931 -209258445
-629755833 -209258445
-337515030 -209258445
980285884 -209258445
501317910 -209258445
312382135 -209258445
24
272466007 467288536
-963587196 -778274012
240097765 -778274012
-926564605 4...

output:

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

result:

ok ok (10000 test cases)

Test #13:

score: 0
Accepted
time: 43ms
memory: 16036kb

input:

10000
11
135813326 608040171
135813326 -96255413
135813326 -31734533
135813326 -423296887
135813326 999444876
135813326 946760362
135813326 -599331154
135813326 -441599790
135813326 233339336
135813326 -759375115
135813326 163868817
135813326 321091518
135813326 -402236877
135813326 625124369
135813...

output:

11
18 10
19 7
8 4
13 17
15 2
3 11
9 22
12 21
20 16
1 14
6 5
1
2 1
16
1 18
16 3
17 4
29 15
8 14
25 32
21 6
12 5
13 27
10 20
22 31
9 2
11 26
7 19
30 28
24 23
11
19 6
7 17
18 16
15 21
12 22
13 1
14 2
3 4
5 11
8 10
9 20
7
11 2
3 10
4 9
8 6
5 12
1 7
13 14
2
2 4
1 3
7
3 9
6 10
11 8
13 4
7 5
14 12
2 1
1
2 ...

result:

ok ok (10000 test cases)

Test #14:

score: 0
Accepted
time: 51ms
memory: 5696kb

input:

10000
19
321791336 -226466052
321791336 138757626
321791336 -613429828
944682716 -446131303
321791336 -927463006
944682716 280242351
944682716 229347131
944682716 155568891
321791336 389911916
944682716 72836839
944682716 -613429828
321791336 229347131
944682716 -927463006
944682716 138757626
321791...

output:

19
19 34
5 30
3 22
21 15
1 17
35 2
28 12
25 24
9 38
13 11
33 4
27 16
23 18
32 10
14 8
7 6
36 20
26 29
31 37
19
23 27
16 8
17 5
6 33
31 3
34 18
29 37
19 35
7 38
13 26
10 30
36 21
20 15
2 12
25 14
9 32
4 22
28 11
24 1
8
2 16
4 1
9 5
8 3
15 7
6 14
13 10
11 12
4
3 4
5 2
8 1
6 7
6
3 9
11 8
12 1
7 2
4 10
...

result:

ok ok (10000 test cases)

Test #15:

score: 0
Accepted
time: 48ms
memory: 3516kb

input:

10000
2
414226098 -53411011
414226098 -515361565
-572270323 -515361565
-572270323 -53411011
36
660074753 623771687
-917096747 533975361
660074753 337851674
-917096747 -902052044
-917096747 846238046
660074753 197157825
660074753 533975361
660074753 626049519
-917096747 -108293477
-917096747 64055247...

output:

2
3 4
2 1
36
4 68
69 25
35 19
14 62
33 38
23 48
58 16
71 9
13 22
31 32
46 43
20 42
36 40
2 51
52 10
63 18
5 30
28 50
70 21
27 53
45 44
54 29
66 34
49 56
61 65
60 57
55 64
6 11
24 37
41 47
59 3
15 12
7 17
1 8
26 72
67 39
1
2 1
27
45 7
28 37
48 13
41 43
34 3
30 53
5 54
27 9
24 1
21 26
29 50
4 36
44 52...

result:

ok ok (10000 test cases)

Test #16:

score: 0
Accepted
time: 57ms
memory: 3788kb

input:

10000
6
475408912 -758469962
-99052258 -758469962
-716758863 872897211
-66386054 -170278720
388817201 174925294
-776227900 -285032873
475408912 872897211
-997698204 -236300379
-716758863 -85108619
-776227900 -85108619
-716758863 -236300379
-66386054 -85108619
26
879874105 877328664
-286895493 621573...

output:

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

result:

ok ok (10000 test cases)

Test #17:

score: 0
Accepted
time: 59ms
memory: 3620kb

input:

10000
9
-980409638 -116749812
830791554 -690170434
984923479 323045898
984923479 -116749812
-197520273 323045898
-858897130 -43820432
258471629 -979749918
258471629 -690170434
-858897130 323045898
105960247 -690170434
-197520273 -841854666
-234415044 -116749812
105960247 323045898
-358435325 -202957...

output:

8
2 10
3 13
4 12
6 9
15 14
11 5
7 8
18 16
1 17
14
2 28
4 7
6 17
10 13
12 31
15 32
18 22
21 23
26 16
9 24
1 5
27 11
14 8
30 19
3 20
25 29
33 34
11
1 17
3 16
19 20
7 15
6 13
14 18
11 9
22 12
8 2
4 21
5 10
4
3 4
7 6
2 8
1 5
9
1 14
6 22
11 20
12 16
8 13
7 18
4 5
17 3
2 15
9 10
19 21
4
5 3
6 8
7 4
2 1
13...

result:

ok ok (10000 test cases)

Test #18:

score: 0
Accepted
time: 56ms
memory: 3900kb

input:

1000
45
840710004 395646135
-851514725 100215150
-423513540 -649756636
464326407 -482837664
-179781718 755995077
492651722 -268519233
367302062 -111998374
494634876 842096727
973319201 399526783
-703731734 -989899930
758934136 -959677785
-682507454 58961947
394206800 272218663
752299573 489795348
89...

output:

0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85 86
87 88
89 90
0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15...

result:

ok ok (1000 test cases)

Test #19:

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

input:

1000
113
999827252 999728856
999923862 999631025
999319008 999580013
999333375 999174260
999509073 999545469
999194399 999278837
999715162 999728030
999881205 999764413
999917667 999953211
999651496 999869003
999693536 999169883
999545275 999786246
999969774 999735073
999892216 999697498
999954099 9...

output:

0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85 86
87 88
89 90
91 92
93 94
95 96
97 98
99 100
101 10...

result:

ok ok (1000 test cases)

Test #20:

score: 0
Accepted
time: 58ms
memory: 3664kb

input:

1000
16
999918424 999907758
999901558 999910407
999969229 999929343
999986216 999968746
999977167 999921267
999967186 999932634
999999615 999951539
999964903 999931387
999942189 999989158
999990624 999917294
999964661 999935732
999971224 999975496
999972707 999972034
999935060 999934824
999992448 99...

output:

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

result:

ok ok (1000 test cases)

Test #21:

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

input:

1000
227
999994296 999999816
999998835 999994618
999998487 999991646
999995178 999996563
999996865 999996231
999990660 999996917
999995746 999998295
999993178 999995596
999994361 999991179
999990519 999991221
999996210 999992041
999991924 999992546
999991346 999991081
999998929 999995904
999992182 9...

output:

21
9 363
43 351
100 176
109 278
135 145
172 367
235 322
177 148
442 340
10 163
203 180
22 49
436 128
231 112
300 263
368 124
3 253
405 297
142 448
90 247
378 315
1 2
4 5
6 7
8 11
12 13
14 15
16 17
18 19
20 21
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
44 45
46 47
48 50
51 52
53 54
5...

result:

ok ok (1000 test cases)

Test #22:

score: 0
Accepted
time: 71ms
memory: 3788kb

input:

1000
87
999999138 999999640
999999785 999999342
999999914 999999854
999999771 999999416
999999011 999999479
999999217 999999865
999999423 999999937
999999684 999999301
999999323 999999399
999999071 999999949
999999226 999999154
999999770 999999090
999999778 999999735
999999034 999999517
999999803 99...

output:

23
6 70
15 23
16 162
26 104
47 165
54 80
56 121
135 139
143 161
75 10
92 132
86 29
142 155
124 51
111 166
131 149
112 72
65 115
71 110
12 98
168 158
164 159
27 83
1 2
3 4
5 7
8 9
11 13
14 17
18 19
20 21
22 24
25 28
30 31
32 33
34 35
36 37
38 39
40 41
42 43
44 45
46 48
49 50
52 53
55 57
58 59
60 61
6...

result:

ok ok (1000 test cases)

Test #23:

score: 0
Accepted
time: 61ms
memory: 3640kb

input:

1000
154
825004796 802565417
-88001579 364640592
778546546 -57508543
283686672 -57508543
473326798 -826011553
152069566 -577222261
528378065 -577222261
-56296909 -700802856
-711386984 953035370
-711386984 -577222261
895677144 -359290436
840183000 364640592
528378065 -752921798
895677144 -577222261
8...

output:

154
15 182
52 127
74 80
109 308
270 137
282 131
233 148
97 265
106 122
59 295
237 49
201 35
261 45
174 204
40 10
251 187
305 192
84 266
39 144
250 291
116 9
56 292
260 32
143 111
172 141
217 216
193 278
104 212
302 170
210 191
165 232
189 30
180 163
256 18
58 211
164 234
198 53
108 289
179 26
294 78...

result:

ok ok (1000 test cases)

Test #24:

score: 0
Accepted
time: 74ms
memory: 3816kb

input:

1000
63
859289659 -203061342
831821977 -778714404
640602188 478366497
205686723 -232506600
831821977 -498015901
-494818974 35295117
612307834 -234198721
612307834 -495294231
-898414633 476295237
995217164 -232506600
831821977 934046031
-441937174 432603845
995217164 938111737
874550198 -309423823
87...

output:

63
18 23
25 49
47 60
54 63
59 121
90 109
101 108
22 62
118 78
56 31
40 100
9 50
53 67
33 61
44 102
29 26
114 75
85 112
97 6
74 119
42 41
72 107
12 117
98 38
52 120
30 86
39 71
28 16
82 27
21 92
83 19
32 51
126 113
99 103
4 94
81 123
64 77
46 20
70 106
122 79
93 115
57 35
8 7
73 84
58 34
91 89
76 125...

result:

ok ok (1000 test cases)

Test #25:

score: 0
Accepted
time: 65ms
memory: 4020kb

input:

1000
83
-242219535 -952757420
753940135 -13368420
-180286961 -530756654
586180284 -625675517
-437809383 472014390
-242857851 -924097244
-382920283 -625675517
-630990620 -349004314
-242219535 122507147
208821889 -495849186
-736086757 -489441806
-996984615 -974276781
-275306966 -25109596
967186464 -65...

output:

83
6 120
8 106
11 66
12 124
15 34
17 158
19 156
20 142
26 84
27 69
28 60
33 132
38 62
39 46
51 52
57 97
58 113
59 93
67 87
70 157
89 144
95 116
100 143
103 129
111 137
112 165
114 125
119 138
122 136
134 160
141 149
155 164
110 21
162 140
128 148
130 90
166 55
123 109
152 5
42 94
7 105
145 50
159 30...

result:

ok ok (1000 test cases)

Test #26:

score: 0
Accepted
time: 59ms
memory: 3884kb

input:

1000
142
-28949259 975363136
-628367037 975363136
786525293 975363136
-8339801 975363136
868048337 975363136
208733157 975363136
-724415150 975363136
213367214 975363136
-686387505 975363136
-970451747 975363136
761135553 975363136
-551594491 975363136
-925080593 975363136
-243465321 975363136
-6722...

output:

142
1 83
2 78
3 207
4 210
5 128
6 219
7 89
8 77
9 201
10 113
11 120
12 110
13 66
14 202
15 118
16 72
17 156
18 133
19 136
20 90
21 32
22 88
23 137
24 278
25 29
26 27
28 154
30 35
31 152
33 264
34 165
36 233
37 163
38 260
39 173
40 222
41 148
42 86
43 250
44 248
45 114
46 164
47 174
48 275
49 117
50 ...

result:

ok ok (1000 test cases)

Test #27:

score: 0
Accepted
time: 56ms
memory: 3852kb

input:

1000
458
102600109 754726017
-66999931 951825513
-767202008 951825513
-845069119 754726017
-448344214 754726017
174342794 754726017
176530329 754726017
553731053 754726017
-69189351 754726017
-455330522 951825513
-261324017 754726017
809818684 951825513
745593756 951825513
-130095774 754726017
-2737...

output:

458
1 687
4 900
5 136
8 327
14 878
15 675
16 899
21 538
25 99
28 583
32 319
33 42
35 564
36 370
39 40
41 526
44 701
49 645
52 777
57 342
58 692
67 434
68 82
69 249
72 801
75 693
84 218
85 860
91 215
92 703
96 97
103 686
105 179
107 516
110 499
111 365
115 162
116 184
117 428
121 723
122 761
125 608
...

result:

ok ok (1000 test cases)

Test #28:

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

input:

1000
273
638010636 -796267612
299279783 -796267612
321987052 -571635029
-388046291 -571635029
-491314021 -796267612
130988206 -571635029
32427063 -571635029
51875304 -571635029
-508530089 -796267612
269379692 -571635029
214241513 -796267612
720122947 -796267612
-678543365 -796267612
158504867 -79626...

output:

273
1 128
3 119
4 64
6 220
7 289
8 517
11 41
12 409
13 90
15 515
16 192
17 269
19 532
20 300
22 400
23 465
24 405
25 190
26 426
28 162
29 542
30 217
32 390
33 123
34 489
35 292
38 209
40 457
43 50
44 455
46 325
47 540
48 439
49 513
51 345
52 81
53 114
55 503
56 100
57 327
58 208
60 304
61 339
63 414...

result:

ok ok (1000 test cases)

Test #29:

score: 0
Accepted
time: 51ms
memory: 3620kb

input:

1000
75
429681826 802800421
429681826 -608943566
429681826 -787858696
429681826 507047252
429681826 485971873
429681826 -346306621
429681826 -612405192
429681826 -13671560
429681826 -816374335
429681826 513226316
429681826 892335083
429681826 -352600432
429681826 -556540475
429681826 -504699273
4296...

output:

75
95 54
133 47
55 28
121 147
79 9
22 139
71 3
145 140
119 85
24 132
76 7
2 141
66 26
13 78
67 53
81 120
14 87
144 69
34 117
83 16
41 105
17 72
46 116
94 40
12 6
74 44
106 27
84 51
100 108
111 146
114 70
142 136
35 135
62 25
90 33
131 82
149 107
127 8
118 43
88 77
42 31
65 143
102 60
29 75
103 20
49...

result:

ok ok (1000 test cases)

Test #30:

score: 0
Accepted
time: 52ms
memory: 3992kb

input:

1000
81
403001151 -229966312
-27290952 -941247950
-27290952 -872808715
403001151 -81762908
403001151 825473197
403001151 730971412
403001151 -886560490
-27290952 394200417
-27290952 808677817
-27290952 -961778274
-27290952 -245434545
403001151 318019109
-27290952 792029613
403001151 390473732
-27290...

output:

81
143 10
2 32
27 155
44 3
132 107
131 39
45 97
150 152
154 19
156 47
100 78
130 46
111 112
64 35
63 151
23 101
102 76
11 116
153 38
138 77
82 83
135 136
91 72
30 128
50 26
59 127
110 17
8 157
24 84
115 160
123 109
122 40
13 21
9 114
25 99
106 133
126 15
71 108
33 94
146 140
139 81
113 149
148 55
7 ...

result:

ok ok (1000 test cases)

Test #31:

score: 0
Accepted
time: 56ms
memory: 3692kb

input:

1000
257
-24981531 -524783010
-24981531 376842743
132542945 905111237
-24981531 -663183576
132542945 238995240
-24981531 -904084630
132542945 330336577
-24981531 -424310756
132542945 26224857
-24981531 573604180
132542945 -531956470
132542945 583434945
132542945 620552707
-24981531 -351085713
132542...

output:

257
386 247
291 59
453 186
54 246
6 227
385 232
243 416
288 402
27 449
170 353
187 428
347 245
175 169
185 274
463 485
487 442
454 241
103 335
273 248
88 475
4 292
31 106
479 266
425 373
71 105
478 304
109 357
237 165
421 1
356 158
134 455
436 371
116 30
84 259
140 452
8 339
399 218
164 378
242 352
...

result:

ok ok (1000 test cases)

Test #32:

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

input:

1000
21
541263298 571344162
-338833794 258719906
814556806 571344162
749911951 -730958945
-737751671 400747496
880311857 -204125795
-555645311 -832036787
-338833794 -832036787
582588235 -915718735
-124654808 394321598
-202932677 571344162
541263298 -975674793
880311857 -730958945
-126659351 25871990...

output:

21
1 40
2 14
4 13
5 34
8 32
9 33
10 42
11 36
15 41
17 25
19 24
35 37
20 16
28 26
7 31
23 22
39 18
12 29
30 21
38 3
6 27
37
18 49
22 46
24 62
20 21
2 51
37 29
14 52
23 61
35 30
47 26
31 25
50 43
48 56
65 7
5 17
12 66
68 1
72 8
27 42
63 19
40 73
45 59
32 41
71 67
58 6
39 70
55 38
28 57
16 54
69 13
44 ...

result:

ok ok (1000 test cases)

Test #33:

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

input:

1000
82
620344713 761205214
564192450 -149133296
855072748 -725730286
-369866361 761205214
-126903403 123500699
521658307 -238068427
564192450 -575382074
424528213 639391487
160949070 -238068427
490683515 736060786
-861287945 -430077137
92203881 -414548921
-228263452 -161807552
-739623881 619906932
...

output:

79
1 4
3 78
6 9
11 119
12 161
16 76
17 71
18 103
19 106
21 36
22 118
24 70
25 34
27 124
30 52
33 160
37 128
38 123
39 153
41 65
43 60
45 62
47 107
48 108
53 132
54 146
55 91
56 152
57 88
59 141
63 97
64 140
66 81
67 145
69 75
77 87
82 95
84 155
90 148
93 101
98 120
121 122
125 135
131 142
137 154
13...

result:

ok ok (1000 test cases)

Test #34:

score: 0
Accepted
time: 80ms
memory: 6448kb

input:

100
715
-716037174 449787280
-179603495 267807227
-85847745 -339745287
531498593 906672966
-65182647 -249655497
196101865 -917254384
569704541 175181937
408949063 -60772621
-471098833 -180592225
452882519 -173474204
518554869 504642822
-610596606 -43048739
-173418328 49620755
-490214353 129314297
-8...

output:

0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85 86
87 88
89 90
91 92
93 94
95 96
97 98
99 100
101 10...

result:

ok ok (100 test cases)

Test #35:

score: 0
Accepted
time: 78ms
memory: 4296kb

input:

100
1180
999939181 999607824
999877463 999501538
999725395 999197028
999578614 999669422
999691207 999388141
999798382 999350154
999515140 999686861
999804739 999722876
999059909 999779016
999988075 999795096
999394228 999790648
999357316 999130743
999834412 999146926
999533794 999419507
999164265 9...

output:

2
294 1956
485 2069
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85 86
87 88
89 90
91 92
93 94
95 96
9...

result:

ok ok (100 test cases)

Test #36:

score: 0
Accepted
time: 83ms
memory: 4832kb

input:

100
10
999949463 999921247
999942779 999933524
999900374 999919960
999913527 999977190
999963539 999919222
999986393 999982382
999960627 999912715
999955900 999934316
999962876 999904282
999944172 999923360
999974177 999993968
999960412 999941887
999902083 999920318
999906832 999942948
999934454 999...

output:

0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85...

result:

ok ok (100 test cases)

Test #37:

score: 0
Accepted
time: 82ms
memory: 12984kb

input:

100
2795
999995625 999994422
999997406 999998890
999996073 999998910
999996365 999992345
999992211 999999534
999990826 999998894
999990827 999999648
999991569 999997094
999997323 999994792
999990812 999994722
999994392 999998879
999994441 999990381
999992051 999993298
999997822 999994423
999998285 9...

output:

1710
1 1185
3 2184
4 3332
9 3655
11 3648
12 2218
13 3779
15 3422
21 2633
30 291
33 5543
35 800
37 4007
38 1599
39 2180
43 2444
46 5229
50 4271
51 351
57 4930
63 2459
66 2958
68 836
70 2242
72 1008
73 758
76 495
77 4284
82 5247
85 4860
86 2833
90 3608
92 5367
97 3480
98 3067
99 5458
100 1513
105 439
...

result:

ok ok (100 test cases)

Test #38:

score: 0
Accepted
time: 87ms
memory: 6728kb

input:

100
1005
999999258 999999564
999999716 999999506
999999057 999999959
999999274 999999385
999999562 999999714
999999749 999999926
999999159 999999330
999999060 999999408
999999218 999999582
999999097 999999761
999999853 999999231
999999424 999999841
999999744 999999186
999999400 999999073
999999445 9...

output:

985
1 1836
2 1431
7 1583
8 1110
13 584
16 1838
19 1992
21 637
23 1069
28 621
31 1746
35 1566
37 811
38 798
39 1814
41 546
42 1978
46 883
57 229
58 60
59 1340
64 702
68 1557
72 605
73 968
74 250
75 451
79 259
82 1409
84 270
98 377
101 1432
103 1889
107 110
108 274
109 476
112 1645
113 604
114 346
115...

result:

ok ok (100 test cases)

Test #39:

score: 0
Accepted
time: 72ms
memory: 4512kb

input:

100
174
-958876330 -846470800
-796741809 -131152725
574295122 764287642
-958876330 -825762193
185468313 -971066749
-287559769 764287642
-904746093 -825762193
-438778854 -825762193
5267152 609322023
185468313 77515090
185468313 -131152725
-287559769 247199580
-491475497 260165013
719679418 -179087066...

output:

174
22 131
24 123
78 82
81 94
134 276
89 235
1 4
190 120
57 287
18 55
255 88
66 311
69 292
269 320
75 243
49 76
7 223
322 229
226 309
112 342
42 246
143 184
215 128
282 210
295 244
170 172
285 2
56 268
60 329
211 149
213 233
166 29
70 31
110 177
37 19
310 43
91 273
46 159
180 232
227 330
168 290
331...

result:

ok ok (100 test cases)

Test #40:

score: 0
Accepted
time: 82ms
memory: 4572kb

input:

100
454
292487349 -708917766
-446575764 -920302303
373857024 -525302786
236159958 -877034512
240035307 -28559828
-156425976 29793081
-683968223 -28559828
658545653 -892201965
-485118423 -349005511
-677465608 102959577
-241309351 -615266668
-857580103 -877034512
590882873 69859569
-961101806 -2385646...

output:

454
2 855
4 535
8 114
10 211
12 460
15 364
20 772
21 370
26 318
27 532
32 48
39 618
45 743
46 330
47 765
50 463
51 181
59 346
60 157
61 783
68 248
69 335
72 512
73 314
74 357
76 510
82 554
86 469
87 269
88 400
89 252
91 660
92 581
93 232
94 603
98 560
99 373
112 538
116 119
124 610
132 413
133 311
1...

result:

ok ok (100 test cases)

Test #41:

score: 0
Accepted
time: 85ms
memory: 4848kb

input:

100
140
229220674 878836488
-506767178 293730975
960642833 878836488
485659386 878836488
-225376185 16183205
-322465048 -460955536
-635701181 878836488
-578723152 374559636
956924322 878836488
-666563369 -550449367
-240963901 374559636
9519098 374559636
404598294 16183205
-188062738 467646265
937074...

output:

140
10 38
11 234
13 178
17 79
26 153
36 193
37 219
39 83
40 63
49 110
60 181
74 185
80 226
89 278
90 213
96 179
108 121
137 175
138 261
147 275
156 208
168 240
191 243
199 263
205 257
244 266
253 271
99 270
97 187
177 204
245 182
67 256
227 250
202 230
52 276
189 75
116 54
152 162
94 190
126 160
70 ...

result:

ok ok (100 test cases)

Test #42:

score: 0
Accepted
time: 69ms
memory: 9612kb

input:

100
453
-9728842 -879506383
723264369 -879506383
-617602947 -879506383
-883543546 -879506383
-365459776 -879506383
259863014 -879506383
-229024413 -879506383
-357634378 -879506383
45613473 -879506383
897413515 -879506383
142722904 -879506383
308356916 -879506383
-528467703 -879506383
45803942 -87950...

output:

453
1 555
2 428
3 115
4 853
5 611
6 872
7 159
8 607
9 14
10 757
11 68
12 324
13 580
15 595
16 116
17 774
18 105
19 561
20 710
21 624
22 833
23 332
24 378
25 582
26 443
27 735
28 306
29 429
30 528
31 167
32 469
33 127
34 361
35 604
36 94
37 140
38 442
39 351
40 763
41 826
42 711
43 688
44 456
45 509
...

result:

ok ok (100 test cases)

Test #43:

score: 0
Accepted
time: 70ms
memory: 5496kb

input:

100
1681
-648014211 -216027092
-372352298 95789050
-678908480 95789050
-382412165 95789050
214922606 95789050
45021991 95789050
131451784 95789050
926607022 -216027092
-500711391 95789050
527775426 -216027092
860331657 95789050
-255764825 95789050
314154093 -216027092
-631103238 95789050
292792358 9...

output:

1681
1 851
2 642
3 1855
4 555
5 448
7 2746
8 219
9 2548
10 1306
11 969
12 1121
15 90
16 1274
17 1370
18 2727
19 393
20 1401
22 1351
23 2240
24 1207
27 2857
31 738
32 2848
33 1540
36 1289
37 2898
38 754
39 2800
40 1637
41 1183
44 1008
45 746
46 2739
47 3348
48 236
49 2139
50 2346
51 1427
53 3269
54 1...

result:

ok ok (100 test cases)

Test #44:

score: 0
Accepted
time: 77ms
memory: 5280kb

input:

100
476
218894313 -685169320
967098661 -16626457
-797375436 -16626457
955557493 -16626457
54133572 -16626457
-722192690 -16626457
791557373 -16626457
-208166285 -685169320
185917393 -16626457
-338707386 -16626457
49911294 -16626457
-359502368 -685169320
-359176146 -685169320
430103061 -16626457
-744...

output:

476
6 817
7 223
11 478
14 41
16 855
18 598
19 241
22 408
23 397
26 951
27 413
30 214
32 328
33 822
34 212
35 496
37 73
39 128
40 746
45 145
48 528
53 229
58 455
64 198
69 668
70 468
72 110
76 920
78 194
80 534
81 596
82 928
91 909
95 195
97 516
99 446
102 443
111 174
117 873
120 253
124 690
125 227
...

result:

ok ok (100 test cases)

Test #45:

score: 0
Accepted
time: 66ms
memory: 3988kb

input:

100
1281
-7127937 -551225280
-7127937 -63829747
-7127937 50255920
-7127937 685959203
-7127937 -474730627
-7127937 205475943
-7127937 894868084
-7127937 -262984557
-7127937 858324856
-7127937 257534742
-7127937 -640954010
-7127937 -111367493
-7127937 892100661
-7127937 696606550
-7127937 136498536
-7...

output:

1281
318 1213
259 81
1291 1611
926 906
2219 1594
1702 594
1191 1363
1475 1016
592 309
1575 1661
36 324
1987 1138
2531 2208
1405 134
575 946
859 1176
365 1742
1800 173
2050 2395
379 965
426 1417
270 2466
1160 442
1533 1324
2528 52
1901 1898
1655 981
1996 1748
249 2182
1555 1321
1356 1768
2437 419
982...

result:

ok ok (100 test cases)

Test #46:

score: 0
Accepted
time: 72ms
memory: 4220kb

input:

100
2300
930979038 -865442548
56354538 569246647
930979038 209346563
930979038 -402151796
56354538 9788037
930979038 349210639
930979038 113353815
56354538 -508882748
56354538 -390359400
930979038 881411592
56354538 328521324
56354538 569030395
56354538 749112678
930979038 -492654973
930979038 -5806...

output:

2300
3652 4073
3769 1823
1584 2815
4116 4095
3238 930
883 2960
3460 2966
629 2154
556 2812
3418 4206
3700 1496
3878 1649
138 2506
1604 3521
532 2197
754 2850
3297 426
2987 3683
2811 2599
443 43
655 3790
1049 2315
4430 3922
486 271
2434 2838
3610 342
4038 2491
1784 3304
688 1743
2843 848
3170 820
304...

result:

ok ok (100 test cases)

Test #47:

score: 0
Accepted
time: 57ms
memory: 4160kb

input:

100
393
484804995 -671233294
484804995 45381500
-343734967 483744892
-343734967 -678278044
-343734967 430018594
484804995 -536133521
-343734967 972761171
-343734967 188883545
484804995 291634094
484804995 161326893
484804995 43447237
-343734967 81642646
-343734967 905579532
484804995 -838456546
4848...

output:

393
751 588
385 749
272 587
86 516
292 601
307 399
656 753
305 33
617 598
652 240
740 111
606 144
90 375
364 582
456 439
206 222
608 471
641 154
267 106
274 295
642 304
270 241
25 34
777 554
674 175
443 296
497 665
772 173
565 4
253 182
351 174
117 115
765 660
786 124
627 515
248 349
300 759
432 429...

result:

ok ok (100 test cases)

Test #48:

score: 0
Accepted
time: 77ms
memory: 5576kb

input:

100
2245
257511569 -570888823
-409065975 834451934
972932318 -206332685
-220073979 -895107571
819486773 -206332685
819823298 -570888823
116295608 282026121
589205449 -895107571
-54658019 -895107571
987042524 -206332685
-196884689 282026121
-940822451 993058719
402874649 -895107571
633334868 99305871...

output:

2245
7 906
8 1839
9 1605
23 793
26 2434
30 3865
35 2075
39 2684
50 4218
54 2493
56 1700
57 1187
61 1409
64 137
68 3107
73 3594
86 4214
88 1693
103 1788
105 1051
106 1491
108 703
109 2628
110 828
119 1198
120 718
126 1834
133 3516
134 1883
135 372
140 2537
142 1415
147 558
148 1680
149 2481
150 1759
...

result:

ok ok (100 test cases)

Test #49:

score: 0
Accepted
time: 79ms
memory: 4728kb

input:

100
116
-28349829 -267772969
-181233169 605639981
-221792554 885875755
-8847461 376377302
-527881168 376377302
-794286947 885875755
-442516480 365428090
60367949 59687335
844852200 -267772969
70152464 -267772969
-326579976 59687335
-382146420 885875755
-305012413 376377302
-255659827 495623398
84485...

output:

116
1 38
5 166
6 201
8 142
9 30
17 35
18 103
20 124
22 36
40 118
42 176
46 186
48 73
50 67
52 57
54 220
56 223
58 167
62 175
63 149
64 221
65 211
68 202
69 105
70 179
75 229
80 144
85 145
88 158
89 100
90 197
91 159
92 181
93 155
94 192
95 120
106 232
107 123
108 178
116 188
119 187
125 209
128 163
...

result:

ok ok (100 test cases)

Test #50:

score: 0
Accepted
time: 100ms
memory: 6752kb

input:

10
10568
266619539 928993099
644537002 -163339024
-965315605 131093436
-873401839 -319727236
-682029920 -699502948
-857838819 -528950378
126750467 -72275669
623580094 410832833
287731394 -865265684
-71034303 515678565
-897514612 929674238
-794392375 895647772
811715826 600060479
640892543 -557248887...

output:

0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85 86
87 88
89 90
91 92
93 94
95 96
97 98
99 100
101 10...

result:

ok ok (10 test cases)

Test #51:

score: 0
Accepted
time: 103ms
memory: 14144kb

input:

10
983
999595593 999481588
999941833 999204986
999676040 999115470
999653065 999524261
999950018 999574889
999911879 999942071
999134864 999155033
999133604 999956453
999424191 999531479
999169859 999553795
999163364 999608732
999486991 999180185
999600255 999690901
999278724 999959357
999886640 999...

output:

2
931 1118
1034 997
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85 86
87 88
89 90
91 92
93 94
95 96
9...

result:

ok ok (10 test cases)

Test #52:

score: 0
Accepted
time: 99ms
memory: 11572kb

input:

10
15236
999975325 999978324
999983228 999957461
999965056 999943264
999953829 999920806
999913911 999975263
999949326 999952997
999948654 999968342
999957007 999987426
999900723 999909965
999944389 999907733
999911075 999973513
999997298 999931066
999983079 999918568
999946266 999969557
999900152 9...

output:

6279
4 27113
5 28786
11 11290
12 5876
13 15254
18 1462
21 6507
25 3278
28 1198
32 28159
38 10208
40 710
42 4572
52 11061
53 27790
64 14575
73 5887
74 22994
75 22004
76 28476
77 15546
79 7594
80 15986
85 30396
95 11239
102 30271
103 10685
105 14626
109 11811
110 29404
119 22323
120 24571
138 29037
14...

result:

ok ok (10 test cases)

Test #53:

score: 0
Accepted
time: 111ms
memory: 10396kb

input:

10
6642
999992808 999996636
999995238 999998603
999990460 999998357
999992495 999998027
999994992 999993315
999990663 999999307
999994510 999991024
999994319 999993024
999996312 999990447
999990590 999994561
999997748 999994786
999990918 999993436
999994457 999993851
999994234 999991647
999996595 99...

output:

6031
2 7308
9 730
12 4226
13 8236
14 6815
16 11198
17 3975
20 1402
22 12902
23 683
24 10035
25 6031
31 1043
33 7548
36 10729
39 10692
43 4298
45 2527
48 4398
49 1439
50 9572
51 8841
52 7197
58 3534
59 12210
60 4942
62 7017
76 6118
79 2369
89 13225
92 8312
93 10937
102 12377
107 10062
108 10753
110 2...

result:

ok ok (10 test cases)

Test #54:

score: 0
Accepted
time: 90ms
memory: 8380kb

input:

10
19516
999999707 999999837
999999488 999999818
999999509 999999591
999999991 999999026
999999356 999999726
999999489 999999193
999999038 999999298
999999881 999999157
999999344 999999162
999999160 999999113
999999139 999999582
999999470 999999327
999999742 999999921
999999255 999999737
999999216 9...

output:

19516
28 7789
98 19297
131 21025
162 35462
232 35578
270 13000
283 2726
359 18468
363 21186
368 4686
485 31076
527 14276
608 18602
624 1067
667 30905
700 21219
744 35704
795 5950
799 11810
812 27800
878 29567
982 29756
1179 28576
1209 5136
1213 21016
1217 31671
1230 6038
1292 25458
1346 20101
1388 2...

result:

ok ok (10 test cases)

Test #55:

score: 0
Accepted
time: 82ms
memory: 8444kb

input:

10
14948
-170688734 833794743
949001579 224632065
-887648481 346146784
994218765 -808897932
948269970 764123696
24957273 562441566
-170688734 843621240
959643634 -354951661
631351081 -86364881
-9691567 824383620
-935916525 352437858
381851425 387057559
-6239193 951794229
450798340 -742525732
-394344...

output:

14948
81 8128
391 24762
573 26066
667 6640
682 4251
1030 13085
1282 1628
1898 29838
2244 29055
2460 26885
2463 25104
2533 19994
3156 8707
3252 27459
3262 12381
3662 5625
3671 6894
3777 11760
4171 28916
4718 8819
5463 24261
5472 6606
5776 15289
5872 10735
6256 16851
6421 10085
6448 18970
6750 11246
6...

result:

ok ok (10 test cases)

Test #56:

score: 0
Accepted
time: 97ms
memory: 11524kb

input:

10
18275
46937162 -785699925
-512599977 -861792903
-732947245 771605479
-317815822 369273432
-478775873 211331712
-678678382 -401598442
-366699505 752973691
776710779 -7216385
-88306688 -190102574
328516250 -317225669
522217639 215990988
523904534 -256490677
540608168 493241721
620782210 -185524925
...

output:

18275
203 22704
253 31712
394 33977
403 1329
592 16991
649 27993
719 21408
796 6381
934 11340
1158 34994
1389 30027
1411 24238
1604 5467
1683 7682
1686 7309
1760 33334
1807 23399
1888 3814
1963 31098
2028 9543
2172 26764
2453 22500
2533 17162
2718 30201
2744 16757
2749 22692
2858 32935
2864 12462
29...

result:

ok ok (10 test cases)

Test #57:

score: 0
Accepted
time: 115ms
memory: 10948kb

input:

10
390
-347835130 869197644
963535733 392603688
671237510 92351133
671237510 -703861232
671237510 423461538
671237510 369343656
671237510 980877320
-347835130 456099182
671237510 -311676199
-347835130 -886266831
-347835130 -257100015
-347835130 -637839633
963535733 -16989823
963535733 -821875052
963...

output:

390
43 107
132 137
141 777
611 693
368 70
324 415
25 627
560 650
695 10
637 629
250 453
104 454
745 139
653 233
475 547
615 186
379 700
487 193
763 697
90 203
462 423
550 625
235 513
34 201
115 209
12 134
343 626
131 256
534 632
420 155
592 678
619 450
579 52
226 46
377 722
614 404
119 464
266 283
2...

result:

ok ok (10 test cases)

Test #58:

score: 0
Accepted
time: 78ms
memory: 16928kb

input:

10
1285
637213737 -900998147
-356659628 -900998147
950244610 -900998147
-182671545 -900998147
-708950884 -900998147
-973866581 -900998147
-190878205 -900998147
135731649 -900998147
-125331609 -900998147
521939981 -900998147
976257311 -900998147
818237327 -900998147
705563706 -900998147
58565785 -900...

output:

1285
1 1389
2 436
3 2556
4 1366
5 2447
6 2092
7 559
8 1308
9 1876
10 1978
11 1862
12 1122
13 480
14 2341
15 1360
16 2220
17 1871
18 1255
19 1326
20 1267
21 1790
22 1208
23 153
24 2335
25 1272
26 2377
27 1071
28 1665
29 433
30 960
31 809
32 2358
33 1431
34 241
35 2453
36 323
37 62
38 1898
39 1277
40 ...

result:

ok ok (10 test cases)

Test #59:

score: 0
Accepted
time: 102ms
memory: 20560kb

input:

10
5000
-188767223 -315528788
-987365245 -315528788
-106387689 135511984
127392808 -315528788
800721151 -315528788
146952905 -315528788
-323702728 135511984
411611172 135511984
872064533 -315528788
-40050336 135511984
119702024 135511984
-208480603 -315528788
679048782 -315528788
402900711 -31552878...

output:

5000
1 2021
2 342
3 6153
5 5143
6 7462
12 3804
16 5199
19 6585
22 3168
24 390
31 3749
33 5533
34 1006
36 5913
39 5059
42 61
47 812
49 1150
51 8519
52 1110
54 6423
55 8959
58 8427
59 4709
60 8256
62 7716
66 2768
67 4814
68 3321
73 5067
75 461
78 2455
79 3710
86 4778
88 4985
89 9762
90 9224
92 9014
94...

result:

ok ok (10 test cases)

Test #60:

score: 0
Accepted
time: 82ms
memory: 18196kb

input:

10
5892
25327490 -567979409
-735380777 -567979409
362509197 -518667355
380762791 -518667355
-325207607 -518667355
541910006 -518667355
36310841 -567979409
-726943590 -518667355
513235902 -518667355
289283655 -518667355
290421813 -567979409
892523351 -567979409
-894087744 -567979409
621832318 -567979...

output:

5892
2 8846
6 4895
7 1379
11 9937
14 4834
15 5905
16 11554
17 6582
19 3516
20 9600
21 8355
26 5497
32 7810
33 7725
34 10225
35 11063
36 7193
37 4000
40 10462
43 3182
44 89
46 4912
49 9274
50 4985
51 10991
55 6344
56 5729
59 2693
60 4617
62 4461
63 1082
64 1589
67 7026
68 9818
69 10410
70 4251
72 193...

result:

ok ok (10 test cases)

Test #61:

score: 0
Accepted
time: 78ms
memory: 11564kb

input:

10
7074
241731848 530211859
241731848 -112101076
241731848 -387299272
241731848 840407166
241731848 -519364921
241731848 -927667636
241731848 -12750799
241731848 446782229
241731848 -605995785
241731848 -360804301
241731848 -706630766
241731848 95158934
241731848 -937680624
241731848 162324777
24173...

output:

7074
11105 6133
2348 6041
6028 1466
1027 11615
3209 7046
9014 7246
9745 7369
4832 12989
2640 8596
12227 2450
2503 8228
8710 11496
9684 7346
8068 6810
13697 8060
5095 2963
11264 11584
2625 3739
3083 3572
6975 10549
2681 5712
12418 8017
7565 5881
4567 11469
5166 12323
413 4371
1259 103
7802 9110
10586...

result:

ok ok (10 test cases)

Test #62:

score: 0
Accepted
time: 82ms
memory: 15672kb

input:

10
729
867500722 -983664796
867500722 -428285695
-323742684 -171458916
-323742684 440597108
867500722 878319625
867500722 225023835
-323742684 -291982426
-323742684 568294497
867500722 327920686
867500722 -477580489
-323742684 310693081
-323742684 775098797
867500722 -334572408
-323742684 181766129
...

output:

729
1183 574
64 599
374 1098
1063 866
1243 305
888 1374
919 688
1047 332
502 42
1447 939
1027 1429
803 213
1202 1253
1174 715
575 1164
1382 749
237 769
965 671
1144 1376
1457 1086
950 327
1168 1094
1393 485
484 353
657 1118
1262 500
70 1349
1032 440
1394 886
1132 806
498 773
88 1044
222 352
635 227
...

result:

ok ok (10 test cases)

Test #63:

score: 0
Accepted
time: 82ms
memory: 11308kb

input:

10
23890
-966926807 -783294985
-966926807 -231086723
-966926807 -827425532
-966926807 951590873
-966926807 -847083727
-322954521 -903547355
-966926807 395823002
-322954521 113620163
-966926807 442076584
-322954521 -358356830
-966926807 -416611206
-966926807 308206261
-322954521 -548371038
-966926807...

output:

23890
27175 29453
28437 47713
41649 11873
5268 24829
41768 38522
24632 39951
44626 44490
38459 30485
22843 30908
12216 17745
16257 15426
44929 6226
45191 5977
31310 39361
32350 35209
28066 16543
10967 35831
1542 47698
6052 25307
12980 5438
20081 16649
10476 4643
43531 35032
31903 3677
41273 5129
290...

result:

ok ok (10 test cases)

Test #64:

score: 0
Accepted
time: 95ms
memory: 17380kb

input:

10
6461
164403694 719871079
-178686855 -505252945
820168812 419207217
-229478200 77799158
677361796 77799158
575661006 419207217
-697613489 -329650846
-362539459 -563403377
727778010 -563403377
-111787135 419207217
892586613 -329650846
664142990 435882783
-746057528 435882783
-484808272 -329650846
-...

output:

6461
2 5417
9 5754
11 646
12 508
19 3746
20 1078
24 1668
26 9268
32 8575
33 5706
36 1597
38 12499
39 12016
40 5109
46 3986
51 11287
56 6580
59 2168
62 12033
63 4958
72 4751
75 2301
76 11027
80 1823
81 5572
84 11378
86 6720
93 12759
99 4813
104 3832
106 820
108 7610
109 7680
118 2697
121 6938
124 698...

result:

ok ok (10 test cases)

Test #65:

score: 0
Accepted
time: 102ms
memory: 14460kb

input:

10
14956
895706895 998300226
820538240 306140296
-445632195 597312604
-409959410 597312604
755346555 251251450
259123019 -176732314
701825202 -694016428
520061157 306140296
626248236 -236060915
321824154 -762678310
714689875 444441588
-774797456 597312604
4205823 306140296
104689711 -236060915
-9484...

output:

14956
20 9410
132 19997
133 10891
204 13923
233 730
332 27147
338 29314
348 29901
358 19443
364 20661
397 1213
439 23083
449 12953
472 27301
494 29274
505 17910
513 16242
519 20088
702 13216
782 7146
829 15656
897 7566
1098 1708
1124 1484
1125 22397
1128 8263
1186 28717
1320 10521
1339 26846
1502 26...

result:

ok ok (10 test cases)

Test #66:

score: 0
Accepted
time: 113ms
memory: 19076kb

input:

1
100000
70720045 -382955525
180416482 414551370
-321808609 -148240525
-959621209 239890090
279590168 239445206
-672414454 -968764851
978907902 855176899
-927586531 -493246847
-87140549 -239161862
394302217 -390243883
747094712 472952985
437187652 834551586
-394349288 431373156
954522299 545636033
-...

output:

23
2141 144486
10401 178409
22866 143875
41051 182115
45492 101362
49195 166828
49949 149697
63240 180810
64369 142744
67341 166114
79976 198477
109193 154893
117559 170770
134034 146324
149552 66171
29229 14288
71595 187330
72594 62290
83326 83895
126162 171747
28428 29718
39525 192121
37584 9286
1...

result:

ok ok (1 test case)

Test #67:

score: 0
Accepted
time: 126ms
memory: 24624kb

input:

1
100000
999264440 999048423
999943779 999924927
999580357 999266886
999189670 999239640
999169156 999823062
999940080 999293014
999369020 999661305
999189323 999146694
999183801 999589407
999918625 999551090
999402308 999679213
999139826 999423045
999933104 999726376
999862333 999034393
999325582 9...

output:

30281
9 32049
12 197923
13 74981
19 86452
23 195395
32 189660
48 45052
49 80253
57 89286
67 147739
71 119191
72 141960
80 103394
84 163665
102 19041
113 156521
137 198511
145 1411
148 38059
149 96020
150 103375
152 133470
168 129479
175 21873
196 88225
201 91290
204 185475
205 65779
207 71873
208 14...

result:

ok ok (1 test case)

Test #68:

score: 0
Accepted
time: 137ms
memory: 25580kb

input:

1
100000
999975273 999973662
999943883 999925191
999951597 999989446
999981472 999903478
999927188 999993354
999922765 999970341
999935838 999925520
999910876 999943291
999965140 999987674
999960397 999922095
999924484 999966851
999904125 999916521
999937262 999938937
999920433 999985453
999952260 9...

output:

97922
7 118199
10 60403
12 92954
19 48230
20 180364
22 193261
23 153574
24 44931
25 16346
27 161508
31 66989
33 72677
42 4514
54 156368
55 166902
56 119513
58 19614
63 166243
64 146290
70 2261
73 184363
75 198779
79 22743
81 143980
82 13046
83 16830
86 107459
87 137921
91 155421
94 57646
95 155003
9...

result:

ok ok (1 test case)

Test #69:

score: 0
Accepted
time: 111ms
memory: 19596kb

input:

1
100000
999995621 999999670
999999969 999993086
999991515 999996627
999998034 999997733
999990010 999990951
999994345 999999518
999995768 999995576
999990755 999995308
999994356 999993294
999999258 999992963
999991118 999997972
999996805 999995493
999996557 999999418
999998617 999990595
999992992 9...

output:

100000
50 157324
79 89464
84 2810
93 180092
94 106661
96 64166
123 163644
182 27707
185 73262
280 183176
309 158022
312 150866
359 52482
372 128579
395 182556
398 112649
424 126097
457 96301
480 75061
485 193857
503 30787
523 87522
575 65468
598 85430
607 12577
612 43889
650 114244
661 26586
740 121...

result:

ok ok (1 test case)

Test #70:

score: 0
Accepted
time: 102ms
memory: 18604kb

input:

1
100000
999999356 999999100
999999557 999999477
999999247 999999556
999999478 999999687
999999801 999999758
999999391 999999967
999999895 999999528
999999030 999999011
999999914 999999760
999999637 999999704
999999672 999999060
999999035 999999996
999999846 999999054
999999166 999999583
999999765 9...

output:

100000
209 120224
829 157489
937 101738
985 44141
1381 128094
1729 119503
2220 56787
2304 161508
2312 168926
2967 82364
3009 130972
3295 186994
3472 66867
3712 4540
4083 182668
4450 172666
4520 49592
4610 133692
4719 45770
4737 48087
4932 167758
5267 109222
5562 169978
5575 55443
6485 85374
6658 150...

result:

ok ok (1 test case)

Test #71:

score: 0
Accepted
time: 92ms
memory: 17316kb

input:

1
100000
-547614182 905649186
-730348421 219289192
-138779779 -601726529
637290947 785577159
582877718 711339300
-747547194 -798832505
156167189 928036875
718258793 236208965
357417172 -293383985
383912089 713166152
233364698 -834647510
33321838 -637401353
-524918636 -271511728
-93689863 14541656
65...

output:

100000
1391 176709
2552 105451
3567 4218
4369 105713
4632 153451
7729 70920
9175 122586
9220 86473
9508 170915
9804 80066
11309 70973
11730 151269
11768 62374
12125 106179
12398 66446
12967 37847
13920 174449
14264 66909
15840 179641
16601 24761
17428 70983
17583 101225
18142 83289
19314 129577
1945...

result:

ok ok (1 test case)

Test #72:

score: 0
Accepted
time: 103ms
memory: 17092kb

input:

1
100000
-894716977 -12445007
-635179783 -174303206
-468545915 -376509646
7552798 863131659
-452959582 -848004313
240678088 -531526042
-479003636 561079229
-136051729 -523206668
-54957196 -969050964
202486976 -149599358
511163288 -909769354
-642881606 611633044
470598875 411065934
-70167418 -8251878...

output:

100000
201 114670
857 64946
1343 187239
1595 123852
2377 182148
4681 57647
5353 156951
5501 64390
5896 85612
6065 134590
6359 143202
6836 144204
7187 149630
7847 24472
8226 170492
8318 110002
8510 179332
10003 50979
10082 139188
10115 135491
12363 32689
12414 25290
16195 73796
16448 80053
17001 1485...

result:

ok ok (1 test case)

Test #73:

score: 0
Accepted
time: 138ms
memory: 20844kb

input:

1
100000
798544191 -742903658
-344389104 -188662067
-571373110 161581382
-60448446 -916202148
-35781172 434088687
-786229077 240454644
-926134390 -986182581
17116411 -71954950
995069384 559207186
-65532930 -598813224
138636725 -620533705
781019115 572534456
-972340297 -182563578
-649565762 -18399977...

output:

99971
10 118318
11 119886
13 67921
18 49369
45 165059
56 130573
60 184347
64 42387
86 33642
94 186767
96 136847
100 108764
101 104573
104 56148
106 1727
110 98658
115 68131
130 87628
141 54990
157 159476
159 95109
162 32641
168 114293
173 152261
180 51255
209 191818
211 14999
217 115434
218 60042
24...

result:

ok ok (1 test case)

Test #74:

score: 0
Accepted
time: 107ms
memory: 50368kb

input:

1
100000
339988059 -602619276
-336733168 -602619276
-3170495 -602619276
608750101 -602619276
125004008 -602619276
877505856 -602619276
-736053016 -602619276
80826707 -602619276
612582932 -602619276
-901063623 -602619276
-24681200 -602619276
-338686211 -602619276
786194401 -602619276
-639927824 -6026...

output:

100000
1 166311
2 184761
3 12184
4 149467
5 126742
6 21441
7 67010
8 23525
9 167832
10 85032
11 134218
12 73716
13 101377
14 196536
15 63583
16 160477
17 168332
18 188298
19 191736
20 149190
21 108447
22 30379
23 81727
24 169208
25 53805
26 197034
27 112052
28 39645
29 46311
30 155854
31 139034
32 5...

result:

ok ok (1 test case)

Test #75:

score: 0
Accepted
time: 104ms
memory: 35088kb

input:

1
100000
-152505637 741483922
608264196 -922967866
-978496364 741483922
517162535 741483922
-622471931 -922967866
-321900491 -922967866
69265759 -922967866
-580002960 -922967866
653169748 741483922
-40672330 -922967866
486195777 -922967866
301503518 -922967866
481889997 741483922
-351983361 74148392...

output:

100000
129439 159601
97983 107249
88523 158263
128238 86026
118398 188671
93526 184138
120009 137230
134591 102146
140342 161746
195856 92264
128780 176140
181103 142049
4197 69204
83877 124162
59208 49920
60210 10991
47332 61956
72901 8248
63112 33474
105828 96463
78588 34190
94133 109087
123249 10...

result:

ok ok (1 test case)

Test #76:

score: 0
Accepted
time: 130ms
memory: 38668kb

input:

1
100000
756868275 -358967603
-497301030 -358967603
649448245 -358967603
-887427985 -535956822
878399175 -535956822
108874606 -358967603
-489595415 -358967603
325972197 -358967603
498592984 -535956822
333245905 -358967603
-950621798 -535956822
-609666390 -535956822
-740046219 -358967603
-720433327 -...

output:

100000
3 142993
8 192075
9 73276
10 129936
11 122973
13 58579
14 42876
15 14996
19 177146
21 192494
22 142321
24 32643
26 55501
27 188911
30 77932
31 20921
34 188088
38 17754
39 59842
40 1479
42 174248
47 155438
52 83534
54 198950
55 162848
56 42622
58 44670
59 39464
60 81366
61 87163
62 149582
63 1...

result:

ok ok (1 test case)

Test #77:

score: 0
Accepted
time: 96ms
memory: 17704kb

input:

1
100000
264643553 -937908082
264643553 361997414
264643553 -23850010
264643553 753755453
264643553 362490250
264643553 239156434
264643553 -577712364
264643553 -392015932
264643553 -411918647
264643553 -915806614
264643553 231314817
264643553 -909126325
264643553 -20860430
264643553 647884648
26464...

output:

100000
96733 44837
164539 156167
90187 133232
11415 64183
106125 36427
26293 95466
129488 141676
10605 137945
111425 45420
128774 180855
135928 125498
12728 22886
27397 38445
41640 112282
23288 101227
11044 47132
135972 21492
170564 178396
92827 21840
100538 125039
138717 96907
125640 162522
97800 1...

result:

ok ok (1 test case)

Test #78:

score: 0
Accepted
time: 92ms
memory: 18136kb

input:

1
100000
13210362 155232928
689159667 -465052240
13210362 21054014
689159667 867788821
689159667 -625434390
13210362 364078249
13210362 -911970949
13210362 937669731
689159667 -904647545
13210362 953420119
689159667 349328690
13210362 772099718
689159667 -718290541
13210362 -863735041
689159667 -306...

output:

100000
4428 46382
104363 15911
151014 147059
156631 95700
165010 87869
28461 42826
179365 194857
172262 8669
51378 22023
83936 7970
114401 160639
90496 188169
61866 151628
89905 148746
74660 54063
92568 138694
102939 123194
93603 82912
24158 20042
128896 128283
153439 78353
116465 74209
5417 117098
...

result:

ok ok (1 test case)

Test #79:

score: 0
Accepted
time: 101ms
memory: 18772kb

input:

1
100000
-530472390 452797636
12273745 -840226242
12273745 138841937
-530472390 397016016
-530472390 309315299
12273745 979552760
-530472390 286391147
12273745 -839888853
-530472390 468449806
12273745 27131915
12273745 144818527
-530472390 -97939838
-530472390 -221056215
-530472390 -238960974
-53047...

output:

100000
102201 13127
125438 86635
90603 153736
102740 4047
114779 81909
106490 173511
13841 10547
178815 106909
37225 149478
96977 76769
149227 23608
142797 9377
6615 78600
21162 8680
170615 92469
117213 180448
58561 32180
51301 178827
106799 2874
63702 24199
191794 181432
73072 89443
160346 123771
1...

result:

ok ok (1 test case)

Test #80:

score: 0
Accepted
time: 132ms
memory: 27872kb

input:

1
100000
-132158759 -454759942
-893626513 149724597
-756161772 -22802718
579977604 -454759942
430467545 149724597
363069127 -454759942
-355589432 -488155881
348983244 149724597
253076693 -258440137
391935158 862260872
211993426 -258440137
928069632 862260872
403296863 -22802718
-302606363 -258440137...

output:

100000
3 57840
4 9881
11 179121
16 115586
19 66946
20 84802
22 187458
26 108368
29 105143
30 7198
31 23326
35 66328
37 51485
40 75969
44 18964
64 130953
73 69346
74 1194
80 61404
82 109421
85 2121
86 180496
88 166447
92 656
93 180593
102 65655
104 147239
106 92773
110 80040
111 138413
112 86666
116 ...

result:

ok ok (1 test case)

Test #81:

score: 0
Accepted
time: 118ms
memory: 19948kb

input:

1
100000
3959073 -767392567
109384252 941067269
-878847334 -620223817
607693789 483382967
998749160 43543215
259351742 -658880496
817766616 491476307
265921619 920072631
-95644194 43543215
-145143632 -356499617
-708593795 -254752752
292642145 865122144
-525142707 -376455870
653151805 -418942337
1803...

output:

100000
1 79951
3 596
20 139227
37 80730
47 98390
87 39324
90 169391
122 42590
131 132949
133 129426
141 184072
152 88314
153 108677
201 2252
215 162386
241 191558
253 99879
256 194542
268 94627
287 30486
295 16902
302 138323
342 39694
345 157749
354 50755
362 142439
369 162886
396 76255
400 105609
4...

result:

ok ok (1 test case)

Test #82:

score: 0
Accepted
time: 125ms
memory: 20880kb

input:

1
100000
-574560244 663989471
147836313 776509735
-654179276 -456564123
-688242213 850544277
-769192009 -999278429
47264577 -474897694
661553314 -35586919
31425538 950985408
119252682 -364980087
-482879014 -842019980
562833870 -434563528
-602373511 -586582786
-597688232 794041526
-796369392 -9877200...

output:

0
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61 62
63 64
65 66
67 68
69 70
71 72
73 74
75 76
77 78
79 80
81 82
83 84
85 86
87 88
89 90
91 92
93 94
95 96
97 98
99 100
101 10...

result:

ok ok (1 test case)

Test #83:

score: 0
Accepted
time: 119ms
memory: 21400kb

input:

1
100000
563809006 598960902
129945828 823924799
-921279427 -278305161
932151061 -615426941
253018906 394552155
-685768166 660779890
443266995 -129270185
314826112 -262631640
503785849 280786037
964401164 -60690178
-543715115 692212503
570497299 -501483747
-280889633 566370668
238345598 -30723398
40...

output:

10
4978 9022
22217 170163
38276 80047
75329 111455
171004 178064
176400 75494
42034 139377
9293 19963
27877 36282
77458 175690
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
61...

result:

ok ok (1 test case)

Test #84:

score: 0
Accepted
time: 113ms
memory: 21376kb

input:

1
100000
-250360297 -826731365
-132998833 434577984
-271597239 443621731
-568418163 -685113319
-351376307 -75720590
361691254 909826155
-611075026 748106801
-796334684 588036703
-192353104 -22634313
219167808 -130214795
153254126 -663910409
-706144293 -503074450
641195348 -471304455
952972496 722756...

output:

100
4539 167894
6708 158715
12117 21347
20462 46517
20480 139230
20539 131418
21520 47919
22459 89821
22772 178967
23346 57150
24606 181553
24631 170166
29784 94158
29789 148802
34980 69834
36895 40201
36982 162322
37269 157281
40657 109694
41511 153583
41875 72738
44392 116970
48588 194558
51532 97...

result:

ok ok (1 test case)

Test #85:

score: 0
Accepted
time: 121ms
memory: 22948kb

input:

1
100000
847984927 -235516053
-225657532 174062262
-864702235 849255554
-294101500 -395862766
308093550 262724017
-821802819 777396740
-166183219 -205295668
-925592163 -890396698
629939776 554098977
-597066517 -627025783
-488670566 -192742453
321766317 357807409
-56687363 -479719304
-346692362 43123...

output:

1000
34 150543
38 55353
50 162823
274 61467
684 86777
842 183825
909 98052
987 42986
2615 125774
2664 8636
2756 130348
2901 147978
2962 36081
3044 47212
3232 96864
3249 168640
3454 120574
4227 19250
4258 119691
4265 139389
4605 127431
5491 29803
5788 89563
5795 24639
5903 8383
5941 27779
6165 104512...

result:

ok ok (1 test case)

Test #86:

score: 0
Accepted
time: 120ms
memory: 26080kb

input:

1
100000
326229520 805825077
371787034 -612906440
-488264751 -793472428
184436425 366708550
-501110960 713157720
810357640 -567097567
-906732603 439225325
-340392868 -70415813
-189664219 -713969208
381067874 -619756834
674460096 668727994
618268128 -733873663
-622488527 -374494000
-696690105 -871302...

output:

10000
3 104311
34 7287
64 62276
71 173485
90 69439
198 167825
212 59362
224 174525
226 91016
229 144991
233 32183
273 56301
370 76336
375 139749
382 36216
387 46965
399 132524
409 168517
413 29127
426 145842
428 14213
434 183057
498 3905
500 109431
549 74114
577 56137
603 19775
609 168768
628 119597...

result:

ok ok (1 test case)

Test #87:

score: 0
Accepted
time: 104ms
memory: 34288kb

input:

1
100000
107663449 169602795
-293408075 136298377
107663449 677735329
107663449 -133164493
107663449 -405477830
-973012232 136298377
40661124 136298377
107663449 -772028365
314648168 136298377
-951394425 136298377
107663449 252358019
107663449 84643404
107663449 661318647
-458027461 136298377
107663...

output:

99999
2 70835
6 128249
7 110150
9 196676
10 143785
14 115967
17 196926
18 95145
22 171494
25 31655
26 45456
27 134709
28 85294
30 53179
31 70595
32 133088
34 41067
37 104166
38 175476
40 162496
41 152567
44 176714
45 46162
47 85632
51 1019
52 189553
54 196950
56 189025
59 180354
60 168620
62 29633
6...

result:

ok ok (1 test case)

Test #88:

score: 0
Accepted
time: 108ms
memory: 49020kb

input:

1
100000
621676756 -105718828
907764147 -105718828
-558728021 -105718828
-945909098 -105718828
-602870402 -105718828
104020243 -105718828
-283225325 -105718828
-188159226 -105718828
-15757119 -105718828
12299950 -105718828
382647230 -105718828
961198249 -105718828
142879463 -105718828
677630999 -105...

output:

100000
1 180801
2 144202
3 149142
4 131903
5 145543
6 74311
7 188150
8 113168
9 167109
10 48771
11 79191
12 66310
13 138244
14 70292
15 48020
16 163536
17 172114
18 173227
19 189449
20 41755
21 154113
22 185674
23 153399
24 91117
25 8328
26 45355
27 8015
28 104579
29 58275
30 169787
31 164722
32 148...

result:

ok ok (1 test case)

Test #89:

score: 0
Accepted
time: 123ms
memory: 50520kb

input:

1
100000
791929316 -452812205
-414545951 -452812205
-492402719 -452812205
-350798285 -452812205
308143137 -452812205
-270019539 -452812205
-837044713 -452812205
-855873836 -452812205
299134701 -452812205
-928378050 -452812205
949766412 -452812205
983552624 -452812205
-302417116 -452812205
-575137906...

output:

100000
1 73360
2 8931
3 103385
4 173279
5 8838
6 86318
7 161376
8 35180
9 199078
10 171293
11 99508
12 141886
13 59497
14 49662
15 29055
16 105187
17 165448
18 131486
19 20375
20 114936
21 77608
22 9367
23 27125
24 139983
25 75391
26 181994
27 171008
28 100300
29 66976
30 182347
31 36288
32 59713
33...

result:

ok ok (1 test case)

Test #90:

score: 0
Accepted
time: 120ms
memory: 50472kb

input:

1
100000
-389700968 -854866948
157177186 -854866948
389548526 -854866948
359801591 -854866948
-404781586 -854866948
-756263865 -854866948
-874320830 -854866948
-860738544 -854866948
-494835614 -854866948
135417793 -854866948
878395153 -854866948
416627219 -854866948
50576116 -854866948
-877491066 -8...

output:

99999
1 118611
2 94065
3 132087
4 95547
5 23569
6 14631
7 128506
8 7926
9 119685
10 149386
11 49755
12 131083
13 141117
14 36909
15 61407
16 22642
17 28907
18 59086
19 62052
20 99806
21 190248
22 28452
23 62778
24 138188
25 13811
26 120777
27 38037
28 76957
29 72994
30 34031
31 77507
32 1591
33 1831...

result:

ok ok (1 test case)

Test #91:

score: 0
Accepted
time: 102ms
memory: 50428kb

input:

1
100000
-863878388 -228877853
556347609 -228877853
715519933 -228877853
-685414679 -228877853
121136094 -228877853
835184421 -228877853
2884225 -228877853
-632661834 -228877853
-376071163 -228877853
561924123 -228877853
104284355 -228877853
-832791265 -228877853
219285074 -228877853
-532813184 -228...

output:

100000
1 183982
2 61224
3 91825
4 133226
5 193010
6 38758
7 54792
8 93637
9 14719
10 1241
11 199760
12 69946
13 46661
14 98319
15 190989
16 179195
17 183117
18 90882
19 129008
20 42289
21 144679
22 153478
23 43006
24 148135
25 114282
26 73897
27 39699
28 49487
29 80464
30 111595
31 94761
32 186423
3...

result:

ok ok (1 test case)

Test #92:

score: 0
Accepted
time: 119ms
memory: 50444kb

input:

1
100000
59979025 770483795
-687037673 770483795
-606503145 770483795
74265013 770483795
535504783 770483795
-353324202 770483795
-742185632 770483795
-880778420 770483795
445635005 770483795
-637158728 770483795
-798486264 770483795
-969460603 770483795
-183267551 770483795
219412933 770483795
4516...

output:

99999
1 75549
2 140884
3 179550
4 14901
5 167178
6 5388
7 199371
8 55541
9 103864
10 92996
11 73876
12 112084
13 95914
14 71281
15 11304
16 6851
17 145295
18 146160
19 24055
20 21432
21 62021
22 48424
23 176299
24 116167
25 38180
26 47698
27 142625
28 65418
29 180670
30 40895
31 113849
32 178730
33 ...

result:

ok ok (1 test case)

Test #93:

score: 0
Accepted
time: 107ms
memory: 50400kb

input:

1
100000
-238717794 -675789740
892502036 -675789740
927735589 -675789740
265425600 -675789740
713089930 -675789740
975285688 -675789740
994425171 -675789740
377011822 -675789740
-469725428 -675789740
240456322 -675789740
-696780335 -675789740
13943625 -675789740
-105628955 -675789740
500932288 -6757...

output:

99999
1 54029
2 33378
3 33470
4 137637
5 157699
6 185015
7 85215
8 18702
9 111857
10 22871
11 154648
12 3882
13 50637
14 79493
15 183066
16 152644
17 111408
18 101959
19 1422
20 199734
21 140361
22 99796
23 158713
24 36260
25 49099
26 3711
27 8766
28 54715
29 182063
30 90749
31 79741
32 172800
33 49...

result:

ok ok (1 test case)

Test #94:

score: 0
Accepted
time: 120ms
memory: 50368kb

input:

1
100000
-721839075 207317220
198969479 207317220
721075181 207317220
816055383 207317220
129129955 207317220
578715168 207317220
938570372 207317220
-111023272 207317220
704310574 207317220
-29012555 207317220
-1124535 207317220
565642912 207317220
-164326927 207317220
269985061 207317220
-85992111...

output:

100000
1 7602
2 20920
3 29719
4 48604
5 842
6 145804
7 56248
8 171490
9 142814
10 101496
11 58621
12 154742
13 51171
14 30646
15 51952
16 59879
17 141304
18 161752
19 162957
20 6177
21 69066
22 149109
23 186827
24 69923
25 63837
26 29146
27 61565
28 90493
29 37225
30 89232
31 120340
32 23273
33 1147...

result:

ok ok (1 test case)

Test #95:

score: 0
Accepted
time: 117ms
memory: 49320kb

input:

1
100000
-394106502 -349602555
-214790523 -349602555
-773354523 -349602555
282532628 -349602555
908276613 -349602555
90866698 -349602555
547592286 -349602555
-771664838 -349602555
-459895994 -349602555
545210801 -349602555
348330065 -349602555
69245707 -349602555
-70850421 -349602555
-570400234 -349...

output:

96000
1 194574
2 166716
3 187950
4 121501
5 186332
6 109645
7 32589
8 118602
9 167937
10 92413
11 65508
12 131728
13 163499
14 64381
15 121288
16 92375
17 89140
18 32187
19 173750
20 31337
21 157234
22 198602
23 60479
24 105827
25 158297
28 2439
29 100316
30 41136
31 186967
32 42631
33 185006
34 156...

result:

ok ok (1 test case)

Test #96:

score: 0
Accepted
time: 100ms
memory: 19004kb

input:

1
100000
-212599148 -631411742
-212599148 -756608454
-212599148 -380727055
-212599148 -483620464
-212599148 -806607419
-212599148 464110295
-212599148 100221705
-212599148 426302083
-212599148 -770781036
-212599148 238123749
-212599148 652260340
-212599148 7400105
-212599148 -114015691
-212599148 26...

output:

100000
12296 161719
104908 151518
148853 146511
151543 120898
138665 96685
141246 117368
141429 103256
70908 34532
137290 90431
17082 132996
11608 6064
74664 75645
154790 181233
73181 87685
70051 182008
11724 54039
92993 95538
133085 113945
21264 8228
29933 174630
129882 24039
33381 192189
82253 977...

result:

ok ok (1 test case)

Test #97:

score: 0
Accepted
time: 92ms
memory: 18936kb

input:

1
100000
861172394 -290759846
861172394 752238765
861172394 -567950860
861172394 998044325
861172394 315984459
861172394 -627793707
861172394 -220676787
861172394 -268949003
861172394 -808244877
861172394 203040434
861172394 221600196
861172394 -142395895
861172394 723984474
861172394 25261585
86117...

output:

100000
54343 87229
84791 126664
86262 139812
90408 151822
168245 199641
2788 178318
114019 144782
52330 114790
144876 88980
155796 189810
101857 171251
65245 77178
133533 19637
103992 170569
36352 18075
5848 26672
132688 54259
159699 38349
38629 54381
4592 41632
162633 171088
135009 49392
199514 127...

result:

ok ok (1 test case)

Test #98:

score: 0
Accepted
time: 100ms
memory: 33136kb

input:

1
100000
499304870 -456067706
499304870 -526478356
499304870 -698177941
962157497 -209895866
499304870 603709976
194809397 -209895866
499304870 -622241129
295675965 -209895866
798750809 -209895866
499304870 -379083513
499304870 -835042147
499304870 -239680418
69233437 -209895866
-139695003 -20989586...

output:

92291
4 25638
6 157861
8 177825
9 66333
13 35880
14 101449
17 3679
19 117093
20 37824
22 20694
26 2458
28 156398
29 111609
31 56296
34 199629
41 19277
43 77877
45 136251
47 170845
49 162034
51 27119
53 54620
54 118496
56 7914
57 47951
58 165904
62 153385
63 28558
65 86229
69 195632
71 39160
72 72469...

result:

ok ok (1 test case)

Test #99:

score: 0
Accepted
time: 114ms
memory: 31428kb

input:

1
100000
-858246250 615044192
-266041885 988276483
482718956 -318377373
-764628559 -906181651
-858246250 -473264095
142558228 706800755
-788262537 988276483
22746060 640859154
-990386331 988276483
-69851564 988276483
-858246250 85218196
218467508 988276483
-858246250 859181857
687573233 988276483
-4...

output:

67291
2 28044
7 147182
9 4672
10 181665
12 135717
14 56379
15 15660
19 133359
21 125930
23 183780
24 127633
32 21697
33 12003
35 54891
43 161634
51 120625
53 64120
56 107074
59 46393
61 15599
67 7749
72 183004
73 57897
82 188242
83 124542
84 39129
85 128346
90 92395
92 54675
95 55750
97 97694
98 160...

result:

ok ok (1 test case)

Test #100:

score: 0
Accepted
time: 120ms
memory: 24536kb

input:

1
100000
-150551753 452254502
-589126107 -154864988
-774655110 -258862906
419458744 436149924
832748324 626049996
-150551753 -842016341
50222854 48805382
-533365798 510362787
417401571 -205386056
567574644 -154864988
-813149443 794441936
-299793018 -154864988
770796798 807259574
-150551753 345399056...

output:

32291
2 178747
10 144022
12 197907
28 172213
32 82446
50 71904
78 146131
91 165531
102 24523
103 44256
133 21318
152 121853
174 51128
189 167771
204 44789
212 35506
239 37223
259 36515
294 39398
297 183219
299 110810
332 44700
347 15281
362 190859
368 42817
441 151335
450 53810
472 98462
479 51801
4...

result:

ok ok (1 test case)

Test #101:

score: 0
Accepted
time: 129ms
memory: 26428kb

input:

1
100000
285908168 272049532
-886964145 -569780386
510905036 729082089
-980711479 -610409392
-374956972 -629812402
247564824 -494813970
-424829969 808435687
-596358126 293552786
-231573518 593358144
-206584506 -197027197
788863793 -320825254
-80636341 343699149
865833827 -126707889
-264031756 -99178...

output:

5111
20 132214
25 129559
31 155263
118 114074
147 122747
148 60889
153 106647
174 104997
215 178071
217 56968
241 101398
252 5743
286 82713
331 198673
398 58282
408 198880
445 81006
533 184789
536 38047
567 182337
594 45275
606 47030
629 144372
652 78406
656 136311
674 95869
707 138995
739 66588
741...

result:

ok ok (1 test case)

Test #102:

score: 0
Accepted
time: 125ms
memory: 21044kb

input:

1
100000
565553778 -960078095
363313784 637330036
813479302 196734774
-774652802 -191779344
-980564833 -172476596
97721308 -222616457
-585108481 -816071325
384348686 -771714186
399507870 923194801
775022324 -521366927
112774804 -456550819
596715515 -351906433
-733278086 945383835
-295767823 82342179...

output:

20
7087 151683
17587 62896
28985 149668
37956 49656
38908 47471
56684 183908
85752 154987
105384 121584
129376 174549
163883 177089
121095 97944
172056 18784
174877 123206
145455 159601
77333 75404
19683 28427
185622 129239
185310 12330
117515 4722
180069 18839
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16...

result:

ok ok (1 test case)

Test #103:

score: 0
Accepted
time: 128ms
memory: 21160kb

input:

1
100000
832414397 -191973279
799697814 453822080
472902980 355661811
773889737 -237095042
139066161 -168030962
-200818308 -659210292
591819947 -690219588
-894723232 -724129935
309100621 -442280293
601783531 -629714403
-518284237 -502069854
-324318938 -999351826
-445350259 -776355044
579496048 -3535...

output:

200
62 120334
408 107131
1672 10805
3957 111740
4356 198863
5907 27524
6078 160632
7634 96142
7750 135548
7910 31667
8941 108407
8954 199811
9159 111121
9455 85772
10044 42818
11425 26880
13122 28758
13705 83412
15880 169604
16111 65541
16439 116201
17509 85913
18411 119561
20105 121793
20757 180952...

result:

ok ok (1 test case)

Test #104:

score: 0
Accepted
time: 115ms
memory: 24104kb

input:

1
100000
316081038 264919400
418308983 754756042
-672507100 -504831259
347176006 -475455422
-464074155 250593938
-689733050 -558992193
165084421 594791692
756992395 93538486
601928596 425487522
-948968175 -775787311
642279460 -97489081
949706854 134386823
-573515957 -691035427
686110259 935429550
-3...

output:

1984
47 198696
271 160770
653 141666
911 104669
958 55216
1067 80652
1160 197110
1188 165710
1443 155247
1474 2905
1505 170750
1510 23397
1827 134448
1850 136796
1878 30217
2039 9385
2157 151604
2273 192962
2286 155313
2309 167218
2355 174807
2380 109326
2439 87469
2720 140380
2760 166208
2765 13973...

result:

ok ok (1 test case)

Test #105:

score: 0
Accepted
time: 126ms
memory: 24728kb

input:

1
100000
889766050 -900215668
-785435069 932780511
-593598392 -319579936
-819907899 -897600509
-163102947 369765636
-287328155 456835725
-903811491 57154208
-354611840 883364613
475188396 746218920
-813614969 540734211
824473110 591677255
-509397296 458247192
468251135 -745120799
508553265 422069900...

output:

18252
20 156421
25 167850
42 72556
57 19675
60 61473
90 129215
103 134439
108 8810
110 197917
126 19309
128 89656
136 104010
142 78486
188 195872
196 146310
198 105039
214 88291
216 54977
218 127429
220 21534
222 199738
235 96213
247 151685
260 744
266 158539
298 141256
304 27588
317 36770
321 41745...

result:

ok ok (1 test case)

Test #106:

score: 0
Accepted
time: 157ms
memory: 30140kb

input:

1
100000
569138929 623081181
595176935 -231729559
-353366942 -403863070
910926966 869119211
394470687 778639413
603585935 114468456
-834453070 52891615
988978359 457907555
-126372552 606236966
-965264313 -667974370
933978631 902269405
-462709387 -210009622
715607853 -386237572
-671683002 152885468
4...

output:

99999
1 144904
6 73264
7 164254
8 169463
10 187823
11 194825
15 178149
23 3258
24 103120
25 157525
26 74687
29 89783
30 85496
33 162015
34 153420
37 101383
38 41618
40 96229
41 163004
42 95186
43 43763
44 37559
50 90863
51 87202
52 163053
53 154224
58 186070
59 74904
60 152485
63 149705
64 81884
65 ...

result:

ok ok (1 test case)

Test #107:

score: 0
Accepted
time: 181ms
memory: 37524kb

input:

1
100000
-545580238 206875231
-334278490 284778314
-577688466 532471873
-696161358 -260770669
-543552171 609399466
-248845812 281374889
604662925 947696452
815211151 -792551232
-726993196 -873648831
-806959352 -523234454
451106708 -525149528
196005170 210990094
7637155 927805109
-471891793 91423437
...

output:

100000
1 109225
3 86506
4 189400
5 82282
7 148358
8 75970
9 169048
10 159219
11 86312
12 197316
13 161607
14 161425
15 90459
16 43471
17 145912
18 150726
19 189601
20 102784
21 112754
22 47826
23 98213
24 15850
25 192296
26 92570
27 166087
28 120695
29 192359
30 130818
31 178645
32 180845
33 56824
3...

result:

ok ok (1 test case)

Test #108:

score: 0
Accepted
time: 122ms
memory: 50612kb

input:

1
100000
289524496 -156648931
477259193 -156648931
-940874730 -156648931
-678074509 -156648931
430778344 -156648931
314792323 -156648931
590595199 -156648931
336769789 -156648931
-952491382 -156648931
569800304 -156648931
-334619798 -156648931
745977166 -156648931
-939318247 -156648931
313727017 -15...

output:

100000
1 47087
2 67935
3 143473
4 8863
5 13521
6 78159
7 96469
8 113346
9 159083
10 122037
11 130095
12 3702
13 197274
14 126862
15 123298
16 69958
17 31726
18 59536
19 129029
20 68916
21 109739
22 85398
23 147777
24 148019
25 94407
26 7187
27 63548
28 69396
29 180251
30 136280
31 161501
32 44465
33...

result:

ok ok (1 test case)

Test #109:

score: 0
Accepted
time: 118ms
memory: 48640kb

input:

1
100000
551608067 365421420
-487728687 365421420
143644232 365421420
-351527721 365421420
-871435010 958574747
437117589 365421420
79082823 365421420
-932527349 365421420
-51983999 365421420
-981644356 365421420
27516634 365421420
122232864 365421420
-586305842 958574747
-186314882 365421420
-77505...

output:

100000
1 175302
2 94331
3 107080
4 12176
5 194052
6 99112
7 120619
8 178098
9 198015
10 190919
11 23288
12 190604
13 46231
14 158792
15 85011
16 27877
17 58559
18 67259
19 4922
20 146442
21 90497
22 133501
23 169066
24 181344
25 98319
26 150390
27 3944
28 38203
29 34113
30 60417
31 25101
32 167949
3...

result:

ok ok (1 test case)

Test #110:

score: 0
Accepted
time: 124ms
memory: 43688kb

input:

1
100000
973177252 740095208
603591199 740095208
912041445 740095208
-879893070 740095208
513021608 740095208
-296817755 397134181
-920132372 740095208
874286779 740095208
-697477339 740095208
675338682 740095208
-688816419 397134181
274927171 397134181
-966544303 740095208
-168526049 740095208
7376...

output:

100000
1 76220
2 35140
3 158062
4 116258
5 31221
6 49986
7 66370
8 44757
9 157146
10 178546
11 153853
12 75751
13 144230
14 155956
15 51239
16 168000
17 101235
18 51265
19 48541
20 7560
21 71512
22 93893
23 75070
24 149236
25 65650
26 184956
27 44485
28 143063
29 110022
30 38687
31 100288
32 31478
3...

result:

ok ok (1 test case)

Test #111:

score: 0
Accepted
time: 122ms
memory: 41312kb

input:

1
100000
801543585 -255560886
-749926618 -255560886
-127843709 -255560886
845588435 -737531782
988339842 -737531782
-626861162 -255560886
918453589 -255560886
749726781 -737531782
-581771893 -386009779
590486060 -386009779
734676998 -737531782
153171830 -737531782
845030651 -737531782
-915274358 -25...

output:

99999
1 77559
2 63513
3 121956
4 56868
5 194362
6 1124
7 196818
8 149610
9 159388
10 20033
11 77257
12 151917
13 3761
14 192236
15 89964
16 10729
17 42708
18 21326
19 199346
20 177538
21 185493
22 143704
23 97577
24 57566
25 136112
26 179546
27 139326
28 109413
29 96456
30 181177
31 30284
32 75223
3...

result:

ok ok (1 test case)

Test #112:

score: 0
Accepted
time: 124ms
memory: 45808kb

input:

1
100000
946325199 -654997315
-893568018 -134419061
729992347 -654997315
759203364 -134419061
931585734 -654997315
813067224 -654997315
-219515258 -654997315
942523112 -654997315
93044508 -654997315
112202638 -654997315
887362429 -654997315
-895695158 -654997315
122895052 -334072657
-236406425 -3340...

output:

99999
1 185838
2 196240
3 95455
4 63556
5 177639
6 86602
7 86574
8 60159
9 25475
10 23567
11 85253
12 137315
13 52844
14 199357
15 35864
16 53995
17 150071
18 116234
19 125838
20 72336
21 105399
22 54724
23 174596
24 19342
25 100404
26 38218
27 59536
28 39825
29 109919
30 116591
31 187468
32 124150
...

result:

ok ok (1 test case)

Test #113:

score: 0
Accepted
time: 111ms
memory: 43964kb

input:

1
100000
-286313978 229324447
783769798 -259261199
203372724 229324447
903846546 -259261199
-62506027 229324447
-878593732 -259261199
-24614745 229324447
-681646734 -259261199
30846373 229324447
516134098 -259261199
383203441 229324447
-416474256 -259261199
-293604347 -259261199
-122611506 -25926119...

output:

100000
1 174832
2 190271
3 57732
4 193308
5 35424
6 46533
7 142655
8 49709
9 90263
10 116141
11 2544
12 113328
13 121003
14 164467
15 77433
16 116387
17 153258
18 6085
19 125328
20 26978
21 192254
22 178570
23 187121
24 127419
25 191371
26 140695
27 97288
28 15610
29 111310
30 82658
31 32875
32 1411...

result:

ok ok (1 test case)

Test #114:

score: 0
Accepted
time: 162ms
memory: 34392kb

input:

1
100000
-683388360 919019809
-859428325 -677839811
998213859 512472227
893351203 -331849691
-812365568 378975580
-361448436 -768680818
-498101610 -891785673
-48853924 827302039
-977322158 911487244
630622919 -47675260
464560219 -996571204
781514945 47367981
-641893570 460320130
-716591231 -24159771...

output:

97961
1 61959
2 146310
3 132848
4 183299
5 55910
6 94636
7 8009
8 136661
9 112331
10 136440
11 124040
12 103881
13 148345
14 131223
15 182646
16 177180
17 10199
19 101947
20 45784
21 24401
22 5758
23 105631
24 72574
25 81126
26 64412
27 58832
28 153228
29 88447
30 149210
31 154482
32 25332
33 66549
...

result:

ok ok (1 test case)

Test #115:

score: 0
Accepted
time: 97ms
memory: 19404kb

input:

1
100000
965071155 961909473
965071155 116193246
965071155 -398741995
965071155 -46836400
965071155 107811853
965071155 472916725
965071155 -801103891
965071155 -429946712
965071155 779079739
965071155 -339584185
965071155 -117199737
965071155 -34574080
965071155 940172004
965071155 859809257
965071...

output:

100000
103206 104213
12750 190055
123341 75969
110997 90359
105525 3266
79725 35866
217 144407
88615 129690
102647 169732
108418 185111
155561 21759
186691 112983
120955 46191
137752 100719
140182 143108
10055 117271
91454 71848
151454 51382
176940 12872
188804 104644
104357 85334
84255 86973
155530...

result:

ok ok (1 test case)

Test #116:

score: 0
Accepted
time: 110ms
memory: 16060kb

input:

1
100000
-108646393 572873810
760590825 -20548996
-817355882 -691664274
-652085034 966416413
760590825 -791160497
-684709037 441553262
691698692 281355233
-899208930 128349406
-344513662 428545673
-108646393 7920617
760590825 -153682268
760590825 -5134307
-899208930 891399973
975722593 224997612
760...

output:

100000
13099 79510
50938 88686
66578 149027
70206 151394
71470 199762
104510 127635
74995 66544
24491 132510
46841 39144
103659 186101
117653 170978
94278 64241
141092 167069
178173 50492
166979 105812
127896 192737
29898 194788
163936 96106
180978 86245
23012 119836
137023 121329
19102 176582
59901...

result:

ok ok (1 test case)

Test #117:

score: 0
Accepted
time: 152ms
memory: 25956kb

input:

1
100000
657771764 499917223
340860304 -894365154
-166481907 95140359
263475661 -453431393
-421208726 -214095000
880473397 -932916417
-75750425 259300793
-605153080 -141604420
562225805 7170053
-611074444 -745330023
834249871 -314820890
608021155 -709004755
-214410370 -48571110
643218522 497384980
3...

output:

96041
1 118345
3 112837
5 14567
6 55167
7 169627
8 45776
9 64328
10 57562
11 163468
12 44732
13 25060
18 141863
19 141954
22 29797
23 22976
25 116290
26 176455
27 76283
28 185289
29 163175
30 184302
31 108428
32 134656
34 18036
35 8002
38 96688
41 193575
42 67853
44 154399
47 125810
48 120855
53 296...

result:

ok ok (1 test case)

Test #118:

score: 0
Accepted
time: 135ms
memory: 25512kb

input:

1
100000
-367654468 -952563688
285936870 592116431
-274071733 455847465
-171624585 354239799
349408391 -485168327
767563471 234441392
-528077539 -342651670
502696003 -903892090
-229679854 -452018526
-553390072 218410940
632717195 56077406
588095737 -173132122
-618084086 465397930
931640280 533044102...

output:

80396
1 38627
2 188742
5 84324
6 181472
8 25035
11 142066
12 114893
14 28103
16 198390
17 48539
19 197447
22 14342
23 45904
24 26407
31 45354
34 134443
40 148707
43 187139
44 132048
45 132253
47 144509
48 99538
50 114145
51 108337
56 25573
61 70322
69 185851
74 55021
75 128900
78 36493
79 64471
83 9...

result:

ok ok (1 test case)

Test #119:

score: 0
Accepted
time: 130ms
memory: 22480kb

input:

1
100000
-906200254 -265351581
-61657317 -473114865
952191838 -484210630
-968862768 -688100917
-946086398 207717766
96200317 881558228
645408728 -29904463
-65219541 512094883
-105610142 -944887267
232013995 -248237040
571558060 -90454204
-56844375 -803257756
703491466 211175053
910638201 896424741
-...

output:

48783
2 155438
4 147062
12 110004
13 132578
18 6750
24 107876
41 43454
42 45691
51 59131
64 93966
65 177732
110 150233
135 25095
139 51468
153 7238
192 8303
208 106739
217 64597
228 113861
229 90970
245 42341
249 109535
256 36974
293 44950
298 28778
309 176879
350 150269
358 39839
364 12037
419 1604...

result:

ok ok (1 test case)

Test #120:

score: 0
Accepted
time: 130ms
memory: 25276kb

input:

1
100000
766382075 -21012642
-128826313 -161927840
507846892 -465151202
-122637205 252503287
673961711 322092096
472140704 525292475
-591417285 438455480
-659982761 -855470959
781169250 -760438229
-230659843 -352619932
64397555 -344061705
249444096 -515285207
-966136666 474387926
836585434 673332290...

output:

9778
1 169121
26 149641
30 197481
50 40058
75 154841
85 10529
106 39544
119 176548
128 42029
139 192110
151 77955
163 49716
172 109527
175 98156
177 179190
192 1779
204 199544
211 3689
225 73653
258 56260
281 7073
294 138207
300 89046
314 81915
333 106420
338 101152
342 56368
356 14209
361 44610
364...

result:

ok ok (1 test case)

Test #121:

score: 0
Accepted
time: 160ms
memory: 29296kb

input:

1
100000
-391309465 574501656
-601163643 398769165
437998755 -432176181
-504670744 400573721
363523163 -727677520
-810716783 387537161
-171290820 222526143
-710458455 -569456596
-546226838 -832409181
531132193 824799149
-523158870 -960204834
907379792 -31354498
-659185380 651124824
-917386965 958360...

output:

100000
4 188369
6 69073
7 122471
8 20393
9 137624
10 126621
12 167930
18 186902
22 149857
23 176769
25 47481
26 113296
28 137293
31 25130
33 139221
35 8941
36 14774
37 149534
39 48793
40 182526
42 190479
50 185085
51 173836
52 36605
53 25518
55 41366
56 153845
60 143259
61 73191
62 55422
65 114504
6...

result:

ok ok (1 test case)

Test #122:

score: 0
Accepted
time: 151ms
memory: 30952kb

input:

1
100000
-570308074 564028419
41974764 951482748
-458707143 821043169
792070901 519849419
-897928950 732129807
-377209691 238697917
846996677 789967440
92894202 -75895048
674835179 -287863905
818656679 -759156926
-929937983 329230903
52584650 -174966413
-245982588 55776587
619716488 -142539574
-3331...

output:

100000
1 27401
2 128200
7 116224
9 184744
12 93055
13 70431
15 119209
16 77873
18 169279
19 197139
20 170938
21 35421
26 55377
27 71111
36 127446
38 103555
41 151262
43 117352
44 88719
45 68964
47 100633
49 171379
50 27290
51 6186
52 185179
55 45304
56 187956
57 96447
58 146003
59 54953
61 174003
63...

result:

ok ok (1 test case)

Test #123:

score: 0
Accepted
time: 159ms
memory: 28036kb

input:

1
100000
-870867990 -427477336
377455239 817489100
878782331 -17678742
638141193 -507332664
760969286 -686215018
680187812 -958635909
650765571 -244064336
-162743943 -197718056
-803668177 -612150607
245627960 16037985
-301270470 -415814129
-725795982 901008722
-795739083 25301151
-690989959 99318401...

output:

100000
3 192809
4 31662
6 122816
12 169980
13 169653
15 36321
17 32131
18 84408
20 38993
21 53862
22 128782
24 117074
25 27731
26 192657
27 186038
29 58404
30 84960
32 101634
34 159437
35 152698
36 102950
39 117643
41 90060
45 156883
49 13314
51 159928
53 59352
54 133428
55 178114
59 63674
61 47227
...

result:

ok ok (1 test case)

Test #124:

score: 0
Accepted
time: 157ms
memory: 28052kb

input:

1
100000
-539465148 -845708233
41183593 -459286909
-334098911 241729240
-391831038 -16693053
973020777 536265241
556557281 -789431898
52149811 -685715732
-792343215 686258394
464507471 -40092028
-870155969 590469644
465578389 -589697394
-161523675 -991602821
855948608 265525154
-839351205 -62602192
...

output:

100000
1 82865
2 35794
4 94116
6 167088
7 43828
8 11549
11 90521
16 146254
17 24499
18 76793
19 101078
22 118769
23 60338
28 4134
29 176408
31 93324
34 117228
35 33106
36 25907
41 3383
44 101475
45 147300
46 97544
47 137198
50 1416
51 134327
53 153021
55 29768
57 171637
58 152366
66 70058
68 66074
7...

result:

ok ok (1 test case)

Test #125:

score: 0
Accepted
time: 156ms
memory: 28176kb

input:

1
100000
-301707541 -107785349
651696377 527237688
-311820441 -207092527
-214569234 -975358436
701909387 -785968490
-711653988 396775134
320035803 -913625682
593258459 -175337068
238164130 72714700
-539135317 -424645474
-205072058 507538329
-942822743 848584924
20017998 840987059
-272745279 -7423224...

output:

100000
1 163651
2 144763
3 47893
4 93494
5 121283
6 124706
7 97819
8 130525
10 106658
14 33853
16 13645
18 47063
19 84376
20 84068
21 53479
22 22410
23 101849
25 20526
29 94900
35 146568
39 116640
43 45403
44 3250
46 135448
47 160030
49 183808
50 129142
51 183549
52 65667
55 159656
58 22501
60 19548...

result:

ok ok (1 test case)

Test #126:

score: 0
Accepted
time: 168ms
memory: 28912kb

input:

1
100000
372101953 621089677
-107763756 -662571441
-63243920 659729647
441606222 -20964438
-861658828 -775998558
970349344 -718761240
-11091310 -651405801
723558495 57067049
-334677637 723258287
833883610 54943079
734085988 -274788427
668836759 -415187691
-227285405 23994731
212507360 -328156423
940...

output:

100000
1 33021
4 29629
5 141689
6 16067
8 103679
10 136552
14 133530
18 114254
19 150922
20 144830
21 59426
25 184686
29 43203
30 191496
33 74940
34 35901
35 93182
36 197772
37 185438
38 73014
39 46412
40 191988
42 20927
44 119976
45 4360
46 161340
47 147805
48 73368
51 49067
52 157665
53 109853
55 ...

result:

ok ok (1 test case)

Test #127:

score: 0
Accepted
time: 146ms
memory: 27256kb

input:

1
100000
-915867003 -471353976
-388104681 -614331870
712512068 -176609228
-249834836 -559087269
653127892 -445584953
754204027 962058868
-859865327 -430551978
-748113746 22447905
-53970847 230698214
488889725 -10963115
856013500 103474622
-985497526 -436330311
596095986 -945139677
35717532 -85633518...

output:

99946
2 65407
5 81889
8 25705
12 195099
16 129740
17 136111
19 137893
20 162241
22 125539
24 91509
26 30544
28 31626
31 95035
33 54143
34 101628
35 32297
38 76010
42 187095
44 98047
47 132146
48 51337
49 18564
50 1879
53 154387
59 50484
61 138152
62 57322
63 32584
64 34253
65 193661
68 113445
70 409...

result:

ok ok (1 test case)

Test #128:

score: 0
Accepted
time: 160ms
memory: 28076kb

input:

1
100000
-462294685 526220805
-608793181 78935812
-652123710 -88897518
-549445127 -950121976
404063639 -731462283
873109908 911227253
280108661 -384023678
-224512922 -527391217
-606653749 460705189
-795453552 954412985
557042734 419950356
71945893 766707128
975265143 857240778
678089771 850488211
86...

output:

100000
3 54399
7 196523
8 73117
11 175467
12 38013
15 32548
17 185122
19 152165
21 120811
22 178512
25 170227
27 141111
28 84668
29 149433
30 134635
33 128800
35 131264
36 56158
39 34855
40 195131
41 187786
42 95857
45 129802
46 59613
47 34061
49 149567
52 26789
53 183769
55 109047
57 25971
58 34734...

result:

ok ok (1 test case)

Test #129:

score: 0
Accepted
time: 144ms
memory: 27064kb

input:

1
100000
-217244737 -919036017
839515854 811349301
-529200839 -607492236
206068906 -756100661
-93942296 718088556
164065404 687609627
-335010106 575687136
-753768524 797665484
528969092 -675985219
-833864420 -976856005
-254998531 102163056
193138802 -109129538
-963610238 68206037
-505611099 66224247...

output:

100000
4 47464
10 120574
12 196860
14 46958
15 150947
16 94709
20 87433
24 27098
25 3865
27 61657
49 88640
50 151390
52 21893
53 183672
55 13893
56 8392
59 98952
60 69687
65 166486
69 39068
71 135591
73 43999
77 89124
80 67844
84 107649
86 56009
89 174298
90 89263
95 98259
96 31190
99 191637
103 672...

result:

ok ok (1 test case)

Test #130:

score: 0
Accepted
time: 141ms
memory: 26552kb

input:

1
100000
546952831 -551916540
-222366580 -190550190
690748205 621971537
-304787213 -426869636
430677306 737609007
-552529934 -587069496
534035388 -224937134
817092293 51151294
-603326277 963652497
675552100 -708035960
570918080 -54876116
-969756137 789057618
412261743 152512971
404319641 37207120
-1...

output:

95853
4 128988
7 1134
8 39146
9 166521
12 117976
16 159601
18 87355
21 165119
22 136459
29 14067
30 167734
31 28635
33 38831
35 140297
36 90403
37 176189
38 66868
39 128913
41 52680
43 41546
44 67453
46 195902
47 180143
49 8501
51 131088
53 10466
57 33431
61 81112
62 12722
63 179647
66 116482
67 181...

result:

ok ok (1 test case)

Test #131:

score: 0
Accepted
time: 126ms
memory: 20440kb

input:

1
100000
-718650142 -337515990
219225987 -796448041
945735467 769273424
-265106195 -836296134
286397419 -465897164
-217444051 -861702365
-142203839 354946276
962047833 625331802
-436237082 697041665
-210015414 251812388
-580562900 -862577184
468877853 314574614
-848683471 -115639376
358203437 674429...

output:

100000
2 100729
11 706
16 92493
31 26024
63 164787
69 64272
74 77554
204 112285
206 187351
258 150535
292 156889
319 9215
337 159699
345 113441
397 101627
418 104839
423 107298
433 77307
434 161056
445 62339
468 74884
481 129728
541 97447
643 33577
678 138943
696 157091
697 149346
790 89640
811 1840...

result:

ok ok (1 test case)

Test #132:

score: 0
Accepted
time: 131ms
memory: 24812kb

input:

1
100000
514065105 703173790
-898391374 199118883
-736313276 118966780
722733109 744001421
495427092 -308368925
-315318854 128815246
269153707 551867497
-795428350 -627563242
-221111684 -748945403
149671640 991495820
-169151249 -133790110
-552570804 601719573
-805801829 -857404452
-491986921 9945430...

output:

35570
7 189389
10 40152
12 14597
20 31607
22 10775
31 64730
42 153072
48 188986
49 128780
62 30263
66 51579
67 194013
75 46201
76 193657
79 104636
81 16755
88 195453
94 142418
95 144494
96 47356
97 198399
98 142594
100 22005
102 4814
107 28998
127 68711
128 119269
143 75710
144 68188
155 124304
158 ...

result:

ok ok (1 test case)

Test #133:

score: 0
Accepted
time: 104ms
memory: 33348kb

input:

1
100000
-352442278 -740018096
-88202974 -740018096
-738618658 -144110914
-738618658 -604922659
-738618658 -932820553
356311978 -740018096
578254098 -740018096
-738618658 -853474506
366314668 -740018096
-738618658 -328885215
-738618658 804967834
-738618658 -326990482
-675958519 -740018096
-943725244...

output:

100000
1 29367
2 146151
6 32965
7 90830
9 122258
13 130871
14 115447
17 187180
20 147839
21 15030
22 188464
23 31031
24 87375
26 169520
31 83352
33 113248
34 25134
37 73497
41 3615
43 96834
45 67626
47 171129
49 198003
51 114047
54 197888
55 65668
58 29957
60 130693
61 162119
62 162011
63 191443
66 ...

result:

ok ok (1 test case)

Test #134:

score: 0
Accepted
time: 107ms
memory: 30400kb

input:

1
100000
325122130 172466804
325122130 812054805
325122130 982296227
325122130 -588934091
325122130 -19140359
325122130 547947686
325122130 -958881583
325122130 -115703499
399672789 821857835
-751884489 821857835
-407471339 821857835
-440355675 821857835
-930981956 821857835
325122130 411759969
9942...

output:

100000
9 85536
10 79891
11 131183
12 106117
13 97887
15 55990
19 28184
24 67748
26 141705
33 93329
41 24493
43 126898
47 164449
51 111681
52 50535
57 24437
58 107166
59 112934
60 117219
61 32020
62 2882
69 9049
71 31662
74 194425
78 10404
79 19555
86 158940
91 113459
96 78501
97 19136
98 10808
101 1...

result:

ok ok (1 test case)

Test #135:

score: 0
Accepted
time: 117ms
memory: 43340kb

input:

1
100000
-226465324 -765160112
-804076207 -66372335
-996256652 -66372335
-232309074 -66372335
433736878 -66372335
-226465324 884802247
241435841 -66372335
-216832241 -66372335
311207842 -66372335
-226465324 -209742435
368069229 -66372335
-605974269 -66372335
-846600651 -66372335
781736433 -66372335
...

output:

100000
2 142347
3 181679
4 32940
5 58647
7 101147
8 99111
9 20315
11 196025
12 191331
13 73084
14 74073
19 129443
20 181126
22 153424
23 173856
24 94972
25 53523
26 176333
27 119982
28 8927
29 14764
30 15481
31 198281
34 515
35 105541
37 192837
39 10443
40 143395
41 142709
45 193393
46 174662
47 682...

result:

ok ok (1 test case)

Test #136:

score: 0
Accepted
time: 119ms
memory: 46248kb

input:

1
100000
-938307807 -589622988
-781309279 862497436
-938307807 -280855161
-938307807 821787178
-938307807 -143785330
-342339007 862497436
-159228282 862497436
480181280 862497436
-725384126 862497436
-780856436 862497436
-915347010 862497436
-292109291 862497436
-183345034 862497436
158697996 862497...

output:

100000
2 169451
6 82512
7 129750
8 141704
9 57295
10 5558
11 180814
12 174978
13 17950
14 144363
15 49364
16 141112
17 153997
18 98430
19 59485
20 148602
21 131108
22 193856
23 149007
24 159495
25 115139
27 170669
29 183747
30 155675
31 29229
33 111218
34 45514
36 176671
37 93048
38 167243
39 38057
...

result:

ok ok (1 test case)

Test #137:

score: 0
Accepted
time: 3ms
memory: 15708kb

input:

10000
1
1 1
1 0
1
1 0
1 1
1
1 1
0 1
1
0 0
1 0
1
1 0
0 0
1
1 1
0 1
1
1 1
0 1
1
1 0
0 1
1
1 1
0 0
1
0 1
0 0
1
0 0
0 1
1
0 1
1 1
1
0 0
1 0
1
1 0
0 1
1
1 0
0 1
1
1 1
0 1
1
0 0
1 1
1
1 1
0 0
1
1 0
1 1
1
1 1
0 0
1
1 1
1 0
1
0 0
1 0
1
1 0
0 0
1
1 1
0 0
1
0 1
1 1
1
1 0
0 1
1
1 0
0 1
1
1 1
0 0
1
0 1
0 0
1
1 ...

output:

1
2 1
1
1 2
1
1 2
1
1 2
1
1 2
1
1 2
1
1 2
0
1 2
0
1 2
1
2 1
1
1 2
1
1 2
1
1 2
0
1 2
0
1 2
1
1 2
0
1 2
0
1 2
1
1 2
0
1 2
1
2 1
1
1 2
1
1 2
0
1 2
1
1 2
0
1 2
0
1 2
0
1 2
1
2 1
0
1 2
1
1 2
0
1 2
0
1 2
0
1 2
1
1 2
1
1 2
0
1 2
0
1 2
1
1 2
1
2 1
1
2 1
1
1 2
0
1 2
1
2 1
1
1 2
0
1 2
1
2 1
1
2 1
1
2 1
0
1 2
...

result:

ok ok (10000 test cases)

Test #138:

score: 0
Accepted
time: 7ms
memory: 15832kb

input:

10000
1
0 0
1 0
4
1 0
0 2
2 1
1 3
2 0
2 2
0 3
1 2
1
1 0
1 1
2
1 2
3 3
3 1
2 3
2
1 2
2 1
0 2
0 1
2
0 0
1 1
1 0
0 1
5
2 0
2 3
3 0
3 2
0 3
0 0
1 1
3 3
1 0
0 2
1
0 1
1 1
1
0 0
0 1
4
5 2
0 4
1 4
0 0
5 3
4 3
0 3
0 5
3
1 4
4 3
1 2
4 0
1 0
0 4
1
1 0
0 1
1
1 0
0 0
3
3 2
0 1
1 0
3 3
2 2
2 3
2
1 1
0 2
0 0
0 1
...

output:

1
1 2
4
1 5
2 7
8 4
3 6
1
1 2
1
3 2
1 4
2
1 3
2 4
2
1 4
3 2
5
3 6
10 5
9 7
1 2
4 8
1
1 2
1
1 2
4
2 3
6 7
4 8
1 5
3
1 6
5 3
4 2
0
1 2
1
1 2
2
5 6
1 4
2 3
2
1 4
3 2
4
1 8
3 4
5 7
6 2
1
2 1
1
1 2
1
1 2
2
1 4
2 3
5
1 2
5 12
7 11
6 8
10 3
4 9
3
1 2
6 7
4 3
5 8
0
1 2
1
1 2
2
2 3
1 4
3
4 6
8 1
7 2
3 5
4
1 ...

result:

ok ok (10000 test cases)

Test #139:

score: 0
Accepted
time: 10ms
memory: 9936kb

input:

10000
1
0 1
1 0
4
3 0
2 1
3 1
2 4
4 0
1 3
1 2
4 4
1
0 0
0 1
1
0 1
1 0
3
3 5
2 5
5 3
4 2
0 4
5 5
2
1 2
2 1
1 1
2 2
1
1 1
0 1
2
1 0
1 2
2 0
2 2
1
0 1
0 0
3
1 1
0 1
2 2
2 0
0 0
2 1
1
1 0
0 0
2
0 1
2 0
2 1
0 2
4
3 3
6 4
4 3
7 1
2 4
5 1
6 7
6 5
1
1 0
0 1
2
1 3
3 2
0 1
2 3
3
3 2
1 2
2 2
0 0
2 3
3 0
1
0 0
...

output:

0
1 2
4
7 6
2 4
1 3
5 8
1
1 2
0
1 2
2
1 2
3 6
4 5
2
3 1
2 4
1
1 2
2
1 2
3 4
1
2 1
3
1 2
4 5
6 3
1
1 2
2
1 4
2 3
4
1 3
2 5
4 6
8 7
0
1 2
1
1 4
2 3
3
1 2
4 6
3 5
1
1 2
1
1 4
2 3
2
2 6
4 5
1 3
3
4 9
1 5
6 8
2 3
7 10
1
1 2
2
4 1
3 2
0
1 2
1
2 1
0
1 2
1
1 2
6
2 3
11 7
5 10
1 12
4 9
6 8
2
1 2
3 4
4
2 8
4 ...

result:

ok ok (10000 test cases)

Test #140:

score: 0
Accepted
time: 20ms
memory: 11740kb

input:

10000
1
1 1
0 1
4
0 1
1 1
2 1
0 2
2 0
0 0
1 2
2 2
4
3 2
1 0
1 3
0 3
2 3
2 2
2 0
3 3
5
6 4
2 0
2 7
1 7
0 9
7 2
1 9
8 4
9 8
0 6
6
3 3
0 3
0 4
1 1
4 0
2 2
5 4
1 3
4 3
4 2
3 0
2 4
2
0 1
1 1
0 0
1 0
1
0 1
0 0
5
3 4
4 1
0 7
0 2
1 4
2 7
2 6
4 3
6 5
6 2
10
5 3
6 4
0 2
8 7
4 4
3 3
7 0
7 5
4 5
7 3
5 0
6 0
0 1...

output:

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

result:

ok ok (10000 test cases)

Test #141:

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

input:

10000
2
2 3
2 2
3 1
0 3
5
1 5
5 5
1 2
4 4
5 3
6 1
2 2
0 6
3 0
3 6
3
0 1
0 2
1 0
0 0
2 0
2 2
1
1 1
0 0
4
1 2
2 4
2 0
3 4
4 2
0 1
0 2
0 4
5
1 3
0 1
3 2
2 0
0 2
1 0
0 3
0 0
3 3
1 1
6
2 4
5 5
2 3
0 4
6 0
2 1
2 2
0 0
5 1
6 2
5 4
6 4
4
2 2
0 1
2 0
1 2
0 0
1 1
2 1
1 0
4
4 3
6 2
6 0
7 4
1 0
2 5
5 1
6 7
12
1...

output:

1
2 1
3 4
3
3 7
9 10
5 2
1 4
6 8
3
3 4
1 2
5 6
0
1 2
4
1 5
4 8
6 7
3 2
5
4 6
8 2
5 7
10 1
3 9
6
6 9
7 10
8 4
3 1
11 2
5 12
4
3 8
5 2
6 4
7 1
2
3 5
2 8
1 4
6 7
10
2 3
4 17
6 11
9 24
10 22
13 16
5 23
18 14
20 7
21 19
1 8
12 15
5
2 5
3 9
6 8
1 4
10 7
0
1 2
3
1 6
3 4
5 2
6
4 8
6 11
10 12
3 1
2 9
7 5
3
1...

result:

ok ok (10000 test cases)

Test #142:

score: 0
Accepted
time: 31ms
memory: 9916kb

input:

10000
10
1 0
0 1
1 4
1 2
2 1
0 4
0 3
4 4
1 3
3 0
4 3
3 3
2 0
0 2
3 1
4 1
0 0
4 2
2 4
1 1
7
1 3
5 6
4 0
5 3
1 5
6 3
0 2
1 1
2 1
6 4
3 1
3 6
3 3
4 2
12
5 0
1 5
9 5
3 8
9 2
4 7
1 1
0 6
8 6
9 3
7 5
7 9
4 3
2 8
7 6
6 9
1 8
4 8
9 0
7 8
5 4
2 6
5 3
6 3
8
7 5
2 7
1 6
6 6
2 4
0 7
3 2
2 0
1 2
7 7
2 6
0 6
5 4
...

output:

10
1 17
10 13
2 14
7 6
20 4
9 3
5 19
15 12
16 18
11 8
6
9 11
8 1
13 12
3 14
4 2
6 10
5 7
12
2 11
4 14
8 22
9 15
13 23
7 17
6 18
1 21
24 16
20 12
19 5
10 3
8
7 9
12 6
14 3
8 5
11 2
16 13
15 4
1 10
2
2 3
6 5
1 4
2
1 3
4 2
2
1 3
4 2
16
1 27
2 12
4 11
6 22
13 17
26 36
5 19
30 28
35 9
31 15
34 14
10 3
33...

result:

ok ok (10000 test cases)

Test #143:

score: 0
Accepted
time: 33ms
memory: 11708kb

input:

10000
1
0 1
1 1
3
1 2
2 2
0 2
0 0
1 1
0 1
2
1 0
0 0
0 1
1 1
6
3 2
3 0
1 3
2 0
4 3
3 1
0 4
0 1
3 3
3 4
4 1
4 4
5
2 3
6 6
6 4
4 0
6 3
7 3
1 3
3 4
4 5
6 7
3
1 1
2 3
1 3
0 0
2 1
0 3
6
5 2
2 5
4 7
1 5
5 3
2 4
4 0
6 5
6 4
8 5
1 4
6 0
1
1 0
1 1
6
4 11
3 7
9 10
0 5
1 10
4 4
7 8
8 2
4 0
7 0
1 3
4 2
4
0 6
6 2...

output:

1
1 2
3
1 2
5 6
4 3
2
2 3
1 4
6
2 4
3 9
6 11
8 7
1 10
5 12
5
1 7
3 8
5 6
4 9
2 10
3
4 6
1 3
5 2
6
8 10
11 4
6 2
7 3
1 5
12 9
1
1 2
4
3 5
8 12
9 6
10 7
1 2
4 11
4
5 8
4 1
3 7
2 6
5
7 12
5 9
3 11
4 10
1 8
2 6
1
2 1
16
7 29
12 25
18 26
20 32
22 27
19 4
1 17
30 11
28 3
24 9
31 21
15 10
16 14
5 8
6 23
2 ...

result:

ok ok (10000 test cases)

Test #144:

score: 0
Accepted
time: 43ms
memory: 9704kb

input:

10000
12
13 12
11 3
11 1
7 0
9 8
11 6
2 17
1 9
8 11
17 0
11 11
6 17
15 11
9 5
13 2
0 3
5 3
12 9
5 6
0 16
3 8
17 11
17 6
7 6
7
7 7
2 5
10 4
7 4
2 7
1 1
7 1
8 3
2 2
6 8
4 6
6 2
8 10
10 9
9
9 1
10 11
10 8
7 1
0 3
0 8
6 1
12 3
2 7
3 2
8 6
8 3
3 0
3 3
5 5
10 0
0 7
6 6
3
2 1
3 3
4 0
2 0
2 2
1 1
1
0 0
1 1
...

output:

11
4 10
7 12
8 18
9 13
16 17
19 24
14 5
3 2
6 11
15 1
23 22
20 21
6
1 5
9 2
12 10
7 4
8 13
3 14
6 11
8
1 4
5 8
9 17
13 16
10 14
7 18
12 11
3 2
6 15
2
3 4
1 5
2 6
0
1 2
1
1 2
3
2 5
6 1
3 4
2
2 4
3 1
1
1 2
7
2 12
5 13
7 11
10 9
14 8
1 6
4 3
15 16
19
2 15
4 6
20 22
23 40
33 8
36 16
7 37
30 14
1 38
17 1...

result:

ok ok (10000 test cases)

Test #145:

score: 0
Accepted
time: 45ms
memory: 11712kb

input:

10000
2
0 0
1 1
0 1
1 0
12
1 1
3 3
6 1
4 3
0 2
5 0
0 5
5 4
2 6
2 3
2 1
0 3
2 2
0 6
1 2
5 5
3 0
4 0
5 1
2 0
4 1
1 3
5 2
1 5
16
5 2
3 2
7 5
7 10
1 2
9 6
5 1
10 5
6 7
5 5
8 3
6 2
6 4
2 0
8 7
3 10
9 1
5 7
3 8
3 6
8 9
0 3
4 3
1 10
7 8
8 0
3 1
7 6
10 8
3 3
0 10
1 5
15
5 5
2 1
2 3
6 3
2 5
6 6
0 6
5 1
6 1
5...

output:

2
1 3
4 2
12
3 19
18 20
5 12
7 14
1 15
22 24
11 13
10 9
17 2
21 4
6 23
8 16
16
1 12
2 5
7 27
11 23
14 26
22 31
32 24
30 20
19 16
10 18
13 9
3 28
25 4
15 21
17 6
8 29
15
8 22
13 17
30 27
7 21
19 11
18 26
2 3
14 5
20 25
15 12
1 10
29 9
4 28
6 23
16 24
21
4 24
5 18
6 32
8 13
12 43
14 34
15 21
19 35
22 ...

result:

ok ok (10000 test cases)

Test #146:

score: 0
Accepted
time: 55ms
memory: 9776kb

input:

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

output:

7
2 8
3 14
9 13
11 16
6 1
12 4
7 15
5 10
6
2 12
4 8
5 9
3 7
6 11
10 1
56
3 41
5 66
12 99
22 76
30 55
45 46
79 111
1 51
10 38
42 78
69 88
50 89
67 61
91 104
112 26
81 73
7 53
27 75
107 31
65 96
63 108
47 35
56 8
24 43
74 100
4 48
95 9
97 18
110 15
20 98
44 13
85 40
68 70
29 109
62 102
58 2
17 77
37 2...

result:

ok ok (10000 test cases)

Test #147:

score: 0
Accepted
time: 66ms
memory: 11856kb

input:

1000
116
40 14
11 4
18 3
11 36
20 21
11 5
10 21
8 37
8 38
11 22
40 33
4 4
2 36
31 21
0 0
37 16
21 39
16 42
41 9
13 25
6 41
33 2
38 30
30 38
9 33
19 24
0 20
7 38
27 21
22 39
1 41
42 18
3 1
5 40
38 18
38 32
4 29
1 19
0 27
16 36
22 31
11 29
30 41
42 31
34 8
16 19
1 24
27 9
13 19
1 9
8 18
34 24
9 4
22 3...

output:

116
2 199
3 212
6 83
15 93
33 193
45 138
58 63
59 155
71 190
82 229
89 172
92 183
108 162
123 180
159 215
163 218
27 173
39 114
105 50
38 47
121 31
13 102
198 152
12 133
75 204
202 37
115 208
226 34
176 175
166 21
87 140
28 77
153 51
170 8
9 211
146 53
203 216
55 157
106 25
186 66
7 62
145 90
98 68
...

result:

ok ok (1000 test cases)

Test #148:

score: 0
Accepted
time: 88ms
memory: 12588kb

input:

100
1751
676 962
2080 1171
2449 361
678 1915
276 2074
1308 739
1328 739
442 105
1452 14
962 26
614 2079
1882 1674
1619 868
1354 435
2075 2473
514 1497
2365 2044
601 734
2227 1499
218 519
1848 600
219 1462
207 450
1644 1089
2157 2364
1890 1306
697 1851
1293 1484
1068 1656
2405 2194
625 727
2460 375
2...

output:

1627
1 510
2 2897
3 1650
6 7
8 342
12 3259
13 276
14 2293
18 2123
19 2262
20 1885
21 156
24 957
27 1632
28 1972
30 750
36 1936
37 2150
40 1984
42 578
46 3004
47 1269
51 183
55 150
57 2100
59 1472
68 197
70 1468
71 1969
72 692
74 3197
77 268
79 2079
81 630
82 314
83 678
84 3039
85 1096
88 2300
89 671...

result:

ok ok (100 test cases)

Test #149:

score: 0
Accepted
time: 110ms
memory: 18684kb

input:

10
5923
990 3340
465 3601
4722 4502
1946 1225
2051 4441
3447 2001
1373 1646
4604 1645
2067 2525
2984 486
1779 2132
281 2392
3682 3334
2807 2874
1709 1458
3249 1263
3358 1826
1067 3769
1473 3101
144 1498
2492 553
341 1852
397 4263
4683 3010
4547 4068
2198 689
2087 4032
182 545
3578 3282
3051 2356
258...

output:

5878
1 9188
4 4203
6 4595
10 142
15 6837
16 1171
20 9532
28 4477
29 6339
30 10822
32 3695
36 3722
43 9212
44 10769
45 5174
47 10662
48 11745
50 4043
55 3001
58 1427
65 872
66 4455
67 2335
72 11816
74 4273
76 11338
77 8419
78 4648
85 3624
89 5329
95 4692
97 8545
98 1788
100 3515
103 9862
106 5350
111...

result:

ok ok (10 test cases)

Test #150:

score: 0
Accepted
time: 145ms
memory: 25720kb

input:

1
100000
167013 125784
135343 32228
31636 139579
125392 28117
109132 130552
18863 126456
70093 140399
65187 131293
60990 127651
2030 57656
111845 109917
114136 18890
12132 33233
93847 20459
44854 159309
21435 47947
118357 48471
33129 78641
154624 169493
106664 83316
164632 49121
5045 149642
161002 1...

output:

86849
2 165534
5 46276
6 178394
9 163352
10 75562
11 21188
14 66301
16 30428
22 35191
27 130157
29 151610
31 41049
33 33485
35 81376
38 146348
40 102782
41 161785
45 39693
46 139017
49 122680
50 18814
51 168527
57 194022
59 126649
61 19339
62 160523
63 59190
66 199294
68 1592
69 98760
70 25647
71 11...

result:

ok ok (1 test case)

Test #151:

score: 0
Accepted
time: 39ms
memory: 15784kb

input:

10000
8
2 1
0 1
2 3
3 3
2 0
1 0
1 3
3 1
1 2
0 2
2 2
0 3
1 1
3 2
0 0
3 0
6
2 3
3 0
0 1
2 1
0 3
3 3
2 2
1 1
0 0
1 0
0 2
1 2
56
2 4
5 2
6 6
4 9
5 1
8 5
10 7
8 3
2 0
8 6
6 1
0 4
9 8
10 10
2 2
3 10
6 3
0 9
8 4
2 5
4 5
10 2
1 8
8 8
10 3
2 6
6 10
1 0
2 3
6 0
2 10
8 2
9 9
6 7
6 4
3 9
6 9
9 3
5 10
5 0
10 6
9...

output:

8
15 2
10 12
6 13
9 7
5 1
11 3
16 8
14 4
6
4 8
9 3
11 5
10 12
7 1
2 6
56
9 71
28 43
30 51
73 90
97 79
53 12
46 72
94 110
18 60
103 50
48 66
104 23
65 95
98 15
29 1
20 26
58 75
47 31
63 108
88 59
89 111
36 16
70 93
56 76
21 77
52 99
4 44
40 5
2 84
54 69
106 101
86 39
11 61
17 35
81 3
34 100
37 27
83 ...

result:

ok ok (10000 test cases)

Test #152:

score: 0
Accepted
time: 54ms
memory: 15872kb

input:

1000
116
8 8
4 15
0 7
0 0
9 4
14 3
12 9
8 9
9 2
3 13
7 6
7 8
7 5
14 10
6 14
3 12
15 14
6 11
14 2
4 5
3 10
5 14
0 10
13 8
14 1
3 1
14 5
0 13
1 7
2 12
12 7
15 1
13 14
4 13
2 15
4 10
9 9
3 0
14 12
10 12
12 12
10 13
11 3
10 11
11 9
2 11
13 7
12 6
5 12
1 9
7 15
11 8
0 14
4 0
13 6
14 9
2 6
1 13
7 12
12 10...

output:

116
87 219
95 112
161 224
4 210
167 151
231 109
189 3
122 202
23 197
194 28
53 119
93 70
190 107
127 29
227 50
128 90
68 58
204 133
159 126
79 193
137 57
143 152
232 46
30 156
67 35
38 26
135 155
99 121
228 139
218 21
160 16
10 115
54 187
225 166
20 149
106 216
140 36
114 34
131 2
163 208
217 223
17...

result:

ok ok (1000 test cases)

Test #153:

score: 0
Accepted
time: 69ms
memory: 16316kb

input:

100
1751
43 55
50 32
40 59
17 23
14 41
50 44
52 57
26 29
6 21
2 50
46 36
34 9
44 12
55 22
20 5
23 45
50 43
53 6
41 58
19 27
22 53
16 32
11 56
7 36
20 39
23 48
46 48
9 51
15 4
40 38
51 36
21 45
52 7
49 37
10 24
16 56
33 50
48 56
51 34
11 33
43 18
20 59
4 9
41 44
52 23
26 26
20 51
40 36
37 59
40 56
37...

output:

1751
57 3065
66 3492
409 1500
421 2805
478 1157
586 1646
1017 2638
1165 2967
1271 2328
1319 1845
1330 1586
1476 3354
1490 2406
2304 3480
2417 2885
2427 2851
2438 2894
2531 2765
3342 3446
2799 1221
3237 905
2731 733
941 1916
795 1223
326 2561
755 2527
2333 1544
430 2647
1798 1602
3043 1339
3148 669
1...

result:

ok ok (100 test cases)

Test #154:

score: 0
Accepted
time: 66ms
memory: 16732kb

input:

10
5923
53 27
26 66
1 35
65 99
6 99
28 12
61 5
106 43
37 67
106 91
84 102
76 52
10 52
20 74
11 12
29 4
42 71
86 53
42 37
89 37
70 36
12 19
78 53
8 15
106 11
28 97
10 11
100 89
55 2
46 94
82 43
57 84
62 101
65 58
16 16
82 59
91 76
7 30
50 65
107 9
46 12
105 55
11 10
97 23
83 82
6 50
52 57
69 53
77 83...

output:

5923
78 481
546 9757
597 10454
716 9684
997 10062
1226 10761
1310 10606
1453 3722
1575 6137
1732 5238
2405 9588
2429 11660
2859 6204
3118 5796
3396 11313
3421 4796
3614 5382
3776 10949
4008 10883
4224 6315
4478 7074
4635 7871
4828 8950
4965 9336
4981 5365
5619 6831
6016 6496
6110 6616
6287 11730
645...

result:

ok ok (10 test cases)

Test #155:

score: 0
Accepted
time: 94ms
memory: 18204kb

input:

1
100000
436 393
386 68
30 357
47 276
18 61
414 156
347 273
304 106
72 167
114 83
260 443
192 432
324 196
388 313
153 350
284 316
165 408
26 313
298 348
293 221
318 119
380 345
27 325
91 223
403 186
374 185
416 143
418 325
217 7
147 209
385 220
128 207
58 331
35 309
151 313
284 372
335 384
181 274
3...

output:

100000
108 58576
408 154290
1539 64676
1837 164837
3645 125001
4259 141235
6123 141686
8574 46256
8801 10334
10662 78813
12282 158823
12699 187911
12703 188602
15828 36382
15908 172374
17050 85434
17263 124660
17910 137003
18597 42504
19959 137094
20091 148757
20453 85738
20634 152606
22492 172015
2...

result:

ok ok (1 test case)