QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#304184#5008. Zero AAMP Currentsezteam1#AC ✓80ms37132kbC++142.3kb2024-01-13 16:14:002024-01-13 16:14:00

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

-3
1
2
-1
2
-1
-1

result:

ok good one

Test #2:

score: 0
Accepted
time: 2ms
memory: 12860kb

input:

2 2
1 2
2 1

output:

-3
3

result:

ok good one

Test #3:

score: 0
Accepted
time: 34ms
memory: 24888kb

input:

13758 193861
8665 5619
9734 11588
936 1302
2748 2317
3141 5818
8849 11418
248 943
9907 3274
8337 359
13597 8368
7809 3431
11374 13189
5135 4551
11688 1841
4071 4437
796 364
8000 4384
12954 7759
3399 3585
1918 5592
7368 7392
8872 7186
217 9202
11502 9587
13399 10630
947 3691
1486 8804
8226 7143
2734 ...

output:

-118
-35
342
392
180
-239
469
400
-340
-54
-270
27
267
-394
-1
-322
-103
-203
-214
-121
34
-155
-3
5
-241
100
76
261
42
-69
346
118
-1
-295
-103
99
-106
-86
52
-2
-155
3
-159
90
109
-231
314
-25
39
41
66
51
-58
-127
3
267
-92
-98
112
-294
1
33
73
-3
97
-8
190
-206
68
91
3
366
3
-405
307
36
-1
112
16...

result:

ok good one

Test #4:

score: 0
Accepted
time: 24ms
memory: 21444kb

input:

2576 198513
2126 2537
2007 428
1155 1644
1657 1832
1459 1922
2240 1132
230 1696
1376 704
971 597
109 533
310 2328
692 1335
757 443
1964 2388
136 263
2139 2546
1451 1917
2048 1636
2502 137
757 2575
647 2480
2004 618
256 1715
2433 2085
79 1933
83 2549
1659 2016
1936 786
1816 2512
1359 953
1747 2366
19...

output:

44
-63
-18
11
170
-139
77
-21
5
-16
-2
171
92
180
131
54
18
-8
20
117
-39
11
28
-44
-7
110
158
-174
-122
161
-84
-122
91
-9
-62
-120
-154
71
69
-71
-14
51
117
-119
-116
-16
-13
-11
37
165
-170
4
-11
124
-124
97
-97
-121
62
2
-139
81
-3
-112
162
15
-191
-108
3
40
-62
-169
-79
-72
88
-93
70
6
44
-104
...

result:

ok good one

Test #5:

score: 0
Accepted
time: 38ms
memory: 32348kb

input:

82644 198952
7250 60424
14369 31861
37573 68142
518 73568
74639 26836
50082 46206
25507 52142
59920 68131
55089 52689
53869 67254
32548 11363
57133 35487
69810 22267
51959 3483
69787 67700
26981 50678
30328 1083
18162 39761
49695 23254
54278 33751
2529 28612
13175 38044
27929 60984
11278 39952
46896...

output:

37
32
0
2
2
1
-1
2
-58
1
-3
-336
0
80
8
-247
-2
5
289
-74
-74
-185
0
-2
0
0
-62
-1
-1
-1
85
0
-78
-14
0
0
-74
105
0
-43
49
114
1
-45
0
-3
1
3
-2
0
-90
3
459
0
0
1
-2
-340
-95
-373
-2
-204
251
0
0
132
3
58
3
71
-124
0
1
3
10
-63
0
0
43
0
-7
147
46
-3
-22
-1
-265
0
-93
-1
-1
1
-3
-3
149
146
0
0
79
2
4...

result:

ok good one

Test #6:

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

input:

3066 190306
1154 186
1738 2367
2880 2483
1819 148
743 909
2190 878
1769 470
426 638
649 1065
2171 399
1935 1067
465 1763
1188 1773
1024 2198
2128 2238
175 1150
1497 1309
161 449
616 259
1573 1742
2607 2505
2412 2073
1221 1928
1803 1556
2390 1153
2595 3022
2171 2756
991 2114
1250 289
1212 2488
886 24...

output:

124
21
-72
78
-51
-177
64
-177
79
150
-37
13
-18
51
-10
-197
100
-89
62
51
1
-22
-111
-42
-85
94
-14
113
52
34
-100
34
61
131
-62
17
-84
103
0
6
122
-23
182
-9
43
-47
-135
118
-113
44
-118
45
121
-31
4
142
-95
43
-82
38
75
-70
183
-116
-63
135
-46
-144
-110
-31
-5
136
11
104
-11
-34
101
32
-1
-27
2
...

result:

ok good one

Test #7:

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

input:

62947 193186
22551 46152
47519 19425
11727 62118
1314 39189
12100 58408
1939 22952
27035 2101
8727 11566
31352 16360
6087 34237
55265 53249
11568 56162
45145 17492
25851 58165
20558 49212
54825 3353
61284 39686
8357 8978
12265 10697
3789 41042
14696 54530
34033 18793
44036 1524
10967 28191
34241 333...

output:

-2
4
-116
209
8
-104
-39
15
0
0
-9
-95
-16
207
7
-1
-3
134
1
64
-142
-67
0
-25
108
26
3
58
-78
1
8
-54
2
-2
3
0
-101
1
43
-230
75
1
46
-204
3
1
151
101
27
-4
-120
45
32
134
123
-1
-112
51
80
137
91
-121
-2
-109
3
-14
2
-51
2
33
-35
-121
-45
103
0
-2
17
2
0
3
-148
2
-31
2
-47
-120
1
121
2
131
1
2
112...

result:

ok good one

Test #8:

score: 0
Accepted
time: 46ms
memory: 30320kb

input:

43480 191239
2764 9693
11155 3878
35008 22467
15585 19079
18258 36650
22436 8886
40098 31323
29864 15570
28429 18175
32157 17602
28377 39275
34373 38165
35860 30680
15971 17678
28142 21403
36344 28834
4823 35491
42548 9942
8734 26474
333 25614
8695 6193
28083 42472
20275 32280
10644 13870
39269 3238...

output:

-46
14
18
50
-35
2
-21
3
44
133
-1
33
143
-115
154
-49
-122
65
-40
-48
-65
36
-1
93
-50
14
-69
14
3
-3
116
77
3
13
20
3
-25
-138
-34
-3
-1
18
-41
1
4
-80
60
1
6
-3
-3
-3
106
-3
-2
114
48
58
68
-12
-3
-1
34
109
-75
60
68
-76
-38
106
3
9
3
-6
-71
32
-78
17
-41
2
2
14
73
-153
-3
-125
2
-11
-48
132
116
...

result:

ok good one

Test #9:

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

input:

44894 196108
4806 34877
9136 30358
10866 17290
15667 13264
17961 12496
32755 29806
2921 42651
13853 5805
13222 34459
13583 19243
43448 3758
12773 19121
3092 25400
27927 43493
43466 16023
17001 40852
12530 4439
27639 6554
3858 34705
42998 21472
293 25255
38745 20928
23393 27405
20963 5755
8850 33548
...

output:

155
169
36
118
-2
1
-1
-104
0
45
-144
103
49
111
44
-125
-3
16
-57
-2
-200
-3
-2
2
-90
108
3
128
52
-2
203
-210
2
-3
3
-141
154
-5
-112
-2
67
3
-3
2
3
-139
2
2
70
63
173
69
-1
235
109
41
-1
-269
-116
178
-71
102
110
-2
-105
-114
-180
2
26
1
3
200
-3
-128
1
-5
-64
201
99
-199
-5
-158
63
150
-3
90
-14...

