QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#305205#5008. Zero AAMP Currentsezteam1WA 67ms41144kbC++142.2kb2024-01-14 21:03:422024-01-14 21:03:42

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

2
-3
1
4
2
4
3

result:

ok good one

Test #2:

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

input:

2 2
1 2
2 1

output:

2
-2

result:

ok good one

Test #3:

score: 0
Accepted
time: 29ms
memory: 28244kb

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:

3
3
-1
42
-2
-22
35
-106
46
3
1
1
-1
-1
-1
38
-1
-2
19
1
11
1
-1
-2
2
-2
1
2
313
146
-52
2
1
1
114
3
2
3
-1
292
-2
77
204
3
1
-1
-1
12
315
-1
-1
104
127
91
3
1
-2
2
3
218
320
3
-1
-2
227
295
188
-3
3
-68
393
-99
136
191
178
-2
46
-2
85
366
2
-2
150
134
-1
122
288
-3
-9
1
3
1
216
9
100
189
95
290
-1
...

result:

ok good one

Test #4:

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

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:

-4
1
1
-3
1
-53
1
-1
3
8
13
39
-10
2
1
-2
76
-2
-1
73
-2
1
84
88
3
-47
1
15
2
1
35
-34
14
63
-1
-1
-19
-1
3
99
9
-1
2
-13
3
26
0
-2
18
1
1
1
-27
3
48
42
-4
-1
2
1
-43
2
-3
-1
18
2
63
22
-24
35
-14
-5
61
-3
-2
2
1
-3
-2
3
1
-1
-28
1
35
41
64
-2
-2
0
1
-46
28
18
2
18
1
-1
-10
18
-1
2
-71
1
56
-45
35
3...

result:

ok good one

Test #5:

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

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:

-38
139
0
1
-185
30
-2
2
3
-50
255
1
0
144
2
-1
1
-139
37
-1
332
-234
0
-60
0
0
-282
2
-35
2
-88
0
-202
235
0
0
1
8
0
1
-1
74
9
149
0
3
90
2
1
0
11
-46
-117
0
0
-85
-269
-88
-2
2
2
87
-3
0
0
1
7
-1
-3
59
3
0
-1
-34
-1
77
0
0
-1
0
3
2
-259
2
8
2
3
0
127
-3
1
-274
-219
2
150
-73
0
0
-251
-2
162
-2
51
...

result:

ok good one

Test #6:

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

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:

-3
-35
-1
2
1
-1
-29
-11
-1
-11
-32
8
2
31
-1
3
1
3
-22
41
20
41
-2
1
-7
-1
35
3
2
3
84
-3
2
24
3
1
80
-2
-3
64
49
2
-1
1
-3
49
-3
3
82
1
1
1
38
-3
1
21
44
-3
-9
-14
30
10
6
-46
-3
-1
2
-1
3
-18
-37
-1
61
-3
-53
-45
-3
3
3
101
9
9
49
3
-1
-2
1
-2
-1
3
57
1
14
1
-46
-1
-67
-68
65
-1
2
-26
3
87
2
-1
4...

result:

ok good one

Test #7:

score: 0
Accepted
time: 40ms
memory: 33752kb

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:

1
3
226
146
1
134
-14
-53
0
0
-73
-56
-3
280
197
-291
52
-1
-157
272
1
2
0
1
2
-36
2
23
3
2
98
-19
-1
-243
17
0
-3
0
54
92
-1
-131
2
-68
-1
-15
-3
5
-189
1
133
200
3
-2
-151
2
-1
2
13
62
-1
-40
1
45
-3
-3
1
2
265
-114
-1
-3
3
-3
0
3
5
-44
0
1
114
1
-3
19
24
45
-1
-61
1
1
-3
3
-3
12
0
1
-1
0
-3
0
-39...

result:

ok good one

Test #8:

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

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:

-3
-35
-289
-173
2
3
1
2
1
-80
-1
-1
50
27
2
-82
3
1
2
256
-108
-108
1
2
136
3
-1
1
3
2
3
-236
1
-1
-1
70
3
2
5
3
12
-361
-61
-3
-241
54
-3
-2
18
-1
2
-1
38
-11
3
-213
-35
-1
-299
-2
-129
94
-90
-1
-235
1
-103
-121
2
-31
3
27
3
-2
-216
2
2
-5
1
26
-2
2
2
-10
-148
-1
1
-2
2
-87
-172
263
-340
1
2
1
50...

result:

ok good one

Test #9:

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

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:

-2
2
-67
1
-2
-2
42
-2
3
1
210
-3
3
-2
44
-53
-2
16
-56
-3
-195
303
-1
-173
138
70
-2
3
-146
-3
-143
-1
39
-93
1
-97
-51
153
147
-285
188
-3
-3
1
183
-114
3
1
-18
69
-2
122
1
-1
-3
-1
97
107
159
158
-85
2
129
107
-144
-3
-182
-1
112
3
143
-1
-2
3
-1
-1
-2
-1
-2
-128
29
2
-85
151
132
89
-3
-3
-180
2
...

