QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#209408#3100. Meetings 2uoj100 ✓312ms58356kbC++202.1kb2023-10-10 14:53:542023-10-10 14:53:55

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 3ms
memory: 35288kb

input:

1

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 4ms
memory: 32376kb

input:

2
2 1

output:

1
2

result:

ok 2 lines

Test #3:

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

input:

3
1 3
3 2

output:

1
3
1

result:

ok 3 lines

Test #4:

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

input:

14
12 14
12 9
14 2
12 6
12 7
6 4
3 4
1 4
12 8
13 1
10 12
11 6
6 5

output:

1
7
1
5
1
3
1
3
1
2
1
2
1
2

result:

ok 14 lines

Test #5:

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

input:

14
10 14
3 10
14 13
1 3
3 5
3 11
12 14
14 6
11 8
2 3
7 8
9 7
1 4

output:

1
8
1
6
1
5
1
4
1
2
1
1
1
1

result:

ok 14 lines

Test #6:

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

input:

14
8 13
13 10
13 7
6 8
5 7
10 4
9 5
12 8
6 2
4 11
5 1
9 3
4 14

output:

1
8
1
6
1
5
1
4
1
2
1
1
1
1

result:

ok 14 lines

Test #7:

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

input:

14
9 2
9 8
3 8
14 9
13 3
1 2
5 2
9 6
4 2
4 11
10 6
12 10
7 9

output:

1
7
1
5
1
3
1
2
1
2
1
1
1
1

result:

ok 14 lines

Test #8:

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

input:

15
10 7
15 7
14 7
15 11
6 15
10 8
14 2
4 8
15 1
3 6
4 13
1 9
5 2
8 12

output:

1
8
1
6
1
4
1
4
1
3
1
2
1
1
1

result:

ok 15 lines

Test #9:

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

input:

16
11 8
11 10
10 1
11 2
15 8
13 10
9 2
2 4
8 6
2 7
3 7
12 9
6 16
9 14
12 5

output:

1
8
1
6
1
4
1
4
1
2
1
2
1
2
1
2

result:

ok 16 lines

Test #10:

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

input:

16
7 11
16 11
11 6
1 16
1 14
1 3
12 3
14 8
12 10
5 16
6 9
6 4
9 2
15 4
2 13

output:

1
10
1
8
1
6
1
4
1
4
1
4
1
2
1
2

result:

ok 16 lines

Test #11:

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

input:

16
13 3
16 13
16 5
16 8
3 12
11 16
14 8
15 12
3 10
10 2
16 1
6 10
11 9
8 4
1 7

output:

1
7
1
5
1
5
1
3
1
3
1
3
1
2
1
1

result:

ok 16 lines

Test #12:

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

input:

16
12 13
13 3
14 3
7 14
9 3
11 13
14 8
2 14
14 6
2 16
4 3
7 5
16 1
9 10
13 15

output:

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

result:

ok 16 lines

Test #13:

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

input:

16
1 7
15 1
8 1
15 12
7 2
1 13
13 14
12 3
3 16
11 3
9 3
10 12
2 5
6 7
9 4

output:

1
9
1
7
1
5
1
5
1
4
1
3
1
3
1
2

result:

ok 16 lines

Test #14:

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

input:

14
8 11
11 5
7 5
7 3
3 12
12 2
2 14
14 6
3 1
9 12
6 13
10 1
4 7

output:

1
10
1
8
1
6
1
4
1
3
1
2
1
1

result:

ok 14 lines

Test #15:

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

input:

14
6 8
9 8
1 9
1 3
3 10
5 10
13 5
11 13
11 12
12 14
7 14
4 7
4 2

output:

1
14
1
12
1
10
1
8
1
6
1
4
1
2

result:

ok 14 lines

Test #16:

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

input:

15
4 7
7 3
15 7
7 14
10 7
7 1
13 7
8 7
7 9
6 7
1 5
4 12
2 3
10 11

output:

1
5
1
3
1
1
1
1
1
1
1
1
1
1
1

result:

ok 15 lines

Test #17:

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

input:

16
14 7
15 14
14 5
14 2
14 12
11 14
13 14
14 10
3 14
14 9
14 16
14 6
1 14
14 8
4 14

output:

1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

ok 16 lines

Test #18:

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

input:

16
4 9
9 10
10 6
16 6
4 5
5 14
14 15
5 7
8 14
14 13
11 5
5 12
5 2
5 1
3 5