result:

ok good one

Test #10:

score: 0
Accepted
time: 67ms
memory: 34268kb

input:

88238 193852
46448 59478
77052 49817
26135 8158
489 74346
73637 53130
86918 84923
32946 55226
7645 65340
55271 18234
76520 5302
18306 64706
39035 21340
61079 82551
79787 76260
82351 4804
59136 25995
18730 43376
34068 20258
8703 20152
18577 86217
2681 42652
31028 46158
57629 2012
11382 2744
55829 724...

output:

2
-70
-1
1
-1
-3
0
0
116
-1
95
31
1
1
2
3
-3
44
-98
0
-2
2
0
0
0
-4
2
0
0
2
60
-14
-3
3
3
60
-2
0
0
63
19
1
48
-2
43
241
1
3
-2
-3
1
1
-3
-58
29
29
62
2
21
1
0
-1
-2
0
47
0
0
0
53
24
230
-2
-2
-1
1
-2
-1
-2
-166
3
1
-87
0
-1
0
-1
27
-141
3
-2
-98
1
-1
-108
-1
0
29
0
-136
18
1
-10
-1
0
0
-62
3
-2
3
7...

result:

ok good one

Test #11:

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

input:

57117 191812
53629 33354
8343 12030
25097 45053
10232 43485
41581 27734
6982 26296
11675 9015
54025 817
5712 1030
51794 1681
5041 35170
36971 17853
41180 26869
2695 34545
12630 24160
28687 9970
5945 48619
10552 31410
39963 49269
29651 39405
55892 52341
52613 53900
21986 16435
36002 12820
55903 38326...

output:

345
247
-2
197
-6
3
-2
-5
1
-15
-1
58
-130
0
285
157
-244
-142
-18
117
-57
-13
-3
54
196
146
2
113
-339
-2
176
2
3
-37
71
-220
-82
381
-92
-3
381
-199
1
2
86
-1
3
-98
-1
-187
176
-29
3
-42
101
28
1
-54
70
-3
-21
-320
4
-107
-39
-1
75
0
-2
3
-58
-130
-2
-2
-38
-45
-65
-134
196
-145
112
-2
10
-43
-22
...

result:

ok good one

Test #12:

score: 0
Accepted
time: 37ms
memory: 28856kb

input:

30067 190595
10345 14018
13995 4745
1600 20148
252 15031
12820 20909
17958 27642
5724 6189
27053 22793
1144 28863
8622 3153
28637 22765
29959 20058
27027 2115
3100 548
7156 14515
7765 8073
14728 19693
26144 29357
20672 10328
17818 28830
15070 21837
13240 8941
19948 8167
10401 49
12118 8658
26577 286...

output:

-238
226
-134
2
291
-133
-2
-2
-223
1
-3
-195
-46
-2
-336
46
87
-38
176
3
26
48
-171
254
3
-44
-97
-11
-18
-57
-210
201
-2
28
-41
5
1
5
85
243
-1
1
303
-3
-195
85
-194
-191
-136
-4
98
370
-54
61
118
2
-97
-215
-3
2
6
-66
101
-145
16
138
-95
-213
-38
56
157
123
-18
250
277
-44
-68
-20
12
208
127
90
-...

result:

ok good one

Test #13:

score: 0
Accepted
time: 62ms
memory: 34016kb

input:

60185 194321
48556 16368
33074 37628
16897 6151
53328 35423
24938 28966
4446 20680
10805 34656
55104 21351
4794 1562
16489 1003
42454 40020
27828 30159
53382 27263
2136 39772
5791 10977
46156 56376
41674 43756
50684 35300
3446 43407
52540 59392
22999 50053
21235 42574
21676 40382
27243 43401
7693 34...

output:

-112
-49
-2
0
61
-3
83
-43
-52
-2
134
3
-3
129
-154
0
3
-116
92
63
-65
-116
-48
50
1
-182
-214
-40
-1
96
-90
28
62
-107
7
-246
-11
-1
-113
-62
-1
-21
-3
-1
2
176
97
3
-1
2
15
3
-2
-46
-164
-97
-84
-94
2
-45
2
-23
30
14
1
-2
140
-78
-118
93
1
227
-149
-12
181
-31
1
202
-148
1
30
-9
3
127
125
198
69
-...

result:

ok good one

Test #14:

score: 0
Accepted
time: 38ms
memory: 30008kb

input:

30986 192197
7315 4118
2366 20107
17954 12256
7269 23827
14233 23892
725 14826
16798 21774
21071 14124
17811 17311
13247 30296
4559 8167
30370 26915
19016 29256
4741 23129
3198 20086
27821 8224
4020 7717
653 22091
29067 5775
20783 29559
13780 10504
14648 24300
18455 25243
27325 13419
144 10962
3944 ...

output:

103
135
9
103
-74
104
46
-247
-187
86
-105
1
-145
-274
56
-177
-59
-101
31
-100
3
-50
61
64
241
56
15
104
179
-54
-201
-124
-154
-248
-166
-9
-326
89
-80
-18
170
319
68
-70
1
354
-243
350
50
31
-337
-90
220
171
100
-259
35
198
38
-95
-302
-1
-6
317
-108
-319
-92
8
4
-312
-334
-2
55
137
-243
49
-62
4...

result:

ok good one

Test #15:

score: 0
Accepted
time: 50ms
memory: 32920kb

input:

39822 198848
31937 20331
33697 34785
1717 17646
1987 16747
14936 31909
29747 19519
29449 19291
25943 1566
25902 33889
33198 38326
351 2905
32397 10664
22512 7042
33766 3167
16398 26018
33906 29987
2809 30135
8202 16503
31051 32967
29085 14715
12287 20834
27030 15322
21704 12413
37524 25073
25343 168...

output:

-241
-71
-3
206
-55
-124
38
228
-245
-294
-30
221
58
-9
2
-113
427
-207
-243
3
-1
216
357
-1
-85
-108
-192
-392
321
286
70
138
130
108
56
28
-10
2
-37
203
-22
103
144
-58
-34
-181
1
17
-272
-289
288
-264
3
-73
-45
245
34
-162
18
-3
-143
-2
65
-2
-416
-181
-173
-129
-69
3
-207
-24
2
-96
141
273
-1
-3...

result:

ok good one

Test #16:

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

input:

91910 197832
10305 11965
19190 39378
3223 2745
353 10263
88073 74784
1517 73626
43781 33872
81744 12703
25242 6863
90804 27937
55800 37501
32343 55209
44395 90499
46918 1622
42613 30682
50382 28083
46856 20870
59072 31005
54528 60124
51736 90761
46972 46468
31309 49895
38016 37238
39352 48876
30424 ...

output:

71
-67
-234
0
0
0
3
-314
214
-125
3
0
0
267
32
65
-281
0
0
-1
0
-153
99
2
0
-24
1
0
-3
-262
-149
2
0
0
-2
-258
-1
27
-34
-255
321
-63
48
0
1
-2
1
-225
-3
1
0
290
334
90
1
11
0
0
-1
0
2
-160
-3
-3
1
-387
-363
-218
41
-3
2
-1
1
0
20
0
-71
66
-1
-6
36
-3
-1
0
38
214
-1
-1
2
-1
270
1
-248
-212
46
0
3
1
...

result:

ok good one

Test #17:

score: 0
Accepted
time: 73ms
memory: 32160kb

input:

80690 198571
21961 51934
52078 46795
78135 5442
3250 27750
68754 16151
36458 22844
45270 13966
61722 10500
50375 54405
48741 54238
685 30072
53054 31282
22548 2253
18272 903
15040 71394
955 42852
7085 68179
29934 27110
71470 9399
37754 43073
56895 21800
35571 15658
7845 46050
10177 76606
40711 73305...

output:

0
-3
134
-48
205
-296
169
138
0
-232
-16
-3
2
0
-319
2
3
-154
-151
127
245
-96
-1
1
-3
-1
-134
-2
-20
-1
1
-5
-1
0
292
-205
-291
0
1
0
-65
0
339
0
-40
3
26
-2
-62
61
97
-126
2
-2
-77
-125
1
2
3
50
31
-88
1
105
-44
-110
-2
233
-2
-1
-279
-2
-158
-121
1
-13
-17
0
1
-1
3
-2
0
0
-136
132
-3
-3
-2
-179
3...

result:

ok good one

Test #18:

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

input:

37473 192482
13440 21528
23924 4048
24987 29389
34848 5471
15690 31834
12663 33414
2795 11287
10611 21751
35400 1942
12452 27183
3392 236
16140 13876
37230 13080
37012 24456
1399 8715
977 12031
23282 2457
12896 14765
36890 5722
19335 36150
25549 31540
8901 33529
18235 4416
970 18218
6403 4569
17319 ...

output:

87
87
-42
3
-6
-116
-195
-57
-85
-32
-106
-316
-3
81
-138
-3
1
297
0
-172
-175
-59
-93
1
226
-3
1
-75
120
-179
-13
29
224
-53
109
-1
10
138
150
-23
-36
-3
22
118
-1
170
235
-229
143
-154
1
-58
-86
218
208
-5
-223
-186
47
-85
-1
274
35
-212
154
-26
-3
6
98
-8
-2
-1
119
-122
-125
151
-2
3
162
207
237
...

result:

ok good one

Test #19:

score: 0
Accepted
time: 30ms
memory: 28968kb

input:

100000 200000
95846 76140
70125 3369
91264 90314
8492 46342
11760 94433
91249 1250
81517 63944
72014 37341
3303 9722
243 77717
26751 99494
95347 17205
15724 15677
85675 26653
28830 90255
36019 36997
10488 79704
54538 36274
57304 23167
39393 56311
71726 69930
51786 17224
46624 76446
2999 48250
62722 ...

output:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
...

result:

ok good one

Test #20:

score: 0
Accepted
time: 67ms
memory: 34572kb

input:

100000 200000
83849 21488
52302 37545
82359 71980
95443 81516
65961 93512
77251 57522
59200 92396
48566 83664
7040 14688
14427 87861
49501 57013
47974 74312
16452 3911
1221 73835
63180 20884
88776 40807
95947 42562
31067 73821
53920 43172
74694 39481
15429 84143
3399 87168
71412 46522
97152 11683
47...

output:

-2
-3
-119
208
2
1
26
1
3
1
3
-1
-100
-1
0
0
-77
425
4
-61
468
-3
0
-57
159
3
-38
-306
0
1
-1
0
-190
-3
0
0
0
-60
-68
155
-2
-3
0
-2
3
0
145
278
0
0
-2
1
3
-151
-239
-3
-204
-2
-1
241
-1
-2
51
-3
0
-67
0
-3
0
-3
-1
311
340
1
-2
-216
-2
331
20
0
-124
-190
-233
3
330
129
388
-44
-3
-3
3
-1
-3
0
248
88...

result:

ok good one

Test #21:

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

input:

100000 200000
58987 61049
71738 53668
26361 2281
87841 73526
77982 66740
49515 22092
84826 7690
1387 72150
49976 615
63841 44885
17357 60030
83752 60207
52473 96219
93778 10715
92695 55171
36451 99872
1405 99234
60020 87483
80774 25801
46063 37442
30974 8875
4697 13596
34335 72872
41817 25484
49698 ...

output:

-122
91
23
-1
2
3
-1
0
341
3
-43
0
-134
-2
2
-2
-165
51
-1
109
37
193
47
134
30
1
2
0
72
-1
-210
10
-3
3
2
-106
-1
265
-113
-222
0
7
2
-1
-3
0
-134
-2
2
3
200
-170
24
10
0
2
-188
55
-1
-1
-4
0
0
-177
0
-3
0
0
11
1
72
170
0
225
-105
3
1
-62
-80
7
0
1
-132
1
0
-126
-1
15
0
3
0
2
0
-2
1
0
0
-142
2
-2
-...

result:

ok good one

Test #22:

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

input:

100000 200000
61531 39695
44632 20774
47490 63977
11320 87977
22483 84362
97339 83997
66856 45614
58751 92088
50968 22234
15401 55813
24179 58381
50919 52415
27723 14965
73732 26913
97080 22998
29750 89034
94983 76318
11015 96185
65987 90703
93206 85215
35593 10642
26499 55355
58488 60609
84201 5522...

output:

0
197
12
0
0
61
-20
0
-38
0
0
126
177
0
-91
0
-1
-66
-2
-1
2
-241
-2
0
-10
25
299
-1
1
20
47
2
277
-187
0
-3
-22
48
-75
0
-55
242
0
1
3
47
77
-251
-2
15
0
-18
77
-2
0
310
-3
1
85
-225
0
59
0
206
0
-52
0
-2
-1
74
2
1
2
1
-3
-1
115
0
-2
126
-56
167
179
0
275
-318
-315
-25
3
171
-3
-46
0
0
205
75
0
13
...

result:

ok good one

Test #23:

score: 0
Accepted
time: 63ms
memory: 34616kb

input:

100000 200000
53412 96815
66768 25886
52007 38071
3793 84234
10089 78405
19880 70751
49212 11313
88319 94289
48424 43501
56528 43410
81110 4648
76913 8860
8685 3118
35692 55330
784 15167
92405 37975
25886 10675
53631 64986
23498 68235
84426 8010
76287 62434
84435 23848
16561 91183
53030 23483
76417 ...

output:

1
0
0
60
0
-202
1
-3
-17
-3
-2
-33
1
-44
-1
0
0
0
0
-33
-142
-54
-11
76
1
-1
0
0
0
0
138
2
-183
-3
2
119
-63
1
37
2
-52
0
23
-103
0
-1
0
324
-76
34
-50
-26
-66
0
1
0
0
0
-2
3
-39
2
-115
-249
1
39
0
89
161
-273
162
0
1
-3
0
0
-57
-3
0
-114
-1
-179
-1
14
112
3
-36
-50
0
-2
294
-24
0
-2
308
0
-2
-44
-3...

result:

ok good one

Test #24:

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

input:

100000 200000
5131 78762
42404 93493
52235 71438
85648 7787
81905 66559
29178 27650
48236 74286
64218 35483
65744 50690
589 46895
3077 56002
89577 32355
49453 92405
78780 61760
79011 68198
80862 39323
64144 31834
84503 52051
40908 65062
19814 87794
66213 97894
23455 88113
96323 12512
42435 46880
976...

output:

3
1
108
-197
-3
-3
154
1
1
1
1
1
-65
129
-1
0
0
1
54
150
-3
1
-1
0
142
-96
1
-1
1
1
162
-144
0
0
32
20
-2
-23
-106
-3
0
176
-1
-2
6
109
180
92
3
1
-27
-1
-1
-32
-2
3
44
0
0
52
-250
-2
0
1
62
-1
3
-1
-120
-173
0
0
124
0
3
-1
0
-13
-2
1
0
318
-1
-3
-97
0
160
-162
2
0
-3
-3
-213
-181
48
-2
-1
0
0
-3
0
...