result:

ok good one

Test #10:

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

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:

105
1
-1
1
-2
-1
0
0
13
-1
6
51
-1
1
2
78
3
-120
402
0
1
1
0
0
0
142
-10
0
328
-3
278
425
2
35
1
-2
67
0
0
25
1
-2
16
-1
589
3
-131
-1
-191
418
1
1
24
-16
-3
3
2
2
1
-3
0
1
1
1
-16
0
0
0
2
-52
133
-2
3
-3
-1
-2
3
-1
-1
1
-2
93
0
-1
0
-2
427
60
-3
-1
1
149
2
1
-35
0
-2
0
16
400
2
2
-3
0
0
-200
-1
-1
...

result:

ok good one

Test #11:

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

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:

32
-2
3
218
415
3
117
-105
-3
-3
340
249
1
0
60
195
431
-14
-177
42
1
2
2
-1
425
109
-441
-3
248
-1
2
53
10
400
51
127
222
1
80
2
2
3
-1
-250
-2
-1
-1
94
2
-1
-1
3
-2
-55
211
-6
-71
232
-357
1
-197
1
277
-1
-1
13
-57
0
2
-2
1
60
-3
1
334
-209
271
-88
-1
92
1
2
-1
-103
251
226
-1
3
-168
-3
2
1
1
-1
4...

result:

ok good one

Test #12:

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

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:

-3
1
158
3
89
-57
-1
2
76
-206
-1
3
198
-1
42
1
-491
67
-1
2
-3
-1
-2
120
3
52
13
133
222
3
72
-357
3
-1
70
1
3
3
220
433
-2
-2
294
1
13
147
-2
-2
1
361
-3
85
504
1
-55
201
-1
-1
-1
1
-114
3
156
-241
-3
-1
-69
-3
191
350
311
-76
-153
3
-42
1
-19
-2
-6
1
32
-14
76
-2
1
-147
173
1
3
-3
148
2
558
-2
-1...

result:

ok good one

Test #13:

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

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:

1
7
-3
0
60
-1
-1
102
1
229
442
2
-1
-2
231
0
3
-239
258
-1
45
-1
3
3
-1
-242
-230
-3
139
353
-1
161
-3
-1
239
-2
481
-3
268
-73
-3
262
1
-1
-1
1
1
54
3
2
47
254
-1
296
1
2
-1
1
3
2
3
-171
-370
351
1
1
2
223
241
-1
-59
-1
342
63
3
-2
-1
1
2
2
1
2
1
215
1
276
-1
2
202
2
-421
191
2
-3
0
304
94
2
386
1...

result:

ok good one

Test #14:

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

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:

-1
2
46
3
484
-2
1
3
347
-3
51
9
-3
1
21
-3
389
68
-41
6
380
494
2
89
-126
1
-1
81
1
411
1
-1
385
1
-2
-1
373
-1
117
-1
2
-1
-2
59
-33
-1
6
2
-2
2
-384
320
-1
-2
2
52
193
395
464
-3
355
-1
57
407
1
111
476
1
98
1
455
-1
1
1
1
-3
15
-2
204
-2
501
-160
176
156
255
-8
193
-1
170
331
3
-9
205
435
-140
2...

result:

ok good one

Test #15:

score: 0
Accepted
time: 36ms
memory: 30432kb

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:

-1
-3
8
1
2
-3
2
1
288
581
2
-2
20
182
245
-78
79
-118
-3
386
3
-1
1
-3
367
-192
559
1
-58
119
120
506
-1
1
-3
57
-1
2
-2
-3
-500
3
-2
230
-2
-1
1
1
310
-3
331
99
292
-93
1
453
390
139
-75
-1
512
3
-3
-58
-1
2
-1
-1
364
-209
3
3
2
2
-1
-2
20
2
3
-3
-121
468
-2
1
614
400
2
43
294
-1
-1
100
226
-1
30
...

result:

ok good one

Test #16:

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

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:

55
-2
-129
0
0
0
3
-49
1
-1
3
0
0
-21
94
-3
-51
0
0
2
0
2
74
-46
0
-9
-1
0
-2
3
-231
2
0
0
3
125
166
207
66
-129
-15
105
-10
0
2
3
-2
21
2
1
0
-2
134
1
-1
4
0
0
-3
0
64
-110
1
-2
-2
-28
-2
204
1
-1
1
3
-2
0
-21
0
-1
32
-1
-1
78
1
1
0
-84
-1
-2
-1
-53
2
-1
-2
-1
47
326
0
-2
1
-93
0
212
-1
-2
91
-22
2...