output:

1
8
1
6
1
5
1
4
1
2
1
1
1
1
1
1

result:

ok 16 lines

Test #19:

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

input:

15
4 15
4 10
1 4
5 4
4 12
14 4
11 4
4 13
13 9
6 9
6 7
2 13
2 8
3 2

output:

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

result:

ok 15 lines

Test #20:

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

input:

16
1 2
2 5
12 2
2 15
14 2
2 11
6 2
10 2
10 4
13 4
16 13
10 9
9 7
9 3
8 3

output:

1
7
1
5
1
3
1
3
1
2
1
2
1
2
1
2

result:

ok 16 lines

Test #21:

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

input:

15
11 15
15 6
15 12
15 2
15 14
9 15
7 15
13 15
4 1
4 3
13 3
8 13
10 8
5 10

output:

1
7
1
5
1
3
1
2
1
2
1
2
1
2
1

result:

ok 15 lines

Subtask #2:

score: 16
Accepted

Dependency #1:

100%
Accepted

Test #22:

score: 16
Accepted
time: 4ms
memory: 33032kb

input:

3985
2388 2281
2388 3669
2448 3669
2448 2962
3147 2448
2166 2388
209 3147
2325 2388
1584 3147
1349 3669
3525 3147
2962 2698
1349 660
2281 553
3454 3147
2325 3651
3339 2281
2281 3565
1584 1621
1584 2118
819 3339
72 2166
2025 660
553 2331
3266 209
2166 2930
2432 3454
3677 3525
368 1349
553 519
3677 28...

output:

1
34
1
32
1
31
1
30
1
29
1
28
1
28
1
28
1
28
1
27
1
27
1
27
1
27
1
27
1
27
1
27
1
26
1
26
1
25
1
25
1
24
1
24
1
23
1
23
1
23
1
23
1
22
1
22
1
22
1
22
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
18
1
18
1
18
1
18
1
18
...

result:

ok 3985 lines

Test #23:

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

input:

3986
1021 3515
726 1021
757 1021
1483 1021
483 1483
3239 483
1021 2531
757 1622
483 2480
90 1622
483 3977
90 3459
757 1821
761 3239
3022 757
726 669
2327 90
3585 3022
279 3977
3977 2484
846 1622
1021 2639
2754 3515
1176 1021
96 483
3585 3604
2327 1741
2327 1759
2480 2457
2327 306
3977 3422
1233 3977...

output:

1
35
1
33
1
31
1
29
1
29
1
28
1
28
1
28
1
26
1
26
1
26
1
25
1
24
1
24
1
24
1
24
1
24
1
24
1
23
1
23
1
23
1
22
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
19
1
19
1
19
1
19
1
19
1
19
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
...

result:

ok 3986 lines

Test #24:

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

input:

3942
2742 1586
1768 2742
1586 3325
1768 673
3166 673
1392 3166
1764 2742
3846 673
673 24
24 1880
3325 2461
180 24
2461 1825
1586 3232
369 3325
2322 24
180 1198
36 1825
1880 865
3625 865
3325 2289
3625 1318
1825 1393
1309 36
88 1768
36 570
2588 570
36 3621
3925 1764
1090 2742
674 570
180 3150
118 362...

output:

1
43
1
41
1
39
1
37
1
37
1
36
1
35
1
34
1
34
1
34
1
33
1
33
1
32
1
32
1
32
1
31
1
31
1
31
1
30
1
30
1
30
1
29
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
28
1
27
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
26
1
24
1
24
1
24
1
24
...

result:

ok 3942 lines

Test #25:

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

input:

3960
750 291
750 1350
2287 291
2287 1155
590 1350
1350 2483
590 2452
3626 291
291 249
2287 570
491 590
2491 1155
1155 870
1155 2397
750 259
491 3488
3488 1848
3107 750
705 3626
570 3649
3411 2397
2483 3770
1415 590
454 3488
2960 1350
259 2224
1415 648
2254 491
2864 705
249 1567
275 1350
2757 491
107...

output:

1
30
1
28
1
27
1
25
1
24
1
23
1
22
1
22
1
22
1
20
1
20
1
20
1
20
1
20
1
19
1
19
1
19
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
17
1
17
1
17
1
17
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
15
1
15
1
15
1
15
1
14
1
14
1
14
1
14
1
14
1
14
1
14
1
14
...

