QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#578126#5545. Contingency PlanGuanYunchangAC ✓87ms39628kbC++173.7kb2024-09-20 16:48:092024-09-20 16:48:09

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

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

result:

ok AC

Test #2:

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

input:

3
1 2
2 3

output:

-1

result:

ok AC

Test #3:

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

input:

2
2 1

output:

-1

result:

ok AC

Test #4:

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

input:

5
2 1
2 3
2 4
4 5

output:

1 5
1 3
2 5
4 1

result:

ok AC

Test #5:

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

input:

5
1 4
3 4
4 5
2 5

output:

1 2
1 3
4 2
5 1

result:

ok AC

Test #6:

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

input:

5
5 2
1 2
4 2
3 4

output:

5 3
5 1
2 3
4 5

result:

ok AC

Test #7:

score: 0
Accepted
time: 6ms
memory: 9256kb

input:

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

output:

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

result:

ok AC

Test #8:

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

input:

20000
7662 1
9205 1
5971 1
1 9886
1 18853
14108 1
998 1
1 14958
7100 1
1 2670
1 18493
13838 1
4644 1
2139 1
1 18540
1 14081
1 16836
1 9357
245 1
242 1
1 13472
1 1471
3792 1
1 17875
13976 1
1 15085
1 17283
15014 1
17477 1
11578 1
18441 1
1 14367
3018 1
1 7186
1 4939
2470 1
2993 1
6175 1
1 19886
1 125...

output:

7662 17029
7662 9205
7662 5971
7662 9886
7662 18853
7662 14108
7662 998
7662 14958
7662 7100
7662 2670
7662 18493
7662 13838
7662 4644
7662 2139
7662 18540
7662 14081
7662 16836
7662 9357
7662 245
7662 242
7662 13472
7662 1471
7662 3792
7662 17875
7662 13976
7662 15085
7662 17283
7662 15014
7662 174...

result:

ok AC

Test #9:

score: 0
Accepted
time: 12ms
memory: 9384kb

input:

20000
8854 1
15635 1
8088 1
1 12138
12367 1
1 15051
6392 1
15564 1
17334 1
1 10164
8704 1
1 13795
1 10292
12108 1
1 50
4 1
1 18364
13341 1
19203 1
1 3017
1 5133
3499 1
19202 1
1 10304
12975 1
1 17220
1 1716
1 4158
1 16763
1 301
1 16645
8690 1
1 10064
16977 1
1 19618
1 5471
1 8763
3997 1
1 3283
11332...

output:

8854 18216
8854 15635
8854 8088
8854 12138
8854 12367
8854 15051
8854 6392
8854 15564
8854 17334
8854 10164
8854 8704
8854 13795
8854 10292
8854 12108
8854 50
8854 4
8854 18364
8854 13341
8854 19203
8854 3017
8854 5133
8854 3499
8854 19202
8854 10304
8854 12975
8854 17220
8854 1716
8854 4158
8854 16...

result:

ok AC

Test #10:

score: 0
Accepted
time: 9ms
memory: 9252kb

input:

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

output:

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

result:

ok AC

Test #11:

score: 0
Accepted
time: 12ms
memory: 9232kb

input:

20000
1 13291
13291 19998
3314 13291
13291 3339
13291 10237
13244 13291
13291 3392
13291 4459
13291 17335
13291 10356
6124 13291
13291 4470
12896 13291
13291 12094
3309 13291
13319 13291
13291 15658
13291 2305
13291 13710
13291 16520
13291 16234
6697 13291
13291 6686
9187 13291
13291 43
13291 2764
1...

output:

1 19555
1 19998
1 3314
1 3339
1 10237
1 13244
1 3392
1 4459
1 17335
1 10356
1 6124
1 4470
1 12896
1 12094
1 3309
1 13319
1 15658
1 2305
1 13710
1 16520
1 16234
1 6697
1 6686
1 9187
1 43
1 2764
1 9061
1 8113
1 8449
1 3304
1 16249
1 3859
1 5651
1 8941
1 13460
1 19932
1 10868
1 10878
1 12114
1 2249
1 8...

result:

ok AC

Test #12:

score: 0
Accepted
time: 11ms
memory: 9288kb

input:

20000
4030 5565
1206 5565
5565 8947
4887 5565
14605 5565
5565 2947
5565 9038
5565 5326
5565 9021
11087 5565
5565 19562
895 5565
14653 5565
5565 10803
5565 9750
5565 16331
4689 5565
14307 5565
11631 5565
5565 13244
10554 5565
8112 5565
5565 9394
5565 5945
15279 5565
5565 15512
1334 5565
5565 6025
556...

output:

4030 9353
4030 1206
4030 8947
4030 4887
4030 14605
4030 2947
4030 9038
4030 5326
4030 9021
4030 11087
4030 19562
4030 895
4030 14653
4030 10803
4030 9750
4030 16331
4030 4689
4030 14307
4030 11631
4030 13244
4030 10554
4030 8112
4030 9394
4030 5945
4030 15279
4030 15512
4030 1334
4030 6025
4030 1956...

result:

ok AC

Test #13:

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

input:

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

output:

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

result:

ok AC

Test #14:

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

input:

5
2 1
3 2
4 3
5 4

output:

1 5
2 5
3 5
4 1

result:

ok AC

Test #15:

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

input:

100000
21871 1
13678 1
27196 1
70437 1
1 35891
1 43010
28018 1
1 64489
61157 1
1 35572
1 41613
1 73049
93865 1
83507 1
1 92127
86278 1
1 15004
1 44154
2005 1
1 94210
41410 1
1 5886
69836 1
1 24120
1 80802
1 9940
66220 1
66549 1
1 20103
1 5
1 33021
35482 1
76185 1
34850 1
1 55173
1 72488
1 76286
1 99...