result:

ok good one

Test #17:

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

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
-168
-378
96
-191
-41
-172
0
3
-1
45
-3
0
92
1
479
-205
3
1
-1
-1
-1
-51
-244
-2
-1
3
-2
2
-3
367
-3
0
2
388
-44
0
-3
0
481
0
-3
0
3
1
76
1
-1
3
497
-353
479
-1
424
3
3
-1
316
-35
101
1
-3
1
79
-17
-244
1
458
1
183
3
88
-2
3
-1
-15
0
-1
-249
1
3
0
0
-2
-138
3
-397
1
-173
19
1
458
-200
34
-2
0
85...

result:

ok good one

Test #18:

score: 0
Accepted
time: 36ms
memory: 30068kb

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:

-1
-56
-2
1
3
108
3
10
1
-57
-136
-114
3
1
-202
1
2
-210
0
-1
-2
1
-42
-107
-1
3
1
65
1
27
3
2
-59
63
3
-3
-268
-77
-1
-75
-105
11
-14
3
1
2
-199
-3
-1
-81
-1
-128
-2
-2
-85
-3
-201
-1
1
79
2
3
95
-2
139
1
146
-23
1
-143
-2
-3
1
-1
2
-106
-3
-2
1
-201
4
1
-2
-1
-1
2
-1
-1
-304
3
-180
83
1
-3
11
91
8...

result:

ok good one

Test #19:

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

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: 62ms
memory: 34420kb

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:

15
-3
3
-35
-2
2
-3
-1
2
-3
-3
1
88
2
0
0
-317
-2
-78
-3
-69
1
0
-194
234
1
14
2
0
3
1
0
-1
1
0
0
0
-1
347
3
1
1
0
18
1
0
-33
-404
0
0
2
3
-1
-1
-422
-3
3
-269
1
3
2
3
2
3
0
3
0
-254
0
285
1
97
-267
1
1
-50
3
-1
1
0
1
2
2
3
-305
1
-39
2
-2
1
-3
2
196
0
-2
-136
1
-1
146
1
-1
2
-1
0
0
59
-183
-3
391
-...

result:

ok good one

Test #21:

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

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:

504
1
-1
-2
2
-2
-394
0
-185
-2
6
0
2
3
2
-86
139
-209
379
-456
-1
3
-2
-3
3
3
76
0
-14
75
-87
-1
2
392
1
1
2
-478
3
1
0
2
2
-9
3
0
36
1
1
1
1
3
134
-1
0
1
213
-28
52
3
1
0
0
96
0
1
0
0
417
1
406
-247
0
-3
-92
74
47
-2
2
-17
0
-1
-85
1
0
3
-1
2
0
-1
0
-3
0
-2
-2
0
0
-3
257
2
51
1
0
2
0
-67
-1
2
-3
-...

result:

ok good one

Test #22:

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

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
-16
-122
0
0
81
2
0
-3
0
0
1
-40
0
-211
0
3
-12
-36
2
1
-219
3
0
-125
218
192
-183
1
-38
-246
1
36
-158
0
-3
-3
156
-29
0
-39
-1
0
1
3
3
1
173
3
1
0
21
2
-31
0
-1
1
-2
-224
-2
0
220
0
126
0
-129
0
-304
1
70
3
-2
-1
-103
-2
1
-1
0
-2
-139
-326
-220
3
0
-3
-159
-2
17
2
-2
-1
-445
0
0
-57
2
0
-461
3
...

result:

ok good one

Test #23:

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

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:

-2
0
0
20
0
77
33
-105
-71
-130
3
-177
1
-10
-1
0
0
0
0
-97
-120
35
69
32
-2
14
0
0
0
0
3
-1
-3
-200
3
-66
-3
2
-3
-1
-102
0
77
48
0
2
0
-2
-47
2
2
-2
7
0
-1
0
0
0
-1
-10
-29
58
1
138
1
-77
0
-139
-2
33
-58
0
-237
-222
0
0
49
-3
0
-3
-3
-83
-165
2
-87
-70
-115
-2
0
-2
2
3
0
-3
4
0
56
1
2
1
-2
0
-2
-...

result:

ok good one

Test #24:

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

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:

1
85
-3
-34
-1
-1
-52
1
2
-1
3
94
149
-1
1
0
0
-3
99
-135
-54
2
-1
0
235
3
2
12
-2
55
-3
-36
0
0
-3
-1
1
-3
-143
1
0
-104
32
-1
-2
11
155
95
1
-9
-158
46
-146
-89
1
-37
-3
0
0
-66
-1
1
0
3
-1
-2
114
-3
3
101
0
0
-2
0
2
-1
0
2
1
3
0
-43
1
1
2
0
104
91
1
0
-45
1
101
-55
30
-1
26
0
0
2
0
1
-1
124
1
1
2...