result:

ok 3960 lines

Test #26:

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

input:

3949
3764 3701
2864 3701
1554 3701
578 2864
3701 3539
3539 1974
3539 88
3701 1236
578 2111
3012 88
1895 3764
273 1236
1174 2864
222 578
1895 3149
3539 2629
3429 2111
1544 3429
1554 190
2069 2111
1236 3542
578 3658
2762 1974
3424 1895
1133 2762
3658 3527
1895 696
2721 2762
3539 452
88 3610
2721 3147
...

output:

1
31
1
29
1
29
1
27
1
26
1
26
1
25
1
24
1
24
1
24
1
23
1
23
1
22
1
21
1
21
1
21
1
21
1
21
1
21
1
20
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
16
1
16
1
16
1
15
1
14
1
14
1
14
1
14
1
14
1
14
1
14
1
13
1
13
1
13
...

result:

ok 3949 lines

Test #27:

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

input:

4000
3523 3550
3523 3231
1960 3523
308 3550
3766 1960
3638 3550
1398 308
308 172
3550 3214
3638 3212
1973 3231
448 172
3214 1726
2761 3550
1792 3212
1973 538
3231 1838
3491 2761
172 1551
2340 448
1484 2761
3214 2034
448 2208
189 3212
800 3550
3214 1033
189 1504
2051 3638
941 1726
1805 1398
230 538
3...

output:

1
34
1
32
1
31
1
29
1
29
1
28
1
27
1
26
1
26
1
26
1
26
1
26
1
25
1
25
1
25
1
24
1
24
1
24
1
24
1
24
1
22
1
22
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
20
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
19
1
18
1
18
1
18
1
18
1
18
...

result:

ok 4000 lines

Test #28:

score: 0
Accepted
time: 4ms
memory: 32328kb

input:

4000
2627 2898
2898 314
3345 2627
314 2466
3345 1095
3031 314
1095 2542
3074 2627
3391 3031
2898 89
3314 2898
3415 2898
2542 12
49 314
2361 314
2131 2361
3031 920
2131 2303
3074 368
3915 1095
565 12
89 284
2303 1975
2312 2466
2131 3901
3481 12
3712 2627
49 3860
350 2131
3031 3489
686 2361
3415 340
3...

output:

1
33
1
31
1
29
1
29
1
28
1
26
1
26
1
26
1
26
1
24
1
24
1
24
1
24
1
24
1
24
1
23
1
22
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
21
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
19
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
17
1
17
1
17
1
17
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
...

result:

ok 4000 lines

Test #29:

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

input:

4000
2089 2753
2753 1171
3685 2753
2089 584
2089 2113
2865 3685
2113 3150
1828 2089
2753 170
227 2089
157 2753
584 906
3150 2429
2113 2332
227 2972
227 1358
2478 906
2113 3791
170 273
1171 3846
1358 3727
2972 1844
1989 2865
3791 2995
2933 3685
1171 3992
584 682
2865 1771
256 3150
796 584
614 1844
27...

output:

1
31
1
29
1
27
1
26
1
26
1
26
1
25
1
25
1
24
1
24
1
23
1
23
1
23
1
22
1
22
1
20
1
19
1
18
1
18
1
18
1
18
1
18
1
18
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
14
1
13
1
13
1
13
1
13
1
13
1
13
1
13
1
13
1
13
1
13
...

result:

ok 4000 lines

Test #30:

score: 0
Accepted
time: 8ms
memory: 32528kb

input:

4000
3023 347
697 347
697 3559
3559 1639
3344 697
347 3237
2644 347
697 3054
64 3023
697 767
2417 2644
1993 3237
380 2417
140 3054
2900 1993
1483 3559
1515 3054
3395 2417
347 3304
697 2805
3559 3519
2644 196
3989 2417
2805 2464
1326 2417
2900 1703
2496 697
767 3098
790 196
954 1326
219 1639
790 31
3...

output:

1
32
1
30
1
28
1
27
1
26
1
26
1
24
1
24
1
23
1
23
1
23
1
22
1
22
1
22
1
21
1
21
1
20
1
20
1
20
1
20
1
19
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
18
1
17
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
1
15
...

result:

ok 4000 lines

Test #31:

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

input:

4000
609 943
2191 943
609 3385
3560 609
3385 3309
3278 609
609 3625
2260 2191
943 1008
1626 2191
2332 3278
1305 609
1386 3625
1008 503
3278 45
3309 1355
3222 3625
2260 3488
2547 3222
2260 1154
3385 2503
1038 3625
2503 3211
1305 2011
2332 3944
1355 190
2187 3385
2187 1252
3211 625
1843 3488
943 2650
...

output:

1
33
1
31
1
29
1
27
1
26
1
26
1
26
1
25
1
24
1
23
1
22
1
22
1
22
1
22
1
21
1
20
1
20
1
20
1
20
1
20
1
19
1
19
1
19
1
19
1
19
1
19
1
18
1
18
1
18
1
18
1
18
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
17
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
16
1
15
1
15
1
15
1
15
1
15
1
15
...

result:

ok 4000 lines

Test #32:

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

input:

3999
3551 1490
2942 1490
2942 2444
1082 2444
2671 1082
2671 500
500 316
3049 316
3049 3475
3515 3475
3515 982
982 2792
2792 1105
1105 3699
3699 506
651 506
2766 651
2766 2563
1176 2563
1176 430
1543 430
3814 1543
3814 2327
3925 2327
3925 2880
2880 2300
3098 2300
3098 2635
2635 3567
3567 2168
1216 21...

output:

1
2321
1
2319
1
2318
1
2318
1
2317
1
2316
1
2314
1
2313
1
2311
1
2311
1
2309
1
2308
1
2306
1
2304
1
2302
1
2301
1
2301
1
2299
1
2297
1
2297
1
2297
1
2297
1
2295
1
2294
1
2294
1
2293
1
2291
1
2289
1
2288
1
2287
1
2286
1
2286
1
2285
1
2285
1
2284
1
2284
1
2283
1
2282
1
2281
1
2279
1
2278
1
2277
1
2277...

result:

ok 3999 lines

Test #33:

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

input:

3999
3918 3738
3738 3159
3784 3159
3784 111
111 254
2011 254
2011 3528
439 3528
3108 439
3206 3108
2525 3206
2562 2525
653 2562
3387 653
2559 3387
1694 2559
1694 58
2863 58
2863 230
230 1722
3589 1722
3589 876
2498 876
2498 1843
1843 3798
3798 406
406 3467
464 3467
464 335
335 3457
3566 3457
3566 33...

output:

1
3999
1
3997
1
3995
1
3993
1
3991
1
3989
1
3987
1
3985
1
3983
1
3981
1
3979
1
3977
1
3975
1
3973
1
3971
1
3969
1
3967
1
3965
1
3963
1
3961
1
3959
1
3957
1
3955
1
3953
1
3951
1
3949
1
3947
1
3945
1
3943
1
3941
1
3939
1
3937
1
3935
1
3933
1
3931
1
3929
1
3927
1
3925
1
3923
1
3921
1
3919
1
3917
1
3915...

result:

ok 3999 lines

Test #34:

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

input:

3999
2214 374
374 2802
734 374
374 600
374 348
2277 374
374 672
374 3440
3264 374
374 3690
374 3344
374 884
2491 374
1489 374
374 3417
2379 374
374 2966
374 1772
374 1300
3835 374
374 1182
3615 374
1101 374
3854 374
2158 374
1485 374
374 1728
374 579
374 2092
2766 374
374 3159
3611 374
3258 374
374 ...

output:

1
14
1
12
1
11
1
11
1
9
1
8
1
7
1
6
1
4
1
4
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 3999 lines

Test #35:

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

input:

4000
2958 816
90 2958
2958 1232
2958 3524
14 2958
2958 3175
3375 2958
1924 2958
3815 2958
1291 2958
2958 3618
301 2958
2958 580
2958 3945
3851 2958
2958 2466
2958 2968
2958 1472
2958 2235
456 2958
2958 2654
2958 350
2958 274
2958 373
2958 2422
2958 3589
2958 1283
2958 2903
2658 2958
3980 2958
2958 1...

output:

1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 4000 lines

Test #36:

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

input:

4000
3280 1562
3962 3280
3962 3612
2987 3612
2987 1483
1483 453
453 1853
3554 1853
3349 3554
3349 3321
3321 2907
1224 2907
2835 1224
3372 2835
809 3372
809 2413
744 2413
3342 744
3342 2722
2722 3799
477 3799
1855 477
1855 3736
3736 2680
2680 499
499 2645
2645 1643
1643 426
690 426
690 560
560 2486
8...