result:

ok good one

Test #25:

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

input:

100000 200000
41616 13893
25722 75287
53284 35348
59288 22280
32989 4762
22159 16632
96009 60218
57263 89931
36667 34473
78984 32519
70597 73841
32896 43752
29709 74369
94444 27128
75931 80679
74452 42941
83117 42464
57606 93177
99417 88728
41366 1361
37980 61662
75105 82403
43353 50922
46255 3399
7...

output:

308
2
17
-1
0
-2
-221
-270
224
2
1
0
-57
103
-10
242
13
0
-3
1
-151
0
-1
241
51
2
0
0
-2
-2
-3
1
0
3
0
-1
-3
0
3
-122
0
178
0
-71
-3
0
-233
88
2
3
-1
0
-208
2
247
0
3
1
-3
-1
-89
1
3
0
197
-2
1
2
0
1
-1
1
-1
-1
1
-3
-205
-1
149
0
3
-41
0
-3
1
0
302
2
1
0
172
0
-62
-136
146
-70
-3
-3
108
-1
2
0
-242
...

result:

ok good one

Test #26:

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

input:

100000 200000
50724 36149
50482 85130
62118 23067
7817 74516
60553 82912
57489 63150
49494 15229
85938 55220
70603 91964
77101 22606
37898 18718
25168 39454
21603 86140
25491 25615
14343 2590
50233 15978
67796 7141
76406 5654
48616 15580
43403 31818
44891 42339
96839 31754
36102 44574
41231 2546
971...

output:

-3
-1
-1
-48
-1
0
-240
-126
1
0
2
-1
-217
3
-3
97
3
1
0
0
3
0
0
3
0
337
1
3
0
318
0
399
31
-1
-213
2
0
-67
-2
3
-2
-2
-1
-2
2
0
279
52
-2
2
75
-371
-206
23
-2
0
234
45
3
2
-2
-35
0
-349
2
0
140
349
-43
1
6
0
-74
0
0
2
31
-327
-1
-118
-116
84
3
26
1
0
-43
-101
0
0
40
-3
-213
-101
0
215
2
-58
-150
53
...

result:

ok good one

Test #27:

score: 0
Accepted
time: 47ms
memory: 34660kb

input:

100000 200000
56671 48189
34975 48598
30103 97369
93468 73079
62494 17602
2359 36405
78972 73193
86427 39506
33465 16790
5372 24962
98974 59261
82529 8093
59407 32284
23001 16363
43385 27646
84703 46571
11229 45529
9261 85651
45367 56089
2786 72313
6788 1068
91398 96916
91655 24664
30858 28977
21593...

output:

1
0
-433
3
0
2
0
0
-82
-3
-1
0
-2
-1
3
1
1
76
0
-3
181
-2
0
-179
-2
204
2
1
0
-167
2
-1
-92
-1
3
-1
140
2
-14
2
-77
0
290
2
0
3
-1
0
-3
0
1
1
40
0
0
-100
-3
-166
382
-2
-233
-244
189
0
0
0
-1
91
-3
-411
-74
53
-1
-3
-269
55
-43
0
3
-19
0
-156
-1
-3
0
1
0
-145
0
1
0
-2
0
0
-247
115
0
0
-3
-3
0
-57
16...

result:

ok good one

Test #28:

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

input:

13758 193861
9734 10314
10314 10872
10872 1602
1602 7202
7202 13249
13249 11073
11073 6133
6133 6517
6517 1371
1371 6674
6674 5085
5085 11683
11683 6382
6382 13011
13011 5390
5390 4879
4879 8256
8256 11007
11007 9724
9724 10240
10240 8101
8101 5891
5891 4738
4738 10854
10854 11567
11567 8155
8155 49...

output:

-215
126
-119
22
46
-27
182
-182
47
-35
126
-113
104
-174
85
3
60
-2
-140
44
125
-136
-1
-2
-3
138
-172
-9
179
-86
109
11
-157
157
-221
93
-10
129
1
-148
104
50
-113
114
-15
-144
-57
58
121
-14
-80
-34
144
-151
190
-168
-31
67
3
-108
18
-22
26
197
-197
-11
-28
1
219
-159
176
-193
39
20
9
-1
93
-106
...

result:

ok good one

Test #29:

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

input:

2576 198513
2007 2105
2105 1045
1045 2544
2544 1693
1693 142
142 1041
1041 809
809 2136
2136 1863
1863 2322
2322 849
849 2112
2112 857
857 1083
1083 638
638 1661
1661 226
226 548
548 2365
2365 56
56 1846
1846 811
811 742
742 1964
1964 1227
1227 1776
1776 916
916 907
907 195
195 1021
1021 1901
1901 4...

output:

14
27
-43
16
-46
52
-18
-12
8
-35
52
4
-52
14
-6
15
15
14
-56
30
-29
52
-1
-59
34
-29
52
-8
-27
27
-16
35
-33
-29
7
0
11
37
12
-11
-27
39
-89
70
-15
-21
17
-49
45
22
-18
8
-60
7
11
36
42
-29
-11
-41
72
-16
-38
25
3
3
14
1
30
-73
36
-42
28
9
-41
27
34
-51
25
25
-32
-40
61
-25
5
27
-39
-12
26
24
-53
1...

result:

ok good one

Test #30:

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

input:

82644 198952
14369 38166
38166 8025
8025 74259
74259 20862
20862 21855
21855 23561
23561 33654
33654 19654
19654 65205
65205 50573
50573 28578
28578 9376
9376 48693
48693 45281
45281 15921
15921 78701
78701 30418
30418 46756
46756 45707
45707 70841
70841 22881
22881 57706
57706 32178
32178 69215
692...

output:

149
-1
3
-2
1
1
3
1
558
-1
-503
-143
615
-1
1
-119
-98
2
-1
1
199
3
-3
-554
478
3
-1
1
-3
-1
-1
-3
2
-153
-1
214
3
2
1
3
-3
-1
3
-595
-1
-1
-3
167
215
1
47
-109
-277
-2
-72
1
467
-3
166
-649
-3
644
-3
1
-3
-184
-1
-1
1
105
-1
-1
2
-3
63
45
3
-105
-3
3
1
-547
89
99
-2
387
-7
-192
-1
-2
-40
287
-635
-...

result:

ok good one

Test #31:

score: 0
Accepted
time: 19ms
memory: 21000kb

input:

3066 190306
1738 2537
2537 1704
1704 1292
1292 1261
1261 1156
1156 2399
2399 2358
2358 1474
1474 560
560 415
415 2863
2863 1902
1902 1805
1805 369
369 1926
1926 379
379 1298
1298 39
39 2896
2896 2623
2623 2960
2960 1972
1972 372
372 346
346 1206
1206 790
790 66
66 231
231 2401
2401 1551
1551 720
720...

output:

65
-39
-36
7
57
-67
-23
87
-2
-6
-29
3
-45
79
99
-182
42
-3
154
-120
-1
-58
43
2
-32
15
-9
48
24
-73
54
-14
7
-60
22
42
-86
124
-85
106
45
-9
-54
-114
89
18
-66
8
24
4
76
-118
-20
7
-2
8
146
-137
35
-45
41
-3
-37
-24
77
-89
182
-157
-1
91
-30
47
3
-40
-86
16
75
94
-113
-31
-23
-4
67
-65
71
1
-51
130...