output:

21871 99803
21871 13678
21871 27196
21871 70437
21871 35891
21871 43010
21871 28018
21871 64489
21871 61157
21871 35572
21871 41613
21871 73049
21871 93865
21871 83507
21871 92127
21871 86278
21871 15004
21871 44154
21871 2005
21871 94210
21871 41410
21871 5886
21871 69836
21871 24120
21871 80802
21...

result:

ok AC

Test #16:

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

input:

100000
1 12976
28108 1
87682 1
79359 1
16128 1
1 90652
1 55874
27276 1
1 66899
1 10296
1 37870
1 78978
26221 1
28589 1
1 46430
32252 1
22407 1
68230 1
64944 1
1 53457
31023 1
1 57101
1 82578
1 33273
69683 1
64357 1
1 32517
1 45623
1 29497
41082 1
1 43731
1 28620
1 64304
1 23462
1 81982
1 91877
1 309...

output:

12976 78172
12976 28108
12976 87682
12976 79359
12976 16128
12976 90652
12976 55874
12976 27276
12976 66899
12976 10296
12976 37870
12976 78978
12976 26221
12976 28589
12976 46430
12976 32252
12976 22407
12976 68230
12976 64944
12976 53457
12976 31023
12976 57101
12976 82578
12976 33273
12976 69683
...

result:

ok AC

Test #17:

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

input:

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

output:

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

result:

ok AC

Test #18:

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

input:

100000
15924 1
13919 15924
86413 15924
15924 78418
36904 15924
15924 60478
15924 78563
15924 23855
63531 15924
15574 15924
73713 15924
62532 15924
15924 19461
15924 80750
15924 57012
15924 27046
55780 15924
69619 15924
58970 15924
65824 15924
15924 3195
26782 15924
71411 15924
84915 15924
95347 1592...

output:

1 26907
1 13919
1 86413
1 78418
1 36904
1 60478
1 78563
1 23855
1 63531
1 15574
1 73713
1 62532
1 19461
1 80750
1 57012
1 27046
1 55780
1 69619
1 58970
1 65824
1 3195
1 26782
1 71411
1 84915
1 95347
1 53739
1 88602
1 19186
1 23093
1 21581
1 95624
1 48747
1 91189
1 63350
1 63254
1 669
1 33246
1 4974
...

result:

ok AC

Test #19:

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

input:

100000
40659 47250
51514 40659
40659 83613
16333 40659
25291 40659
40659 61711
40659 37621
40659 66805
40659 59550
67744 40659
40659 46644
40659 21771
40659 98164
40659 6655
75053 40659
90431 40659
40659 58023
48769 40659
11506 40659
19125 40659
52852 40659
98702 40659
53360 40659
40659 3999
66767 4...

output:

47250 86919
47250 51514
47250 83613
47250 16333
47250 25291
47250 61711
47250 37621
47250 66805
47250 59550
47250 67744
47250 46644
47250 21771
47250 98164
47250 6655
47250 75053
47250 90431
47250 58023
47250 48769
47250 11506
47250 19125
47250 52852
47250 98702
47250 53360
47250 3999
47250 66767
47...

result:

ok AC

Test #20:

score: 0
Accepted
time: 13ms
memory: 9072kb

input:

20000
13211 1
1 10767
13211 16998
13211 495
10767 7635
10767 6994
10669 16998
1369 16998
495 4745
722 495
7635 251
3552 7635
7267 6994
6994 1772
10669 18929
10669 9328
3076 1369
1369 14212
4745 284
4745 9599
722 6137
722 10565
15137 251
5349 251
16431 3552
3552 15719
7267 10917
598 7267
19533 1772
1...

output:

1 12158
10767 12158
13211 12158
851 495
7635 12158
851 6994
16998 12158
851 1369
851 4745
851 722
251 12158
851 3552
851 7267
851 1772
10669 12158
851 9328
851 3076
851 14212
851 284
851 9599
851 6137
851 10565
15137 12158
851 5349
851 16431
851 15719
851 10917
851 598
851 19533
851 5233
18929 12158...

result:

ok AC

Test #21:

score: 0
Accepted
time: 14ms
memory: 9224kb

input:

20000
11262 14400
16805 2790
19084 11979
15259 5949
9916 12236
2445 1637
1905 15141
9540 16655
12812 16186
19052 1523
6643 1443
13738 10091
9218 1337
16617 16436
17295 16466
1171 1217
19150 5280
2830 8076
16135 7234
11460 213
8101 341
5438 6331
5029 14871
10725 2090
5998 12241
8902 3420
4340 7265
18...

output:

3502 14400
3502 16805
3502 11979
3502 5949
3502 9916
3502 2445
3502 15141
3502 16655
3502 16186
3502 1523
3502 1443
3502 10091
3502 9218
3502 16617
3502 16466
3502 1217
3502 19150
3502 2830
3502 7234
3502 11460
3502 8101
3502 6331
3502 14871
3502 10725
3502 12241
3502 8902
3502 7265
3502 5618
3502 1...

result:

ok AC

Test #22:

score: 0
Accepted
time: 13ms
memory: 9004kb

input:

20000
19272 1
19272 7240
6952 7240
6952 10594
12564 10594
12564 13132
14483 13132
14483 1891
9772 1891
16614 9772
14519 16614
12050 14519
4039 12050
4039 9679
8408 4039
12050 6797
17990 6797
6797 17659
14519 14985
16415 14985
1735 16415
16415 18821
14985 9402
9402 18947
9402 5386
17560 16614
17560 1...

output:

19272 12423
7240 12423
6952 12423
10594 12423
12564 12423
13132 12423
14483 12423
1891 12423
9772 12423
16614 12423
14519 12423
12050 12423
4039 12423
9679 12423
9679 8408
9679 6797
9679 17990
9679 17659
9679 14985
9679 16415
9679 1735
9679 18821
9679 9402
9679 18947
9679 5386
9679 17560
9679 1094
9...