output:

1
176
1
174
1
173
1
172
1
170
1
169
1
167
1
166
1
164
1
163
1
161
1
160
1
158
1
157
1
155
1
154
1
152
1
151
1
149
1
148
1
146
1
145
1
143
1
142
1
140
1
139
1
137
1
136
1
134
1
133
1
131
1
130
1
128
1
127
1
125
1
124
1
122
1
121
1
119
1
118
1
116
1
115
1
113
1
112
1
110
1
109
1
107
1
106
1
104
1
103
...

result:

ok 4000 lines

Test #37:

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

input:

4000
3203 2979
2436 2979
2635 2979
2020 2979
2979 962
1025 2979
3728 2979
531 2979
2979 847
2979 1896
2979 2707
2979 679
1720 2979
2979 2187
2979 2340
2740 2979
3023 2979
2979 2202
2979 3983
2979 3820
2979 31
2979 646
244 2979
2972 2979
2979 2605
831 2979
2979 2218
2979 41
2979 3840
635 2979
2979 21...

output:

1
30
1
28
1
27
1
26
1
25
1
24
1
24
1
24
1
24
1
24
1
24
1
24
1
24
1
24
1
24
1
24
1
24
1
24
1
24
1
23
1
22
1
21
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
20
1
19
1
18
1
17
1
16
1
16
1
16
1
16
...

result:

ok 4000 lines

Test #38:

score: 0
Accepted
time: 4ms
memory: 33372kb

input:

3999
1409 586
479 1409
3623 1409
3156 1409
1409 501
1409 230
1409 2776
1409 3132
1409 1130
1727 1409
1409 2829
1409 3176
1409 159
1409 3809
1409 1619
1409 811
2322 1409
3090 1409
2300 1409
1409 215
2407 1409
1409 1553
1409 659
3403 1409
2222 1409
1409 418
1409 98
1409 1238
1479 1409
1409 3883
3320 1...

output:

1
1999
1
1997
1
1995
1
1993
1
1991
1
1989
1
1987
1
1985
1
1983
1
1981
1
1979
1
1977
1
1975
1
1973
1
1971
1
1969
1
1967
1
1965
1
1963
1
1961
1
1959
1
1957
1
1955
1
1953
1
1951
1
1949
1
1947
1
1945
1
1943
1
1941
1
1939
1
1937
1
1935
1
1933
1
1931
1
1929
1
1927
1
1925
1
1923
1
1921
1
1919
1
1917
1
1915...

result:

ok 3999 lines

Subtask #3:

score: 80
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #39:

score: 80
Accepted
time: 180ms
memory: 51172kb

input:

196145
73351 68596
144883 68596
144883 77440
158554 77440
70653 73351
84095 77440
84095 107513
10720 73351
43180 77440
77440 172445
144883 18265
190722 10720
38486 84095
1238 68596
68596 53427
73990 70653
38486 182078
121987 190722
182693 190722
190722 22959
119892 68596
158028 144883
10720 49607
10...

output:

1
52
1
50
1
48
1
48
1
46
1
44
1
44
1
44
1
43
1
43
1
42
1
41
1
41
1
41
1
41
1
41
1
41
1
40
1
40
1
40
1
40
1
40
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
38
1
38
1
38
1
37
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
...

result:

ok 196145 lines

Test #40:

score: 0
Accepted
time: 176ms
memory: 48260kb

input:

192033
54553 30215
54553 185329
30215 133088
156207 54553
115933 133088
54553 63805
63805 139718
30215 2780
30215 191725
151837 2780
2780 93591
54553 59959
151837 14777
133088 171080
133088 178337
59959 40848
166838 185329
146753 178337
108283 93591
148600 171080
108283 190494
54553 60795
11272 1397...

output:

1
52
1
50
1
48
1
46
1
45
1
44
1
43
1
43
1
42
1
41
1
41
1
40
1
40
1
39
1
39
1
38
1
38
1
38
1
38
1
38
1
38
1
37
1
37
1
37
1
37
1
37
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
36
1
35
1
35
1
35
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
...

result:

ok 192033 lines

Test #41:

score: 0
Accepted
time: 178ms
memory: 47272kb

input:

196603
170388 25545
11159 25545
107159 11159
11159 80250
92811 170388
92811 8511
107159 153831
170388 109808
25545 105804
148259 92811
148259 158822
124605 92811
11159 63458
148259 41829
98276 158822
54562 148259
153831 45932
8511 177096
107159 135894
135894 144763
107159 182215
127686 124605
92811 ...

output:

1
51
1
49
1
47
1
46
1
45
1
44
1
44
1
43
1
43
1
43
1
43
1
42
1
42
1
41
1
40
1
40
1
39
1
39
1
39
1
39
1
38
1
38
1
38
1
38
1
37
1
37
1
37
1
35
1
35
1
35
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
34
1
33
1
33
1
33
1
33
1
33
1
33
1
33
1
33
1
33
1
33
1
33
...

result:

ok 196603 lines

Test #42:

score: 0
Accepted
time: 166ms
memory: 48804kb

input:

200000
195129 72334
196911 72334
10300 195129
72334 170139
296 10300
164032 170139
195129 191523
92869 72334
90499 195129
87804 170139
51382 87804
65650 191523
51382 161126
170139 34139
32880 170139
170139 37918
51383 296
198144 191523
86218 164032
65236 51382
34139 173213
38129 170139
195129 107166...

output:

1
52
1
50
1
48
1
48
1
47
1
46
1
46
1
46
1
46
1
45
1
45
1
45
1
44
1
44
1
43
1
43
1
43
1
43
1
42
1
42
1
42
1
40
1
40
1
40
1
40
1
40
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
38
1
38
1
38
1
38
1
38
1
38
1
38
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
36
1
36
1
36
1
36
...

result:

ok 200000 lines

Test #43:

score: 0
Accepted
time: 178ms
memory: 48988kb

input:

200000
51808 55920
51808 107133
99481 107133
48473 99481
107133 84201
169239 55920
45126 99481
169239 130080
48473 139103
34490 84201
34490 89448
198530 48473
84201 166142
98664 130080
51808 119149
3620 48473
45126 34483
176146 34483
50870 89448
83510 166142
89448 16525
81629 50870
79392 48473
85111...

output:

1
53
1
51
1
49
1
47
1
46
1
46
1
46
1
45
1
44
1
44
1
43
1
42
1
42
1
42
1
42
1
41
1
41
1
41
1
41
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
39
1
38
1
38
1
38
1
38
1
38
1
38
1
38
1
38
1
38
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
...

result:

ok 200000 lines

Test #44:

score: 0
Accepted
time: 158ms
memory: 47392kb

input:

200000
81667 85919
81667 48156
45385 85919
164235 45385
48156 40522
85919 158251
196015 40522
164235 132737
107652 158251
19736 132737
20724 158251
62404 40522
158251 83935
164235 189115
164235 149142
19736 162891
98222 83935
98222 112573
2181 164235
62404 65267
62404 161814
45385 127645
149142 2727...

output:

1
53
1
51
1
50
1
50
1
49
1
47
1
47
1
47
1
47
1
47
1
46
1
44
1
44
1
44
1
43
1
42
1
42
1
42
1
42
1
42
1
42
1
42
1
42
1
42
1
41
1
41
1
41
1
41
1
41
1
41
1
41
1
41
1
41
1
41
1
41
1
41
1
39
1
39
1
39
1
39
1
39
1
38
1
38
1
38
1
38
1
38
1
38
1
38
1
38
1
38
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
1
37
...

result:

ok 200000 lines

Test #45:

score: 0
Accepted
time: 307ms
memory: 54628kb

input:

199999
131003 152187
39261 131003
117174 39261
198536 117174
198536 195246
133452 195246
133452 154413
48622 154413
48622 8458
8458 140326
140326 100582
21675 100582
21675 132330
132330 143082
143082 67546
155514 67546
28153 155514
28153 139327
139327 152496
10461 152496
192620 10461
192620 51043
51...

output:

1
100237
1
100235
1
100233
1
100231
1
100231
1
100230
1
100230
1
100229
1
100228
1
100226
1
100225
1
100225
1
100224
1
100222
1
100221
1
100221
1
100220
1
100218
1
100217
1
100216
1
100214
1
100214
1
100213
1
100212
1
100212
1
100211
1
100210
1
100210
1
100210
1
100210
1
100210
1
100209
1
100208
1
1...

result:

ok 199999 lines

Test #46:

score: 0
Accepted
time: 312ms
memory: 56296kb

input:

200000
76652 37343
164946 37343
164946 40924
178243 40924
15314 178243
15314 175356
193315 175356
195257 193315
63236 195257
152807 63236
152807 156774
156774 119818
149548 119818
149548 16665
185255 16665
32600 185255
172560 32600
101628 172560
101628 120185
148638 120185
148638 16064
16064 40398
4...

output:

1
200000
1
199998
1
199996
1
199994
1
199992
1
199990
1
199988
1
199986
1
199984
1
199982
1
199980
1
199978
1
199976
1
199974
1
199972
1
199970
1
199968
1
199966
1
199964
1
199962
1
199960
1
199958
1
199956
1
199954
1
199952
1
199950
1
199948
1
199946
1
199944
1
199942
1
199940
1
199938
1
199936
1
1...

result:

ok 200000 lines

Test #47:

score: 0
Accepted
time: 64ms
memory: 48196kb

input:

199999
116128 120838
12695 116128
116128 119659
127275 116128
78081 116128
37256 116128
157244 116128
116128 58397
116128 124666
116128 47836
102907 116128
116128 188259
116128 121074
116128 148659
116128 78565
116128 47984
116128 120563
116128 97604
7177 116128
53803 116128
39405 116128
116128 1511...

output:

1
15
1
13
1
11
1
10
1
9
1
8
1
6
1
5
1
5
1
5
1
3
1
3
1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 199999 lines

Test #48:

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

input:

199999
40293 197066
40293 25544
127774 40293
48244 40293
40233 40293
40293 44971
40293 22098
165651 40293
40293 199826
40293 57347
40293 171021
149828 40293
145841 40293
111683 40293
40293 16818
48318 40293
188512 40293
115937 40293
40293 29149
40293 137832
40293 52561
40293 40398
40293 45892
40293 ...

output:

1
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

result:

ok 199999 lines

Test #49:

score: 0
Accepted
time: 191ms
memory: 50168kb

input:

200000
161686 144948
139056 144948
139056 65439
65439 78262
17375 78262
98698 17375
108579 98698
108579 131017
184264 131017
184264 99107
29026 99107
44056 29026
44056 25217
25217 56740
56740 326
326 85118
10403 85118
10403 129265
105548 129265
105548 18798
18798 89826
117258 89826
153274 117258
153...

output:

1
1264
1
1262
1
1261
1
1260
1
1258
1
1257
1
1255
1
1254
1
1252
1
1251
1
1249
1
1248
1
1246
1
1245
1
1243
1
1242
1
1240
1
1239
1
1237
1
1236
1
1234
1
1233
1
1231
1
1230
1
1228
1
1227
1
1225
1
1224
1
1222
1
1221
1
1219
1
1218
1
1216
1
1215
1
1213
1
1212
1
1210
1
1209
1
1207
1
1206
1
1204
1
1203
1
1201...

result:

ok 200000 lines

Test #50:

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

input:

200000
56452 126051
110256 56452
8593 56452
6092 56452
56452 175725
38177 56452
56452 34265
20336 56452
50807 56452
197721 56452
56452 143251
56452 74629
101213 56452
56452 88400
56452 103789
139938 56452
56452 105338
136808 56452
56452 61528
157315 56452
170111 56452
157100 56452
56452 136398
53379...

output:

1
48
1
46
1
45
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
44
1
43
1
42
1
41
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
1
40
...

result:

ok 200000 lines

Test #51:

score: 0
Accepted
time: 191ms
memory: 58356kb

input:

199999
48518 178898
48518 58716
48518 189893
15510 48518
120541 48518
197439 48518
48518 5337
182417 48518
136939 48518
47432 48518
48518 194155
48518 118410
107742 48518
47156 48518
48518 97605
48518 84111
45317 48518
48518 132576
135916 48518
48518 174865
48518 181008
172386 48518
48518 169255
485...

output:

1
99999
1
99997
1
99995
1
99993
1
99991
1
99989
1
99987
1
99985
1
99983
1
99981
1
99979
1
99977
1
99975
1
99973
1
99971
1
99969
1
99967
1
99965
1
99963
1
99961
1
99959
1
99957
1
99955
1
99953
1
99951
1
99949
1
99947
1
99945
1
99943
1
99941
1
99939
1
99937
1
99935
1
99933
1
99931
1
99929
1
99927
1
99...

result:

ok 199999 lines

Extra Test:

score: 0
Extra Test Passed