result:

ok good one

Test #32:

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

input:

62947 193186
47519 44243
44243 11193
11193 10826
10826 8728
8728 6887
6887 10776
10776 59071
59071 42377
42377 51605
51605 3133
3133 52665
52665 62934
62934 9355
9355 21865
21865 25494
25494 31300
31300 32398
32398 18242
18242 45820
45820 47445
47445 26114
26114 31067
31067 21478
21478 19558
19558 5...

output:

-2
19
317
-1
-2
-252
-1
116
139
-275
507
-204
1
-1
-214
1
3
3
198
-2
3
-310
1
2
-25
2
-1
-2
-1
306
1
1
65
7
-180
-93
-1
-69
-3
366
-1
2
1
-3
-139
-1
-221
-1
201
-1
1
-162
-2
471
-2
-2
2
-142
-3
1
-90
-88
129
-3
-3
-25
268
-1
-1
-1
-584
535
2
-1
-134
-1
-17
-1
-1
1
216
-3
-616
485
-457
294
1
-246
1
2...

result:

ok good one

Test #33:

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

input:

43480 191239
11155 10225
10225 43244
43244 1713
1713 14645
14645 27359
27359 23140
23140 18479
18479 6396
6396 28179
28179 19088
19088 42538
42538 36224
36224 27054
27054 19997
19997 23865
23865 29197
29197 25035
25035 32937
32937 32337
32337 14753
14753 14105
14105 33516
33516 36557
36557 24963
249...

output:

23
144
-2
-1
-2
-1
-528
339
2
-31
1
1
133
1
-10
-371
440
-373
188
87
-235
1
-105
382
-52
-95
-36
135
2
-23
-135
3
40
-13
161
3
-3
1
-99
-45
68
73
-177
133
1
-3
-3
3
-226
3
-3
195
2
-93
-10
92
-134
2
144
71
3
-117
-19
57
-129
-2
-1
186
-118
-3
-269
259
-1
118
56
1
3
-38
-133
2
162
-3
-218
3
247
-66
-...

result:

ok good one

Test #34:

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

input:

44894 196108
9136 34157
34157 14616
14616 13372
13372 30799
30799 25932
25932 12847
12847 9656
9656 12309
12309 14718
14718 26967
26967 35141
35141 7851
7851 25591
25591 9544
9544 28866
28866 21085
21085 41045
41045 36348
36348 21752
21752 23669
23669 839
839 7252
7252 28433
28433 16461
16461 36184
...

output:

48
127
-28
-83
17
3
106
-208
195
-1
-56
1
2
-54
280
-1
-210
-1
1
1
-3
-271
180
-134
1
240
-32
2
-250
294
-308
21
-1
1
319
-187
348
1
-353
-5
-1
-1
3
89
86
2
177
-312
-85
2
-2
62
226
3
-95
77
-1
-1
-338
372
-409
-3
-1
197
23
1
19
12
1
33
1
228
-2
2
3
-1
-2
-257
45
-47
-66
-3
-1
295
-187
-18
-98
-26
-...

result:

ok good one

Test #35:

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

input:

88238 193852
77052 68192
68192 77813
77813 39146
39146 45801
45801 665
665 76961
76961 85198
85198 78074
78074 67590
67590 52330
52330 5738
5738 48259
48259 87814
87814 28365
28365 77083
77083 67906
67906 38325
38325 53288
53288 7728
7728 74011
74011 80072
80072 29963
29963 28230
28230 9749
9749 139...

output:

104
2
-1
2
3
3
-40
2
115
-14
-3
195
1
2
69
-233
-2
1
1
-2
-1
-2
18
3
-89
-1
-3
-161
173
167
2
-108
-3
-2
491
1
1
-685
0
215
1
-2
-2
1
-193
102
435
1
1
-1
1
-2
1
-1
-102
-447
226
30
-3
220
3
-288
45
1
-48
-3
-1
145
-2
117
1
-1
-257
3
1
-193
1
3
2
1
1
1
3
392
-3
-163
-3
213
-1
-2
1
1
1
-134
-209
-3
10...

result:

ok good one

Test #36:

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

input:

57117 191812
8343 12597
12597 45223
45223 2159
2159 52976
52976 48490
48490 25963
25963 32595
32595 30306
30306 5149
5149 26914
26914 9456
9456 15655
15655 45190
45190 26814
26814 45052
45052 24030
24030 5561
5561 52213
52213 55549
55549 39706
39706 36036
36036 48171
48171 45129
45129 8329
8329 4025...

output:

-118
3
311
-222
2
-7
2
1
129
-130
3
1
-131
254
-260
1
1
-3
-1
-1
214
1
2
-183
-2
-1
311
-259
-1
3
-24
1
1
-3
41
280
-226
-149
-1
2
-1
-2
-2
1
359
-269
1
-3
153
88
2
-1
-271
420
3
-194
-3
-279
352
-3
-136
2
208
1
-394
-12
115
443
-486
-1
265
-3
1
-132
-221
219
-169
-3
2
210
2
51
-125
3
83
-240
0
413
...

result:

ok good one

Test #37:

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

input:

13758 193861
9734 10314
10314 9734
11967 6004
6004 7514
7514 12027
12027 10332
10332 9106
9106 3200
3200 10217
10217 8950
8950 10230
10230 10093
10093 2789
2789 2654
2654 13389
13389 11967
8288 9693
9693 5244
5244 2265
2265 1367
1367 139
139 8284
8284 3570
3570 7382
7382 729
729 2726
2726 8689
8689 ...

output:

1
-1
-56
43
-47
-102
61
92
-87
32
-32
-102
150
-103
157
-6
118
2
-17
-96
-129
-11
148
-88
177
-261
267
-71
-30
45
-20
5
31
-82
12
-46
-41
50
-148
-1
181
-18
3
-153
178
7
-76
2
-31
85
-39
-30
-80
88
2
-118
141
66
-264
196
54
-79
71
-3
171
-37
-237
186
-13
90
-100
-3
90
-74
-105
183
-83
-19
-51
5
-16
...

result:

ok good one

Test #38:

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

input:

2576 198513
2007 2105
2105 2007
975 2090
2090 2444
2444 1776
1776 434
434 2148
2148 975
2457 1125
1125 1723
1723 1826
1826 1202
1202 2457
1383 2283
2283 1473
1473 980
980 295
295 64
64 1344
1344 1383
1785 1066
1066 930
930 1785
1127 2395
2395 449
449 1127
33 1227
1227 1853
1853 1567
1567 33
841 1727...

output:

22
-22
11
14
-15
6
-15
-1
8
-9
55
-15
-39
27
11
-39
9
46
-23
-31
-103
10
93
64
-46
-18
32
-62
57
-27
44
-1
-43
-82
82
-2
20
-20
37
16
-51
13
-16
1
2
-25
-7
32
-41
41
-74
82
-9
1
4
-12
8
-24
24
-73
79
-11
-3
8
-13
57
-110
44
35
7
15
-10
2
-27
42
-42
-77
11
84
-46
43
9
-21
-7
6
-15
13
3
23
-49
23
27
-...

result:

ok good one

Test #39:

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

input:

82644 198952
14369 38166
38166 8025
8025 74259
74259 20862
20862 21855
21855 23561
23561 33654
33654 19654
19654 65205
65205 50573
50573 28578
28578 9376
9376 48693
48693 45281
45281 15921
15921 14369
11082 11038
11038 67780
67780 13760
13760 47917
47917 48309
48309 73163
73163 76268
76268 14098
140...