result:

ok AC

Test #23:

score: 0
Accepted
time: 9ms
memory: 9000kb

input:

20000
4410 1
7210 1
1 2389
4410 18377
4410 4507
7905 4410
7210 14849
12441 7210
7210 9005
17807 2389
2389 6619
2389 6604
6913 18377
5811 18377
7249 18377
4507 1582
4507 8857
4507 17635
10077 7905
7905 4687
8607 7905
14849 16870
14849 3298
14849 2376
12441 9009
12441 10729
19879 12441
9005 19790
7715...

output:

4410 11152
1 11152
1183 2389
18377 11152
1183 4507
1183 7905
7210 11152
1183 12441
1183 9005
1183 17807
1183 6619
1183 6604
6913 11152
1183 5811
1183 7249
1183 1582
1183 8857
1183 17635
1183 10077
1183 4687
1183 8607
14849 11152
1183 3298
1183 2376
1183 9009
1183 10729
1183 19879
1183 19790
1183 771...

result:

ok AC

Test #24:

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

input:

20000
7223 19213
12395 18674
16451 12980
18029 7848
16056 11920
6906 11077
3923 10662
9192 4837
17604 11135
16462 2457
18842 9770
15130 10251
19601 6770
7954 12079
7559 642
15051 17509
1146 18583
18196 17621
4980 8041
19973 15310
16834 11112
3176 8010
957 12737
4072 830
3194 1873
11400 3394
6914 806...

output:

1905 19213
1905 12395
1905 12980
1905 7848
1905 11920
1905 6906
1905 3923
1905 4837
1905 11135
1905 2457
1905 9770
1905 10251
1905 6770
1905 12079
1905 7559
1905 15051
1905 1146
1905 17621
1905 8041
1905 19973
1905 11112
1905 3176
1905 957
1905 830
1905 3194
1905 11400
1905 6914
1905 14516
1905 1597...

result:

ok AC

Test #25:

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

input:

5
2 1
3 1
4 1
1 5

output:

-1

result:

ok AC

Test #26:

score: 0
Accepted
time: 13ms
memory: 9060kb

input:

20000
1 4794
4794 19823
8249 19823
8249 19672
16549 19672
13478 16549
3608 13478
3608 14623
14623 10303
19353 14623
14623 7999
3608 14367
14367 17910
14367 8488
16947 14367
3608 1121
1121 1836
13048 1121
17393 1121
11488 13478
11488 17346
8954 17346
17346 4922
17346 13440
11488 2278
16202 2278
593 2...

output:

4794 9249
19823 9249
8249 9249
19672 9249
16549 9249
13478 9249
3608 9249
14623 9249
10303 9249
10303 19353
10303 7999
10303 14367
10303 17910
10303 8488
10303 16947
10303 1121
10303 1836
10303 13048
10303 17393
10303 11488
10303 17346
10303 8954
10303 4922
10303 13440
10303 2278
10303 16202
10303 5...

result:

ok AC

Test #27:

score: 0
Accepted
time: 12ms
memory: 9596kb

input:

20000
1 17253
5390 1
1 10221
1 16259
8902 1
10509 1
1 16551
1 13314
1 12754
1 11707
1 7781
1 2105
1 18132
1 12907
1 5609
1 15234
1 18609
1 13919
1 13882
1 15621
1 1997
1 14002
1 18056
7498 1
13534 1
1530 1
1 14773
1 2001
1 10679
1 13745
6140 1
19975 1
14198 1
1 7536
5623 1
1 6120
1 6954
730 1
1 1601...

output:

1 13525
5390 13525
8404 10221
8404 16259
8404 8902
8404 10509
8404 16551
8404 13314
8404 12754
8404 11707
8404 7781
8404 2105
8404 18132
8404 12907
8404 5609
8404 15234
8404 18609
8404 13919
8404 13882
8404 15621
8404 1997
8404 14002
8404 18056
8404 7498
8404 13534
8404 1530
8404 14773
8404 2001
840...

result:

ok AC

Test #28:

score: 0
Accepted
time: 14ms
memory: 9496kb

input:

20000
5445 4016
925 12966
8179 19342
5779 1
9123 4530
5079 8720
8754 5478
17667 13748
7203 13819
10489 7645
8537 14929
4717 5427
239 4564
17407 14318
6756 7348
4638 17915
19455 15109
3853 19342
15246 17470
8228 16612
7726 13819
1 16617
16607 6208
6228 12081
1615 14545
11897 16624
7653 14499
7273 195...

output:

15437 5445
15437 12966
15437 8179
1 7204
15437 9123
15437 5079
15437 5478
15437 13748
15437 7203
15437 7645
15437 14929
15437 4717
15437 4564
15437 14318
15437 7348
15437 17915
15437 15109
15437 3853
15437 15246
15437 8228
15437 7726
15437 16617
15437 16607
15437 6228
15437 1615
15437 11897
15437 14...

result:

ok AC

Test #29:

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

input:

20000
1 10558
10558 7298
7298 3082
17807 7298
793 7298
11663 7298
12412 7298
10699 7298
7298 1146
2462 7298
7298 12577
11701 7298
7298 7622
3831 7298
19955 7298
3001 7298
7298 18329
7298 851
7298 16782
7298 17396
7298 15015
12771 7298
7298 10926
4736 7298
9088 7298
4867 7298
16066 7298
7298 2148
729...

output:

10558 19477
7298 19477
3082 19477
3082 17807
3082 793
3082 11663
3082 12412
3082 10699
3082 1146
3082 2462
3082 12577
3082 11701
3082 7622
3082 3831
3082 19955
3082 3001
3082 18329
3082 851
3082 16782
3082 17396
3082 15015
3082 12771
3082 10926
3082 4736
3082 9088
3082 4867
3082 16066
3082 2148
3082...

result:

ok AC

Test #30:

score: 0
Accepted
time: 12ms
memory: 10576kb

input:

20000
1 11767
10226 11767
6246 10226
6576 6246
458 6576
458 5997
16052 5997
16052 10900
4370 10900
4370 17480
17480 11379
4859 11379
14663 4859
18363 14663
1454 18363
18490 1454
18490 17760
17760 19850
19832 19850
4252 19832
5482 4252
2802 5482
17779 2802
17779 8601
10844 8601
10844 17372
1230 17372...

output:

1 4129
11767 4129
10226 4129
6246 4129
6576 4129
458 4129
5997 4129
16052 4129
10900 4129
4370 4129
17480 4129
11379 4129
4859 4129
14663 4129
18363 4129
1454 4129
18490 4129
17760 4129
19850 4129
19832 4129
4252 4129
5482 4129
2802 4129
17779 4129
8601 4129
10844 4129
17372 4129
1230 4129
13019 412...

result:

ok AC

Test #31:

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

input:

20000
16653 18166
1123 17313
12716 14313
11207 7401
2794 831
480 7420
4462 1161
575 456
15192 3052
12389 7101
15729 18976
18772 19492
18805 2052
866 10412
8160 3697
13319 15062
19241 11526
11876 3502
613 17770
15035 14829
6518 16531
11665 19122
15722 18062
19841 14843
5758 3123
1633 14519
3637 13277...

output:

16653 9780
1123 9780
12716 9780
7401 9780
2794 9780
480 9780
4462 9780
575 9780
15192 9780
12389 9780
15729 9780
19492 9780
2052 9780
866 9780
3697 9780
13319 9780
19241 9780
3502 9780
17770 9780
15035 9780
6518 9780
19122 9780
18062 9780
14843 9780
3123 9780
1633 9780
13277 9780
16195 9780
18042 97...

result:

ok AC

Test #32:

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

input:

20000
5613 1
1 999
1 16709
1 2491
9549 1
19706 1
1 1022
1 3884
1 1916
6627 1
1 1600
10265 1
1 19100
19766 1
1 7450
1 14375
5986 1
10295 1
8625 1
11810 1
1 15542
1 5745
3506 1
12842 1
1 11860
1 16317
1 6553
12476 1
1 6031
8445 1
6462 1
1 1601
1 3014
14100 1
1 6771
1 2360
1 15402
4549 1
6116 1
1 17848...

output:

-1

result:

ok AC

Test #33:

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

input:

20000
2509 13795
17043 13795
12006 13795
13795 822
3022 13795
8572 13795
2579 13795
13795 9673
12654 13795
4181 13795
13795 15912
13795 8902
13795 19201
5015 13795
243 13795
13795 6524
13795 9461
16403 13795
13795 18444
1316 13795
15366 13795
13795 17126
13795 309
13795 10938
13795 1255
13795 5588
1...

output:

-1

result:

ok AC

Test #34:

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

input:

20000
12144 2902
8713 11740
8870 10266
6116 3885
5943 8380
10496 956
14162 9193
4497 3275
5480 4601
6858 17285
1067 3003
19501 1958
5579 12167
844 12167
5372 16648
18876 13545
6559 10656
2910 6918
5632 16656
10135 11948
11253 13524
10068 15948
17884 3833
6830 16257
1248 6924
9806 14359
11033 8077
86...

output:

3838 12144
3838 8713
3838 10266
3838 6116
3838 5943
3838 10496
3838 9193
3838 4497
3838 5480
3838 6858
3838 3003
3838 1958
3838 5579
3838 12167
3838 16648
3838 18876
3838 10656
3838 6918
3838 5632
3838 10135
3838 11253
3838 10068
3838 3833
3838 16257
3838 6924
3838 9806
3838 8077
3838 8650
3838 9461...

result:

ok AC

Test #35:

score: 0
Accepted
time: 15ms
memory: 9172kb

input:

20000
1284 10854
1436 9770
17852 14859
19561 13068
19123 19730
8297 15453
7167 3888
5853 15710
18440 5611
9368 5242
6667 12315
19899 12021
13550 19105
16314 1977
18051 11095
4122 16348
1987 4873
14613 10548
375 11649
6442 1199
228 18390
4006 7870
2115 10763
13056 1980
4042 9649
11446 10078
14111 289...

output:

5920 1284
5920 1436
5920 17852
5920 13068
5920 19730
5920 15453
5920 3888
5920 5853
5920 18440
5920 5242
5920 12315
5920 12021
5920 19105
5920 1977
5920 11095
5920 4122
5920 4873
5920 10548
5920 11649
5920 1199
5920 228
5920 4006
5920 10763
5920 1980
5920 9649
5920 11446
5920 14111
5920 14896
5920 6...

result:

ok AC

Test #36:

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

input:

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

output:

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

result:

ok AC

Test #37:

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

input:

20000
1 1914
16448 1914
16448 447
1 19785
19232 19785
17236 19785
12409 17236
11707 12409
15526 11707
15526 12645
19367 12645
19367 7871
12617 7871
658 7871
2936 7871
10186 2936
10186 12483
4222 12483
4222 6106
3280 6106
7313 6106
17305 6106
2244 17305
17305 18735
16748 6106
16748 1554
16748 1261
73...

output:

18593 1914
18593 16448
18593 447
18593 1
18593 19232
18593 19785
18593 17236
18593 12409
18593 15526
18593 12645
18593 19367
18593 7871
18593 12617
18593 658
18593 2936
18593 10186
18593 12483
18593 4222
18593 6106
18593 3280
18593 7313
18593 17305
18593 2244
18593 18735
18593 16748
18593 1554
18593...