result:

ok good one

Test #25:

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

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:

3
-1
-89
-1
0
-94
3
-1
1
-262
2
0
-36
1
-264
211
-111
0
-1
1
-3
0
9
448
2
-3
0
0
3
24
-27
19
0
-1
0
3
-1
0
-215
3
0
2
0
-11
-1
0
-206
3
1
-1
1
0
2
10
-36
0
-1
2
-147
-51
223
23
-78
0
-3
2
165
-477
0
3
3
-1
1
1
3
3
-2
-182
3
0
3
-2
0
-290
3
0
-422
-274
-1
0
-65
0
-602
-5
-2
-27
-1
-63
-1
-1
-3
0
221
...

result:

ok good one

Test #26:

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

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:

1
3
2
-97
-151
0
-67
1
-2
0
3
2
-73
2
-2
-1
3
-2
0
0
2
0
0
137
0
2
-2
-1
0
1
0
-53
-53
-3
-2
-370
0
-12
2
-3
-3
-113
1
-3
3
0
46
-3
-1
1
2
-3
-3
3
1
0
-102
-290
1
1
-1
-1
0
190
2
0
2
157
-26
-264
118
0
86
0
0
3
-153
-3
3
-132
43
-1
3
-3
-1
0
-22
2
0
0
-2
3
-1
85
0
8
62
-1
3
-1
-1
164
3
-3
-115
-1
-3...

result:

ok good one

Test #27:

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

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:

-2
0
-168
-244
0
1
0
0
2
-3
1
0
-1
-219
2
-1
-1
194
0
2
-104
1
0
-76
-3
-181
3
-3
0
56
-1
3
-2
-3
3
1
-2
2
91
3
-199
0
-257
3
0
80
-1
0
-1
0
-12
-182
-111
0
0
3
242
32
1
-2
-2
-56
179
0
0
0
89
-3
2
1
-77
83
-48
-1
-120
1
-1
0
-1
-25
0
249
-195
1
0
-92
0
-11
0
-1
0
1
0
0
1
89
0
0
3
31
0
2
78
0
-22
2
...

result:

ok good one

Test #28:

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

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:

2
1
-2
1
-1
-1
1
3
1
-1
1
-1
-1
2
2
-3
1
1
1
-2
-1
2
3
1
1
2
1
-2
3
-2
-1
2
-1
-3
3
2
3
1
1
3
2
2
-3
2
-1
-2
2
-3
3
-1
-1
3
-1
-1
-3
2
-3
2
-1
-2
1
1
-2
3
2
-1
-1
1
-2
-3
1
-3
3
-1
-2
-2
1
-1
1
3
1
-2
-3
-1
-1
-1
1
-1
-1
-1
2
2
3
-1
3
1
1
-1
1
-1
1
1
1
1
-1
1
-2
-1
-1
-1
2
3
1
1
2
1
-2
-2
1
-1
-1
-1...

result:

ok good one

Test #29:

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

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:

1
-2
-1
-3
-1
-1
1
-3
1
2
1
-2
-3
-1
1
-3
-1
3
3
-3
-3
3
-2
1
3
2
2
1
-1
-1
-1
-2
1
-3
-2
-3
2
1
1
-2
-2
3
2
-2
2
1
-3
3
3
-1
-1
-3
-1
2
3
1
1
-2
1
-2
2
-2
-2
2
1
2
1
1
-2
-1
-1
-1
1
-1
-2
-1
1
-1
3
-1
1
-3
-1
2
1
-2
-1
3
3
-3
2
-1
2
3
3
-2
-2
-1
1
1
-3
-1
1
2
2
3
-2
-2
1
3
1
-1
3
3
-1
-1
-1
-1
3
-1...

result:

ok good one

Test #30:

score: -100
Wrong Answer
time: 55ms
memory: 41144kb

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
-1
-1
-3
-1
1
-3
-2
1
-1
-2
-2
-1
1
-1
-2
1
-2
1
-1
-3
-2
-2
-2
-2
2
-3
-1
-1
-3
3
-1
1
-1
1
-3
1
-2
2
-1
-1
2
3
2
3
-2
-1
-1
2
-3
1
-3
2
2
2
1
-3
-2
-3
3
1
2
-2
-2
-1
-1
-2
2
-2
-2
2
2
-1
1
3
3
3
-1
-1
-1
-2
-2
-3
-3
1
-1
-2
3
1
1
-1
2
-1
2
-2
3
-1
1
-3
1
-1
1
-3
3
-1
-2
-2
2
1
2
2
1
-1
-2
-2
-3...

result:

wrong answer Integer parameter [name=wire current strength] equals to -1039, violates the range [-1000, 1000]