output:

292
-1
-2
121
-402
-1
1
-1
355
-156
56
29
1
3
-296
1
99
239
2
-342
-1
311
-3
-20
-254
-3
-1
1
233
-295
-3
-3
279
34
-80
-2
1
1
-1
84
-2
2
-387
409
-31
47
-31
-1
1
-1
-3
-68
102
-26
3
2
-1
-1
-1
3
-189
-1
-2
1
-155
3
2
319
32
-2
2
1
-3
-1
18
-71
3
-357
-2
38
1
-3
-1
361
-10
60
-53
3
-372
2
-3
368
-21...

result:

ok good one

Test #40:

score: 0
Accepted
time: 19ms
memory: 23940kb

input:

3066 190306
1738 2537
2537 1704
1704 1292
1292 1261
1261 1156
1156 2399
2399 1738
2973 1661
1661 2973
1925 2711
2711 2285
2285 1206
1206 1925
1838 2490
2490 181
181 689
689 138
138 1679
1679 2966
2966 1838
1492 2064
2064 2991
2991 2187
2187 2184
2184 1647
1647 1492
2270 1821
1821 2707
2707 1693
1693...

output:

18
-25
22
-54
87
1
-49
13
-13
-100
85
0
15
28
-78
65
7
-4
9
-27
78
6
-7
-8
-88
19
2
-28
45
-19
38
-38
-96
96
66
-74
38
-3
-27
-92
79
7
-4
0
10
11
-11
3
-74
81
-10
-33
37
-4
95
-95
-2
-33
36
-1
-22
22
1
-7
-66
81
-4
-58
-29
78
-31
26
14
-25
18
-4
-39
39
-83
89
69
-69
15
-40
25
-55
55
6
-6
12
-12
39
-...

result:

ok good one

Test #41:

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

input:

62947 193186
47519 44243
44243 11193
11193 10826
10826 8728
8728 6887
6887 10776
10776 59071
59071 42377
42377 51605
51605 3133
3133 52665
52665 62934
62934 47519
32298 17226
17226 35886
35886 31557
31557 57077
57077 12663
12663 59540
59540 26613
26613 28901
28901 22708
22708 16122
16122 40484
40484...

output:

159
-2
-16
-205
-3
1
2
-1
100
-1
-49
-1
16
-49
76
2
-1
-185
-1
358
-356
2
1
122
3
-119
-3
119
-139
-1
3
3
13
127
1
10
-94
1
3
73
-257
-29
-1
431
-3
1
1
-1
2
-127
6
-1
39
-55
-3
-3
2
-3
2
-286
523
-357
300
-224
-82
-1
107
50
-27
-51
2
75
1
-144
-3
-2
185
-1
3
-32
-100
-75
204
-121
145
-1
-179
2
1
1
1...

result:

ok good one

Test #42:

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

input:

43480 191239
11155 10225
10225 43244
43244 1713
1713 14645
14645 27359
27359 23140
23140 18479
18479 6396
6396 28179
28179 19088
19088 42538
42538 36224
36224 27054
27054 19997
19997 23865
23865 29197
29197 25035
25035 32937
32937 32337
32337 14753
14753 14105
14105 33516
33516 36557
36557 24963
249...

output:

-25
-1
-220
-164
3
399
-344
214
-1
3
149
-132
-106
-253
281
151
-3
-431
471
-302
15
1
-23
336
-415
6
-115
489
1
-1
-1
-380
12
1
187
219
-3
1
-12
-409
50
144
2
-215
89
3
-3
2
327
2
-2
-453
1
456
-17
-15
16
-490
280
163
-3
61
-32
-346
320
-1
1
63
-1
-58
-3
441
-507
522
-90
-3
-273
100
-84
7
-1
357
-10...

result:

ok good one

Test #43:

score: 0
Accepted
time: 35ms
memory: 24828kb

input:

13758 193861
9734 10314
10314 10872
10872 1602
1602 7202
7202 13249
13249 11073
11073 6133
6133 6517
6517 1371
1371 6674
6674 5085
5085 11683
11683 6382
6382 13011
13011 5390
5390 4879
4879 8256
8256 11007
11007 9724
9724 10240
10240 8101
8101 5891
5891 4738
4738 10854
10854 11567
11567 8155
8155 49...

output:

61
3
-51
-22
18
-112
30
82
34
-53
91
-3
-45
-16
-36
142
-106
3
103
-50
-99
36
-7
78
3
-85
-2
-82
123
-31
-31
-56
167
-150
15
98
-37
16
-103
149
-152
98
-157
129
102
-23
-95
33
22
-29
-108
142
-160
154
-5
-103
97
56
-79
34
-19
-41
-5
-10
60
-27
-139
139
-89
162
-126
150
-7
-177
139
-201
283
-190
96
1...

result:

ok good one

Test #44:

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

input:

2576 198513
2007 2105
2105 1045
1045 2544
2544 1693
1693 142
142 1041
1041 809
809 2136
2136 1863
1863 2322
2322 849
849 2112
2112 857
857 1083
1083 638
638 1661
1661 226
226 548
548 2365
2365 56
56 1846
1846 811
811 742
742 1964
1964 1227
1227 1776
1776 916
916 907
907 195
195 1021
1021 1901
1901 4...

output:

-130
98
25
-141
60
-44
48
2
36
63
-110
16
84
-1
-65
5
-42
1
69
14
-117
37
13
-5
18
-16
85
1
-83
9
25
41
-73
78
19
-5
-115
8
22
-12
108
-17
-41
25
-85
31
14
-48
18
105
-120
-35
65
-65
33
101
8
-95
-47
45
-28
59
-33
73
-7
14
-4
-30
-92
-7
50
25
50
-100
37
97
-50
-61
102
-6
-6
-97
-47
19
-2
132
-69
-23...

result:

ok good one

Test #45:

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

input:

82644 198952
14369 38166
38166 8025
8025 74259
74259 20862
20862 21855
21855 23561
23561 33654
33654 19654
19654 65205
65205 50573
50573 28578
28578 9376
9376 48693
48693 45281
45281 15921
15921 78701
78701 30418
30418 46756
46756 45707
45707 70841
70841 22881
22881 57706
57706 32178
32178 69215
692...

output:

64
597
2
-1
-3
-382
66
2
132
215
-1
-439
-3
3
237
-10
182
-252
3
-3
-4
1
1
-3
-55
94
-2
1
-1
-253
-1
-3
208
-3
1
-290
-1
263
-242
89
3
165
-1
2
-314
2
-3
609
-266
69
-256
-1
247
-1
9
-2
2
-3
-2
-384
-2
376
-7
-281
-166
244
413
-1
-166
-97
-1
-179
-94
454
-30
-265
-3
181
3
-2
-1
2
8
-398
-2
-1
291
-1...

result:

ok good one

Test #46:

score: 0
Accepted
time: 16ms
memory: 24804kb

input:

3066 190306
1738 2537
2537 1704
1704 1292
1292 1261
1261 1156
1156 2399
2399 2358
2358 1474
1474 560
560 415
415 2863
2863 1902
1902 1805
1805 369
369 1926
1926 379
379 1298
1298 39
39 2896
2896 2623
2623 2960
2960 1972
1972 372
372 346
346 1206
1206 790
790 66
66 231
231 2401
2401 1551
1551 720
720...

output:

5
-9
-77
1
165
-82
76
19
-20
-31
-38
-39
21
85
-167
92
99
-95
65
-14
21
-53
-27
37
-84
54
27
-25
10
-55
52
-62
79
-61
73
-44
55
-90
134
-163
116
-148
98
112
-27
-88
91
-136
49
73
8
-66
32
-118
25
125
-79
-5
4
-38
29
95
-70
12
16
-129
88
-7
88
-72
-79
81
-1
-58
50
92
-14
17
-105
-34
117
7
-61
-18
41
...

result:

ok good one

Test #47:

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

input:

62947 193186
47519 44243
44243 11193
11193 10826
10826 8728
8728 6887
6887 10776
10776 59071
59071 42377
42377 51605
51605 3133
3133 52665
52665 62934
62934 9355
9355 21865
21865 25494
25494 31300
31300 32398
32398 18242
18242 45820
45820 47445
47445 26114
26114 31067
31067 21478
21478 19558
19558 5...

output:

1
-239
-263
298
6
2
-42
2
1
3
220
-444
-3
2
-14
-2
217
3
-187
3
417
-1
-499
279
-263
-2
-2
2
229
-1
1
153
3
-1
178
-2
1
-2
-282
1
-1
1
-3
4
-182
25
-86
1
50
491
-556
2
210
13
7
2
-1
300
-345
97
-2
-2
61
161
-1
-476
189
-1
30
-3
1
252
1
3
-535
285
-129
-1
476
-2
-1
3
-400
-1
21
91
-1
-3
-3
-91
3
-284...

result:

ok good one

Test #48:

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

input:

43480 191239
11155 10225
10225 43244
43244 1713
1713 14645
14645 27359
27359 23140
23140 18479
18479 6396
6396 28179
28179 19088
19088 42538
42538 36224
36224 27054
27054 19997
19997 23865
23865 29197
29197 25035
25035 32937
32937 32337
32337 14753
14753 14105
14105 33516
33516 36557
36557 24963
249...

output:

230
142
-163
87
-181
-1
-156
85
-25
365
-261
77
109
39
-263
1
-85
1
99
117
-214
-1
1
55
296
-469
494
-183
2
104
-2
-197
266
3
-321
325
-175
-3
-2
-1
38
-179
162
174
3
2
-2
-2
-421
418
1
-241
3
269
-423
-2
248
-33
-2
10
-1
5
-198
3
184
-163
1
310
-309
-2
22
4
212
83
2
3
-3
-151
-268
-3
234
-3
-183
2
...

result:

ok good one

Test #49:

score: 0
Accepted
time: 44ms
memory: 31468kb

input:

44894 196108
9136 34157
34157 14616
14616 13372
13372 30799
30799 25932
25932 12847
12847 9656
9656 12309
12309 14718
14718 26967
26967 35141
35141 7851
7851 25591
25591 9544
9544 28866
28866 21085
21085 41045
41045 36348
36348 21752
21752 23669
23669 839
839 7252
7252 28433
28433 16461
16461 36184
...

output:

-3
-120
594
-637
169
-40
531
-142
-452
-1
-18
-3
1
165
432
-2
-1
-570
609
-464
466
-727
404
2
168
-510
598
2
3
3
-459
-92
604
-146
-3
2
1
-377
377
-264
-2
3
396
1
3
-514
-169
352
-174
-1
1
289
10
141
-543
-2
549
-1
-574
220
-3
-299
88
636
-336
1
-119
-158
52
64
-7
148
1
-3
-48
-3
61
-350
703
-491
3
...

result:

ok good one

Test #50:

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

input:

88238 193852
77052 68192
68192 77813
77813 39146
39146 45801
45801 665
665 76961
76961 85198
85198 78074
78074 67590
67590 52330
52330 5738
5738 48259
48259 87814
87814 28365
28365 77083
77083 67906
67906 38325
38325 53288
53288 7728
7728 74011
74011 80072
80072 29963
29963 28230
28230 9749
9749 139...

output:

9
-2
10
1
1
114
-154
1
61
2
1
-202
-2
-22
2
2
101
-2
2
1
-3
-3
-1
1
2
-2
-1
-3
2
-36
-3
55
-1
53
-35
-3
18
-1
-2
51
-3
1
3
-3
1
1
2
126
-1
-213
3
134
-2
2
-311
223
2
-1
3
-2
3
-27
-3
3
-2
-1
1
-142
2
1
1
3
342
1
-2
-130
-3
-26
86
-134
-204
1
172
96
1
1
2
1
-2
2
-2
-1
3
-112
21
-1
1
2
1
-41
3
125
-38...

result:

ok good one

Test #51:

score: 0
Accepted
time: 50ms
memory: 32324kb

input:

57117 191812
8343 12597
12597 45223
45223 2159
2159 52976
52976 48490
48490 25963
25963 32595
32595 30306
30306 5149
5149 26914
26914 9456
9456 15655
15655 45190
45190 26814
26814 45052
45052 24030
24030 5561
5561 52213
52213 55549
55549 39706
39706 36036
36036 48171
48171 45129
45129 8329
8329 4025...

output:

-73
3
1
170
45
-199
44
-1
11
-24
-3
-1
-36
2
-66
3
2
-17
261
-48
-132
-1
3
63
-60
1
-151
38
1
-2
3
229
109
-31
1
-1
-3
1
-1
-3
-1
-259
-2
3
-2
238
2
1
3
-63
-292
-3
-2
379
-1
2
2
1
-167
3
140
1
-125
3
20
-157
-142
278
-14
-123
-3
1
242
-259
33
-1
-1
32
3
2
-28
243
-125
119
-191
93
22
-151
1
160
12
-...

result:

ok good one

Test #52:

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

input:

13758 193861
9734 10314
10314 10872
10872 1602
1602 7202
7202 13249
13249 11073
11073 6133
6133 6517
6517 1371
1371 6674
6674 9734
159 2254
2254 7254
7254 5821
5821 11128
11128 6031
6031 3478
3478 5563
5563 7930
7930 2631
2631 11373
11373 12517
12517 4714
4714 7234
7234 11563
11563 4160
4160 460
460...

output:

176
84
32
-304
264
-317
232
109
-265
277
-288
230
-217
274
-25
-214
147
-120
161
-108
129
-30
34
1
10
-39
-327
90
312
-348
211
14
-42
-2
106
-237
-4
199
48
-327
336
-321
177
-20
-148
178
-98
213
3
1
58
-395
-34
418
-376
-1
110
-117
371
-24
-309
144
120
4
-219
-4
-34
96
171
-326
211
29
-193
124
-168
...

result:

ok good one

Test #53:

score: 0
Accepted
time: 16ms
memory: 24552kb

input:

2576 198513
2007 2105
2105 1045
1045 2007
138 159
159 864
864 1461
1461 471
471 2279
2279 373
373 730
730 2510
2510 1397
1397 2387
2387 1405
1405 1129
1129 2343
2343 138
2198 431
431 1468
1468 1549
1549 828
828 1567
1567 1536
1536 1690
1690 214
214 1921
1921 2021
2021 1632
1632 1368
1368 1301
1301 1...

output:

79
-3
-76
7
101
-89
12
11
-29
-40
-14
69
-19
19
6
-32
-2
-7
41
-43
18
2
12
6
-8
-2
26
0
-26
-27
27
1
-62
64
-72
76
82
-56
-82
54
96
-79
28
-32
-37
-48
120
-113
-45
84
67
12
-180
64
-22
78
-52
31
2
-1
65
-77
-7
-3
5
-4
32
-109
48
34
11
76
-100
45
-99
64
5
-2
-2
21
45
-55
2
11
18
-1
-10
-6
55
-25
68
-...