result:

ok AC

Test #38:

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

input:

20000
8234 1
16079 8234
18825 16079
18825 12361
12361 6709
6709 10905
12205 10905
3916 12205
16311 3916
16423 16311
16423 10094
10094 9710
1474 9710
1474 18631
18631 13459
6640 13459
19380 6640
19380 6320
19874 6320
2212 19874
2212 8880
8880 2809
15348 2809
14869 15348
14869 8029
924 8029
924 10270
...

output:

1 93
8234 93
16079 93
18825 93
12361 93
6709 93
10905 93
12205 93
3916 93
16311 93
16423 93
10094 93
9710 93
1474 93
18631 93
13459 93
6640 93
19380 93
6320 93
19874 93
2212 93
8880 93
2809 93
15348 93
14869 93
8029 93
924 93
10270 93
16526 93
4694 93
1818 93
15046 93
10755 93
124 93
8951 93
3035 93...

result:

ok AC

Test #39:

score: 0
Accepted
time: 11ms
memory: 9216kb

input:

20000
3828 10203
17892 5873
17224 10321
12241 7554
2948 6507
17619 16861
11410 1012
17019 18616
13582 19398
16411 15552
578 14161
9621 19542
9684 1699
16733 9223
16474 19501
15178 3217
9743 11111
6539 14379
5655 12001
10637 2251
13411 7006
7104 9228
15833 19339
12622 4315
19092 7490
8033 12870
19399...

output:

14394 3828
14394 5873
17224 6157
14394 7554
14394 6507
14394 17619
14394 1012
14394 18616
14394 19398
14394 16411
14394 578
14394 9621
14394 9684
14394 16733
14394 19501
14394 3217
14394 11111
14394 6539
14394 12001
14394 2251
14394 13411
14394 9228
15833 6157
14394 4315
14394 19092
14394 8033
14394...

result:

ok AC

Test #40:

score: 0
Accepted
time: 9ms
memory: 9720kb

input:

20000
6712 1
6712 16871
8572 16871
8572 10641
10641 16702
16702 18095
14014 18095
14014 10577
10577 1956
1956 13463
4593 13463
4593 17604
8524 17604
8524 4625
4625 5906
5906 17983
17983 13029
13029 7366
13038 7366
13038 3804
3804 3699
3699 15717
15717 967
16443 967
16443 1797
3079 1797
9213 3079
232...

output:

6712 2833
16871 2833
8572 2833
10641 2833
16702 2833
18095 2833
14014 2833
10577 2833
1956 2833
13463 2833
4593 2833
17604 2833
8524 2833
4625 2833
5906 2833
17983 2833
13029 2833
7366 2833
13038 2833
3804 2833
3699 2833
15717 2833
967 2833
16443 2833
1797 2833
3079 2833
9213 2833
232 2833
16743 283...

result:

ok AC

Test #41:

score: 0
Accepted
time: 12ms
memory: 9716kb

input:

20000
2591 11751
5562 1300
9597 7814
11201 6762
9942 6089
18201 10054
14040 17666
14050 3479
2754 6286
5122 10070
2705 10053
3703 8076
33 13628
18330 17144
15031 16159
668 10414
14591 4857
15396 13207
6623 13987
3946 9270
15622 17484
4063 8811
12866 7551
3439 8748
10982 6076
15522 1678
8947 4749
677...

output:

13400 11751
13400 1300
13400 9597
6762 12011
6089 12011
13400 10054
17666 12011
13400 14050
2754 12011
13400 10070
13400 10053
3703 12011
13628 12011
17144 12011
15031 12011
10414 12011
13400 4857
13400 15396
13400 6623
3946 12011
13400 17484
8811 12011
13400 7551
13400 3439
13400 6076
13400 1678
13...

result:

ok AC

Test #42:

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

input:

100000
1 72500
1 89151
72500 50542
16422 72500
31678 89151
89151 54297
19071 50542
25039 50542
59896 16422
57305 16422
17263 31678
31678 3514
54297 25341
13381 54297
19071 7507
15806 19071
25039 62775
20433 25039
59896 28013
59896 2793
84857 57305
57305 84225
17263 6434
17263 61853
37741 3514
3514 8...

output:

72500 67210
1 67210
50542 67210
58704 16422
89151 67210
58704 54297
19071 67210
58704 25039
58704 59896
58704 57305
31678 67210
58704 3514
58704 25341
58704 13381
7507 67210
58704 15806
58704 62775
58704 20433
58704 28013
58704 2793
58704 84857
58704 84225
17263 67210
58704 61853
58704 37741
58704 8...

result:

ok AC

Test #43:

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

input:

100000
37174 25594
26356 56758
70911 5299
53571 20298
89704 67180
69629 74497
31785 14492
10546 1814
71677 54029
2466 28838
57294 23003
35667 41920
5998 95159
14430 34895
74794 85483
87138 10195
54295 96087
21621 26770
92353 70922
56725 17254
67745 92044
30390 34948
64685 31050
54736 78533
63644 859...

output:

38720 37174
38720 26356
38720 70911
38720 20298
38720 89704
38720 74497
38720 14492
38720 10546
38720 71677
38720 28838
38720 23003
38720 41920
38720 95159
38720 34895
38720 74794
38720 10195
38720 54295
38720 21621
38720 70922
38720 56725
38720 67745
38720 30390
38720 31050
38720 78533
38720 8591
3...

result:

ok AC

Test #44:

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

input:

100000
90403 1
90403 84049
84049 28339
50038 28339
50038 23735
23735 87291
87291 26404
26404 3276
3276 37488
67144 37488
67144 15335
15335 73596
32815 73596
58348 32815
32340 58348
77042 32340
32340 17210
58348 68281
68281 13360
68281 52957
32815 3781
88746 3781
33513 88746
88746 23338
11895 3781
90...

output:

90403 51949
84049 51949
28339 51949
50038 51949
23735 51949
87291 51949
26404 51949
3276 51949
37488 51949
67144 51949
15335 51949
73596 51949
32815 51949
58348 51949
32340 51949
77042 51949
77042 17210
77042 68281
77042 13360
77042 52957
77042 3781
77042 88746
77042 33513
77042 23338
77042 11895
77...

result:

ok AC

Test #45:

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

input:

100000
10753 1
31716 1
1 8354
41344 10753
10753 22340
33736 10753
31716 74747
24655 31716
31716 93736
4454 8354
65308 8354
36992 8354
53743 41344
59301 41344
41344 86462
22340 77782
22340 49193
90415 22340
33736 2126
72574 33736
33736 98153
92064 74747
23614 74747
74747 96121
24655 95702
47727 24655...

output:

1 89646
31716 89646
51233 8354
10753 89646
51233 22340
51233 33736
74747 89646
51233 24655
51233 93736
51233 4454
51233 65308
51233 36992
41344 89646
51233 59301
51233 86462
51233 77782
51233 49193
51233 90415
51233 2126
51233 72574
51233 98153
92064 89646
51233 23614
51233 96121
51233 95702
51233 4...

result:

ok AC

Test #46:

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

input:

100000
82182 59525
43093 74187
83434 62328
30609 75691
98351 97443
93951 9234
89762 57868
66707 24839
91314 82444
9148 12031
46318 817
9254 56692
67828 19158
29614 79432
64090 86748
43645 44758
91501 26481
13108 70283
53676 76180
2183 16343
17086 64156
13813 38661
1934 69441
21652 50770
62980 13969
...

output:

16105 82182
16105 74187
16105 83434
16105 30609
16105 97443
16105 93951
16105 57868
16105 24839
16105 91314
16105 9148
16105 817
16105 56692
16105 67828
16105 79432
16105 64090
16105 44758
16105 26481
16105 70283
16105 76180
16105 2183
16105 17086
16105 38661
16105 69441
16105 50770
16105 13969
1610...

result:

ok AC

Test #47:

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

input:

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

output:

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

result:

ok AC

Test #48:

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

input:

100000
1 59819
46211 59819
46211 78631
78631 6887
6887 15685
45496 15685
45496 38399
38399 43932
22491 43932
22491 57782
25655 57782
57782 81578
40906 57782
22491 8185
8185 92518
96199 8185
63790 8185
22491 64847
84427 64847
34665 64847
30015 64847
34952 43932
34952 12997
41447 12997
19357 12997
307...

output:

59819 17159
46211 17159
78631 17159
6887 17159
15685 17159
45496 17159
38399 17159
43932 17159
22491 17159
57782 17159
25655 17159
25655 81578
25655 40906
25655 8185
25655 92518
25655 96199
25655 63790
25655 64847
25655 84427
25655 34665
25655 30015
25655 34952
25655 12997
25655 41447
25655 19357
25...

result:

ok AC

Test #49:

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

input:

100000
70720 1
71027 1
48338 1
1 61809
1 79963
1 39740
86644 1
14939 1
39918 1
41470 1
23364 1
1 54664
1 96370
1 53835
1 67313
33696 1
44243 1
50423 1
1 70539
73776 1
560 1
98363 1
71623 1
72365 1
1 73548
1 82843
1 64083
52686 1
1 44452
1 94601
1 43725
88136 1
1 65340
30989 1
1 94282
76705 1
1 4208
...

output:

1 49673
71027 49673
51591 48338
51591 61809
51591 79963
51591 39740
51591 86644
51591 14939
51591 39918
51591 41470
51591 23364
51591 54664
51591 96370
51591 53835
51591 67313
51591 33696
51591 44243
51591 50423
51591 70539
51591 73776
51591 560
51591 98363
51591 71623
51591 72365
51591 73548
51591 ...

result:

ok AC

Test #50:

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

input:

100000
55448 49209
4084 16405
52470 22193
57007 13008
43787 82824
91893 67413
72105 89438
5791 85302
74502 44950
57906 11997
53465 42216
63894 41770
20892 54078
19530 68055
34937 22893
43941 47065
54015 53196
91519 81132
80483 71834
1399 53196
18226 23550
46619 51969
78131 47878
85576 60764
37319 88...

output:

27048 55448
27048 4084
27048 22193
27048 13008
27048 82824
27048 91893
27048 72105
27048 5791
27048 44950
27048 11997
27048 42216
27048 41770
27048 20892
27048 68055
27048 22893
27048 47065
27048 54015
27048 91519
27048 80483
27048 1399
27048 23550
27048 46619
27048 47878
27048 85576
27048 37319
270...

result:

ok AC

Test #51:

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

input:

100000
1 13485
13485 21238
21238 89751
21238 74621
14404 21238
60040 21238
21238 46089
46928 21238
73214 21238
88224 21238
47403 21238
21238 99205
89778 21238
21238 89464
22870 21238
21238 75159
40123 21238
33512 21238
21238 30257
70298 21238
21238 79591
57804 21238
21238 99840
64087 21238
12717 212...

output:

13485 55772
21238 55772
89751 55772
89751 74621
89751 14404
89751 60040
89751 46089
89751 46928
89751 73214
89751 88224
89751 47403
89751 99205
89751 89778
89751 89464
89751 22870
89751 75159
89751 40123
89751 33512
89751 30257
89751 70298
89751 79591
89751 57804
89751 99840
89751 64087
89751 12717
...

result:

ok AC

Test #52:

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

input:

100000
43730 1
43730 8413
8413 13508
53025 13508
44444 53025
44444 46747
54535 46747
54535 16058
16058 27066
27066 73721
35961 73721
18398 35961
18398 3188
3188 9998
57229 9998
57229 96831
2109 96831
2109 89059
89059 89520
89520 62512
62512 9136
9136 32949
27353 32949
19993 27353
19993 17305
91005 1...

output:

1 91469
43730 91469
8413 91469
13508 91469
53025 91469
44444 91469
46747 91469
54535 91469
16058 91469
27066 91469
73721 91469
35961 91469
18398 91469
3188 91469
9998 91469
57229 91469
96831 91469
2109 91469
89059 91469
89520 91469
62512 91469
9136 91469
32949 91469
27353 91469
19993 91469
17305 914...

result:

ok AC

Test #53:

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

input:

100000
5616 54215
70847 24268
13256 88765
87054 72678
65173 1284
61132 24104
29759 37270
50005 62107
8909 58386
97772 68628
3463 41963
93835 10608
7780 68599
97385 40426
52295 15155
65521 84045
97372 22218
24089 69011
44236 64952
21273 33469
21618 31458
76924 4738
27278 21658
6790 18294
2343 82355
8...

output:

5616 42980
70847 42980
13256 42980
87054 42980
65173 42980
24104 42980
29759 42980
62107 42980
58386 42980
68628 42980
41963 42980
93835 42980
68599 42980
40426 42980
52295 42980
84045 42980
22218 42980
24089 42980
64952 42980
21273 42980
21618 42980
76924 42980
27278 42980
6790 42980
82355 42980
88...

result:

ok AC

Test #54:

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

input:

100000
1 81565
21567 1
86484 1
95714 1
1 93565
1 15812
51087 1
15941 1
36746 1
1 34149
1 71887
1 61269
1 93111
1 52394
8732 1
1 62378
1 74176
1362 1
15806 1
91535 1
1 77121
1 17356
1 23401
70673 1
1 21367
77472 1
1 44692
1 45094
1 43652
62628 1
1 81187
1 98635
2258 1
1 491
1 1963
1 83580
12393 1
1 5...

output:

-1

result:

ok AC

Test #55:

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

input:

100000
62999 54230
62172 54230
54230 87813
80978 54230
54230 13635
8808 54230
34109 54230
54230 13451
54230 30179
9847 54230
93260 54230
54230 45610
54230 7282
54230 42958
54230 54480
54230 62452
54230 95890
32418 54230
54230 8456
54230 64404
54230 40018
54230 70843
38010 54230
57364 54230
95022 542...

output:

-1

result:

ok AC

Test #56:

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

input:

100000
85431 10525
82137 81079
48778 58755
215 90110
51120 51131
16823 69899
6320 72931
65015 30930
68354 78098
32070 13344
55633 13621
69157 69872
92675 79903
96312 24145
13234 89857
62310 15217
7671 50027
34561 73029
90324 42836
14988 3767
96314 18015
665 82164
49080 34432
24022 62814
89664 13182
...

output:

66673 85431
66673 81079
66673 48778
66673 215
66673 51131
66673 16823
66673 72931
66673 30930
66673 78098
66673 13344
66673 13621
66673 69157
66673 79903
66673 24145
66673 13234
66673 15217
66673 7671
66673 73029
66673 90324
66673 3767
66673 18015
66673 665
66673 49080
66673 24022
66673 13182
66673 ...

result:

ok AC

Test #57:

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

input:

100000
54861 12509
16932 42872
34657 39417
13373 37054
53410 71695
2271 28730
77047 80422
7187 34867
94140 69441
47384 90599
15092 60892
94502 35186
58059 98865
46037 92080
96465 56648
81008 245
86644 72226
35703 96730
7922 3613
97616 90536
41294 92557
22776 10335
74308 16656
86493 81735
91472 93048...

output:

68539 12509
68539 42872
68539 34657
68539 37054
68539 53410
68539 28730
68539 77047
68539 7187
68539 94140
68539 47384
68539 60892
68539 35186
68539 98865
68539 46037
68539 96465
68539 245
68539 86644
68539 96730
68539 3613
68539 97616
68539 41294
68539 22776
68539 74308
68539 81735
68539 93048
6853...

result:

ok AC

Test #58:

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

input:

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

output:

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

result:

ok AC

Test #59:

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

input:

100000
88390 1
1 51242
1 73844
73844 82993
69357 82993
82993 89153
89153 92016
36977 89153
75137 36977
82993 53533
97404 53533
49989 97404
67125 49989
53533 7006
7006 63635
60387 7006
59312 60387
24309 59312
26526 24309
24309 9985
9985 26403
60387 55203
55203 79993
79993 71230
71230 52071
52071 8306...

output:

41133 88390
41133 51242
41133 1
41133 73844
41133 69357
41133 89153
41133 92016
41133 36977
41133 75137
41133 82993
41133 97404
41133 49989
41133 67125
41133 53533
41133 63635
41133 60387
41133 59312
41133 24309
41133 26526
41133 9985
41133 26403
41133 55203
41133 79993
41133 71230
41133 52071
41133...

result:

ok AC

Test #60:

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

input:

100000
1 7264
7264 69649
85097 69649
29848 85097
29848 68683
68683 42523
15272 42523
97689 15272
97689 7996
30390 7996
54151 30390
22264 54151
22264 98123
98123 16751
27570 16751
9987 27570
9987 86950
86950 67445
67445 87275
8871 87275
8871 74967
74967 53362
53362 10217
10217 52404
45262 52404
45262...

output:

1 82119
7264 82119
69649 82119
85097 82119
29848 82119
68683 82119
42523 82119
15272 82119
97689 82119
7996 82119
30390 82119
54151 82119
22264 82119
98123 82119
16751 82119
27570 82119
9987 82119
86950 82119
67445 82119
87275 82119
8871 82119
74967 82119
53362 82119
10217 82119
52404 82119
45262 82...