result:

ok good one

Test #54:

score: 0
Accepted
time: 75ms
memory: 36860kb

input:

82644 198952
14369 38166
38166 8025
8025 74259
74259 20862
20862 21855
21855 23561
23561 33654
33654 19654
19654 65205
65205 50573
50573 28578
28578 9376
9376 48693
48693 45281
45281 15921
15921 78701
78701 30418
30418 46756
46756 45707
45707 70841
70841 22881
22881 57706
57706 32178
32178 69215
692...

output:

-1
-264
59
-25
3
2
2
1
354
-369
13
254
-2
2
-1
-292
383
-108
2
-3
-3
-104
-2
-2
-3
2
-172
-3
280
-105
2
3
-3
130
-27
-142
-1
266
-351
3
57
177
1
-157
1
-1
-1
67
-126
157
-3
-97
-104
-3
-1
3
1
252
-124
-1
1
-71
125
-166
2
147
-2
-3
2
-1
2
-1
15
174
-363
2
1
1
78
66
-1
150
-101
-209
-1
-2
262
29
3
2
-...

result:

ok good one

Test #55:

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

input:

3066 190306
1738 2537
2537 1704
1704 1292
1292 1261
1261 1156
1156 2399
2399 2358
2358 1474
1474 560
560 415
415 2863
2863 1902
1902 1805
1805 369
369 1926
1926 379
379 1298
1298 39
39 2896
2896 2623
2623 2960
2960 1972
1972 372
372 346
346 1206
1206 790
790 66
66 231
231 2401
2401 1551
1551 720
720...

output:

-24
111
-154
60
20
77
-92
-24
29
75
-111
-56
-1
16
65
10
-21
31
46
-60
-22
62
-78
-19
41
-4
83
22
-127
128
-160
149
-44
-120
112
-61
24
76
25
-86
45
-48
-10
-4
88
-50
-11
46
-133
161
14
-140
20
24
-43
-13
91
-35
-76
121
-38
-54
-13
113
-184
83
-16
-55
59
33
42
-61
94
-164
-1
56
23
76
18
-100
-23
-48...

result:

ok good one

Test #56:

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

input:

62947 193186
47519 44243
44243 11193
11193 10826
10826 8728
8728 6887
6887 10776
10776 59071
59071 42377
42377 51605
51605 3133
3133 52665
52665 62934
62934 9355
9355 21865
21865 25494
25494 31300
31300 32398
32398 18242
18242 45820
45820 47445
47445 26114
26114 31067
31067 21478
21478 19558
19558 5...

output:

288
-312
178
1
-119
3
127
82
-230
2
189
-203
-67
1
-3
242
-21
1
-272
-3
-1
1
3
42
77
46
2
-3
60
91
0
-1
-314
-1
155
-55
240
-18
-213
161
50
-67
3
55
-24
3
-3
19
-99
3
1
2
3
-2
-1
82
-3
1
-119
164
-1
76
-2
-104
53
-137
1
-2
-1
2
-30
121
1
2
-298
62
3
-1
58
1
155
-1
42
-1
-72
-186
282
-42
3
-50
1
-136...

result:

ok good one

Test #57:

score: 0
Accepted
time: 41ms
memory: 30604kb

input:

43480 191239
11155 10225
10225 43244
43244 1713
1713 14645
14645 27359
27359 23140
23140 18479
18479 6396
6396 28179
28179 19088
19088 42538
42538 36224
36224 27054
27054 19997
19997 23865
23865 29197
29197 25035
25035 32937
32937 32337
32337 14753
14753 14105
14105 33516
33516 36557
36557 24963
249...

output:

-108
-43
19
166
-1
-226
83
116
-1
1
-25
-1
-82
1
34
3
65
-17
-20
-79
3
44
-33
109
2
-86
92
-170
-2
-3
56
-3
-68
153
-101
2
1
41
-3
1
38
-101
3
-19
-4
191
-1
2
23
-78
-73
2
-2
1
212
-243
-1
63
-78
3
1
134
-47
39
9
-88
-3
69
-1
1
-1
0
2
-3
3
2
3
107
-142
1
136
-225
120
-1
15
160
-60
-175
52
-3
1
-10
-...

result:

ok good one

Test #58:

score: 0
Accepted
time: 44ms
memory: 30860kb

input:

44894 196108
9136 34157
34157 14616
14616 13372
13372 30799
30799 25932
25932 12847
12847 9656
9656 12309
12309 14718
14718 26967
26967 35141
35141 7851
7851 25591
25591 9544
9544 28866
28866 21085
21085 41045
41045 36348
36348 21752
21752 23669
23669 839
839 7252
7252 28433
28433 16461
16461 36184
...

output:

-10
100
74
-16
-45
3
-110
-48
-2
15
-2
-1
-2
143
-90
3
-4
69
1
-126
114
-378
418
-1
3
-166
-2
3
117
-3
-39
-1
137
-112
-8
3
-12
-299
366
-7
-3
-1
-234
114
-268
-2
253
146
-73
88
-1
1
-2
-388
332
-3
-45
73
-60
-320
3
2
-3
397
-248
2
124
-1
-2
-14
44
117
-105
22
-339
6
355
104
-74
-16
-88
127
-152
-20...

result:

ok good one

Test #59:

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

input:

88238 193852
77052 68192
68192 77813
77813 39146
39146 45801
45801 665
665 76961
76961 85198
85198 78074
78074 67590
67590 52330
52330 5738
5738 48259
48259 87814
87814 28365
28365 77083
77083 67906
67906 38325
38325 53288
53288 7728
7728 74011
74011 80072
80072 29963
29963 28230
28230 9749
9749 139...

output:

-57
3
1
-118
-3
492
-273
-3
147
163
-1
-1
1
-369
-122
1
472
3
-1
-485
225
-3
-3
1
75
-146
-17
63
-3
147
133
-1
2
-2
53
2
1
-346
2
1
-1
1
-3
2
-124
3
1
119
1
-1
-1
-1
-1
196
-18
-404
457
-403
433
16
1
-456
2
494
-1
1
-2
-416
2
-1
-3
-2
-2
3
1
1
407
-477
519
-546
-3
2
-3
1
3
-1
2
-29
2
2
46
-1
3
296
7...

result:

ok good one

Test #60:

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

input:

57117 191812
8343 12597
12597 45223
45223 2159
2159 52976
52976 48490
48490 25963
25963 32595
32595 30306
30306 5149
5149 26914
26914 9456
9456 15655
15655 45190
45190 26814
26814 45052
45052 24030
24030 5561
5561 52213
52213 55549
55549 39706
39706 36036
36036 48171
48171 45129
45129 8329
8329 4025...

output:

-38
3
-2
270
1
-88
-489
-2
541
-139
1
2
-46
-1
-2
29
-1
-342
373
1
-71
70
81
3
-104
6
2
-348
485
-524
-55
229
184
1
-3
2
-359
-2
-3
408
1
-33
-1
1
23
-53
70
1
-187
1
251
-514
2
-1
1
-2
-1
395
2
1
-1
3
3
2
32
-103
-1
-2
65
-57
-334
-3
573
-149
-416
448
-424
1
-2
-3
-93
435
-11
48
-368
338
-435
1
-1
-...

result:

ok good one