result:

ok AC

Test #61:

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

input:

100000
3518 47523
14887 83452
31336 87320
47772 87482
71420 24559
99732 17539
45904 20872
52728 70439
38581 75203
18345 49294
7385 74056
95971 72826
48547 37020
61306 27212
53241 59530
32550 2892
5369 8488
4000 50453
45119 41435
5899 77096
19235 37917
75044 40239
44198 79848
23637 99807
40855 52471
...

output:

78933 3518
78933 14887
78933 87320
78933 87482
78933 71420
78933 99732
78933 20872
78933 70439
38581 94532
78933 49294
78933 7385
78933 95971
78933 37020
78933 61306
78933 53241
78933 2892
78933 8488
78933 50453
78933 45119
78933 77096
78933 37917
78933 40239
78933 79848
78933 99807
78933 52471
7893...

result:

ok AC

Test #62:

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

input:

100000
56405 1
56405 66063
66801 66063
66801 9845
9845 42911
42911 64818
67482 64818
35942 67482
35942 75546
75546 4505
4505 45628
45628 29159
29159 29378
83665 29378
83665 85205
85205 94326
78400 94326
91544 78400
92293 91544
95489 92293
20854 95489
20854 94810
91796 94810
91796 49331
49331 66242
9...

output:

56405 8284
66063 8284
66801 8284
9845 8284
42911 8284
64818 8284
67482 8284
35942 8284
75546 8284
4505 8284
45628 8284
29159 8284
29378 8284
83665 8284
85205 8284
94326 8284
78400 8284
91544 8284
92293 8284
95489 8284
20854 8284
94810 8284
91796 8284
49331 8284
66242 8284
9479 8284
14120 8284
30274 ...

result:

ok AC

Test #63:

score: 0
Accepted
time: 68ms
memory: 35968kb

input:

100000
29993 41605
84963 10140
60237 62389
66780 93449
98439 1174
75487 87344
56945 1098
7281 10192
90231 22033
95031 94597
88728 56965
74791 64971
68584 15462
91264 43556
80943 25018
89575 23985
46970 91618
7237 89928
26433 7488
10258 93471
44420 34919
39007 60649
64537 14238
89107 56906
58805 7576...

output:

29993 34803
55130 84963
62389 34803
66780 34803
1174 34803
87344 34803
56945 34803
10192 34803
55130 90231
55130 95031
88728 34803
74791 34803
15462 34803
43556 34803
25018 34803
23985 34803
55130 46970
7237 34803
55130 26433
93471 34803
55130 44420
55130 60649
55130 14238
55130 56906
55130 75769
49...

result:

ok AC

Test #64:

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

input:

100000
87758 1
87758 8566
8566 53230
53230 68035
45464 68035
43933 45464
7611 43933
7611 72530
72530 97898
97898 68231
2236 84498
71861 63091
76814 62314
24969 43571
98738 76356
71858 14301
12495 4041
49101 10912
83218 63817
60387 86854
59093 27607
35192 6135
76119 58917
15976 50822
5377 60508
39902...

output:

12837 1
12837 87758
12837 8566
12837 53230
12837 68035
12837 45464
12837 43933
12837 7611
12837 72530
12837 97898
12837 84498
12837 71861
12837 76814
12837 43571
12837 76356
12837 14301
12837 4041
12837 49101
12837 63817
12837 86854
12837 59093
12837 35192
12837 76119
12837 50822
12837 5377
12837 39...

result:

ok AC

Test #65:

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

input:

100000
49400 1
1 55311
78355 1
58471 1
25325 1
8216 1
19123 1
47311 1
1 87302
68137 1
1 98931
11168 1
1 42489
44803 1
25464 1
34243 1
63702 1
29572 1
14941 1
1 46103
1 54830
43707 1
57172 1
1 17538
75154 1
67663 1
1 6784
14487 1
45840 1
1 82849
1 77260
1 18850
1 7003
1 76083
16640 1
54748 1
46731 1
...

output:

49400 35021
49400 55311
49400 78355
49400 58471
49400 25325
49400 8216
49400 19123
49400 47311
49400 87302
49400 68137
49400 98931
49400 11168
49400 42489
49400 44803
49400 25464
49400 34243
49400 63702
49400 29572
49400 14941
49400 46103
49400 54830
49400 43707
49400 57172
49400 17538
49400 75154
4...

result:

ok AC

Test #66:

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

input:

100000
59098 1
88393 1
10097 1
1 27732
12542 1
1 74984
63414 1
1 68750
1 38087
65706 38087
46675 927
57918 60950
11844 60891
1200 51250
17750 31241
12177 66972
57772 85920
49826 92407
3739 18636
15328 31458
47706 69254
95722 85793
92734 12473
72338 65624
66312 27618
47426 68757
39713 32969
50029 618...

output:

74702 59098
74702 88393
74702 10097
74702 27732
74702 12542
74702 74984
74702 63414
74702 68750
74702 1
74702 38087
74702 46675
74702 60950
74702 60891
74702 51250
74702 17750
74702 66972
74702 57772
74702 49826
74702 3739
74702 31458
74702 47706
74702 85793
74702 12473
74702 72338
74702 27618
74702...

result:

ok AC

Test #67:

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

input:

5
2 1
1 3
4 1
5 4

output:

2 5
2 3
1 5
4 2

result:

ok AC

Test #68:

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

input:

5
4 1
3 1
5 1
5 2

output:

4 2
4 3
1 2
5 4

result:

ok AC

Test #69:

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

input:

5
5 1
3 1
1 2
2 4

output:

5 4
5 3
1 4
2 5

result:

ok AC