QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#400739#989. Into Cactusgrass8cow#AC ✓80ms35032kbC++17717b2024-04-27 15:44:112024-04-27 15:44:11

Judging History

This is the latest submission verdict.

  • [2024-04-27 15:44:11]
  • Judged
  • Verdict: AC
  • Time: 80ms
  • Memory: 35032kb
  • [2024-04-27 15:44:11]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std;
int n;
#define pp pop_back
#define pb push_back
vector<int>g[200100];
int ans,U[201000],V[201000];
bool dfs(int x,int f){
    vector<int>vp;
    for(int v:g[x])if(v!=f)
        if(dfs(v,x))vp.pb(v);
    while(vp.size()>=2){
        int a=vp.back();vp.pp();
        int b=vp.back();vp.pp();
        U[++ans]=a,V[ans]=b;
    }
    if(!vp.empty()&&f!=0){ans++,U[ans]=vp[0],V[ans]=f;return 0;}
    return 1;
}
int main(){
    scanf("%d",&n);
    for(int i=1,u,v;i<n;i++){
        scanf("%d%d",&u,&v);
        g[u].pb(v),g[v].pb(u);
    }
    dfs(1,0);
    printf("%d\n",ans);
    for(int i=1;i<=ans;i++)printf("%d %d\n",U[i],V[i]);
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 9672kb

input:

6
6 4
3 1
3 6
4 5
2 3

output:

2
5 6
2 6

result:

ok OK!

Test #2:

score: 0
Accepted
time: 1ms
memory: 9104kb

input:

1

output:

0

result:

ok OK!

Test #3:

score: 0
Accepted
time: 1ms
memory: 8520kb

input:

2
1 2

output:

0

result:

ok OK!

Test #4:

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

input:

3
3 1
1 2

output:

1
2 3

result:

ok OK!

Test #5:

score: 0
Accepted
time: 1ms
memory: 8568kb

input:

4
1 3
1 4
2 1

output:

1
2 4

result:

ok OK!

Test #6:

score: 0
Accepted
time: 1ms
memory: 8488kb

input:

5
5 4
2 3
1 2
1 4

output:

2
3 1
5 1

result:

ok OK!

Test #7:

score: 0
Accepted
time: 1ms
memory: 8488kb

input:

6
6 4
4 5
5 3
4 1
2 5

output:

2
2 3
5 6

result:

ok OK!

Test #8:

score: 0
Accepted
time: 1ms
memory: 9640kb

input:

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

output:

3
3 7
4 6
7 1

result:

ok OK!

Test #9:

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

input:

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

output:

3
6 4
8 7
3 1

result:

ok OK!

Test #10:

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

input:

6
1 2
6 5
2 3
4 3
6 4

output:

2
5 4
4 2

result:

ok OK!

Test #11:

score: 0
Accepted
time: 1ms
memory: 8500kb

input:

5
5 3
2 1
1 4
3 2

output:

2
5 2
4 2

result:

ok OK!

Test #12:

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

input:

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

output:

3
4 3
3 5
5 1

result:

ok OK!

Test #13:

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

input:

5
1 4
4 2
3 5
3 2

output:

2
5 2
2 1

result:

ok OK!

Test #14:

score: 0
Accepted
time: 1ms
memory: 8840kb

input:

6
6 3
4 1
2 3
2 1
2 5

output:

2
6 2
5 1

result:

ok OK!

Test #15:

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

input:

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

output:

3
3 7
5 6
4 1

result:

ok OK!

Test #16:

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

input:

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

output:

3
5 4
3 2
6 7

result:

ok OK!

Test #17:

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

input:

6
5 6
3 6
6 1
2 6
4 2

output:

2
4 6
3 5

result:

ok OK!

Test #18:

score: 0
Accepted
time: 1ms
memory: 9128kb

input:

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

output:

3
2 4
7 3
5 1

result:

ok OK!

Test #19:

score: 0
Accepted
time: 1ms
memory: 9576kb

input:

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

output:

3
4 3
5 6
8 7

result:

ok OK!

Test #20:

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

input:

5
2 4
2 1
2 5
2 3

output:

2
3 5
4 1

result:

ok OK!

Test #21:

score: 0
Accepted
time: 1ms
memory: 8904kb

input:

6
1 4
4 5
6 4
4 3
4 2

output:

2
2 3
6 5

result:

ok OK!

Test #22:

score: 0
Accepted
time: 1ms
memory: 8672kb

input:

6
3 2
2 5
1 3
3 4
6 4

output:

2
5 3
6 3

result:

ok OK!

Test #23:

score: 0
Accepted
time: 1ms
memory: 8496kb

input:

5
1 3
4 5
2 4
3 2

output:

2
5 2
2 1

result:

ok OK!

Test #24:

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

input:

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

output:

3
6 5
5 1
4 3

result:

ok OK!

Test #25:

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

input:

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

output:

3
5 2
4 2
6 2

result:

ok OK!

Test #26:

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

input:

5
1 4
2 3
2 1
2 5

output:

2
5 3
2 4

result:

ok OK!

Test #27:

score: 0
Accepted
time: 1ms
memory: 9164kb

input:

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

output:

3
2 5
7 4
6 3

result:

ok OK!

Test #28:

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

input:

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

output:

3
4 6
5 1
2 7

result:

ok OK!

Test #29:

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

input:

5
4 1
3 2
5 4
4 2

output:

2
3 4
5 1

result:

ok OK!

Test #30:

score: 0
Accepted
time: 1ms
memory: 8780kb

input:

6
1 6
1 3
4 1
5 1
1 2

output:

2
2 5
4 3

result:

ok OK!

Test #31:

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

input:

6
2 6
1 6
3 2
2 4
2 5

output:

2
5 4
3 6

result:

ok OK!

Test #32:

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

input:

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

output:

3
4 6
7 2
5 3

result:

ok OK!

Test #33:

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

input:

6
6 2
3 6
1 5
4 1
4 2

output:

2
3 2
2 1

result:

ok OK!

Test #34:

score: 0
Accepted
time: 1ms
memory: 8568kb

input:

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

output:

3
5 6
4 7
3 7

result:

ok OK!

Test #35:

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

input:

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

output:

3
6 3
2 1
4 5

result:

ok OK!

Test #36:

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

input:

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

output:

3
6 5
4 5
2 3

result:

ok OK!

Test #37:

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

input:

5
5 4
2 3
1 4
1 3

output:

2
5 1
2 1

result:

ok OK!

Test #38:

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

input:

1

output:

0

result:

ok OK!

Test #39:

score: 0
Accepted
time: 1ms
memory: 8456kb

input:

2
2 1

output:

0

result:

ok OK!

Test #40:

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

input:

3
1 3
3 2

output:

1
2 1

result:

ok OK!

Test #41:

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

input:

4
2 4
1 3
2 3

output:

1
4 3

result:

ok OK!

Test #42:

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

input:

5
3 5
1 4
3 2
4 3

output:

2
2 5
3 1

result:

ok OK!

Test #43:

score: 0
Accepted
time: 1ms
memory: 8784kb

input:

6
3 1
1 2
3 4
6 5
4 5

output:

2
6 4
4 1

result:

ok OK!

Test #44:

score: 0
Accepted
time: 1ms
memory: 10080kb

input:

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

output:

3
4 2
3 7
5 7

result:

ok OK!

Test #45:

score: 0
Accepted
time: 1ms
memory: 8776kb

input:

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

output:

3
8 2
6 3
5 1

result:

ok OK!

Test #46:

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

input:

199941
45539 21753
73521 17749
18310 175971
187123 74718
1423 48729
57689 193080
13123 124854
159470 118810
54495 41241
20092 31314
136934 110890
57392 95852
66132 100210
25643 149235
36249 170528
59404 103679
143168 40619
75020 111886
78267 85170
182181 151358
175670 199743
48967 21948
85440 137537...

output:

99970
133438 183569
183569 91845
91845 13957
13957 160930
160930 134066
134066 112652
112652 184498
184498 113056
113056 11765
11765 159867
159867 58483
58483 67487
67487 16909
16909 132518
132518 194179
194179 63999
63999 45043
45043 15390
15390 143662
143662 119064
119064 112437
112437 164860
1648...

result:

ok OK!

Test #47:

score: 0
Accepted
time: 76ms
memory: 27708kb

input:

199990
36252 48972
137199 193985
15733 32268
72491 124965
144527 135659
126526 4276
27074 30404
30035 117563
43829 76082
65403 174862
12854 59513
166822 88663
27773 42939
101669 5177
163180 46432
54789 58007
164830 195594
163488 136174
44243 159060
92576 100504
193462 64519
157699 108044
30793 45107...

output:

99994
95554 34576
34576 63550
63550 125517
125517 176788
176788 99712
99712 30292
30292 146182
146182 101011
101011 192423
192423 79504
79504 198061
198061 157745
157745 156801
156801 181225
181225 24919
24919 148063
148063 198823
198823 51133
51133 22671
22671 186650
186650 65670
65670 52865
52865 ...

result:

ok OK!

Test #48:

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

input:

199984
60991 129518
145505 1527
136883 181013
96750 98833
178145 74687
153427 41212
123371 174413
159897 40200
54174 45999
42909 197448
48461 140049
168210 7971
140096 100878
172774 16629
24251 169721
40049 161419
160902 23894
45677 132991
9586 63910
7418 50242
140437 134207
167287 159123
172209 674...

output:

99991
50271 122596
122596 34243
34243 18655
18655 147158
147158 13015
13015 128082
128082 132675
132675 111869
111869 57012
57012 185493
185493 170854
170854 70393
70393 4626
4626 22328
22328 32599
32599 151052
151052 51430
51430 95963
95963 27769
27769 133295
133295 138575
138575 101055
101055 1705...

result:

ok OK!

Test #49:

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

input:

199950
45895 97505
153673 135630
133 147902
150741 56684
59872 30986
40406 32376
3812 187356
131631 22329
148706 57747
73048 46756
79438 39981
123189 65415
108426 16133
52976 57856
80000 130729
85817 82120
159848 106794
67334 176078
96847 172109
76251 36192
71044 142619
199709 11936
157677 106860
21...

output:

99974
25115 96878
96878 137620
137620 160992
160992 161358
161358 91256
91256 1383
1383 54784
54784 131759
131759 119958
119958 42491
42491 19278
19278 7169
7169 2051
2051 156840
156840 29905
29905 191558
191558 70863
70863 85906
85906 127329
127329 128583
128583 177663
177663 127375
127375 149941
1...

result:

ok OK!

Test #50:

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

input:

199939
4949 136919
92272 25292
114731 129765
159111 153806
83782 65354
197271 75178
31928 49693
182119 75648
99503 192579
197496 146260
137800 22575
148004 145457
155853 129817
126487 65515
85662 91957
181514 176364
180683 3889
96197 82472
102868 66183
41093 36001
51988 116717
41722 143845
102532 12...

output:

99969
95121 52858
192008 40472
106898 81973
150836 40472
96419 16629
99805 68816
16629 181672
193226 142364
179559 159282
152227 90783
22467 159282
142702 1179
14325 47667
139792 148925
169820 166493
148925 126732
127365 173045
181743 81153
90985 59751
60612 36561
155686 59751
2362 123524
35343 4657...

result:

ok OK!

Test #51:

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

input:

199902
73682 165904
121514 159509
182473 186539
176943 25341
37269 170103
32485 185863
165942 156720
89283 142335
164752 44085
120279 10296
186544 108135
54811 19902
159677 11570
40006 34931
102506 194405
37883 184355
14786 126969
163554 125816
143013 12592
195558 169513
83823 112243
8014 15824
1661...

output:

99950
13764 171802
84266 20605
119511 27373
20605 57271
173912 109358
57271 24013
154595 145641
89235 194444
178173 1577
188628 16222
138442 53059
83146 169388
90780 120305
84922 144288
176502 8710
91992 194941
58259 194941
195032 11044
182009 191373
112843 198832
191373 110657
36544 150829
92908 15...

result:

ok OK!

Test #52:

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

input:

199913
166758 40855
168228 126224
178186 105914
191299 103766
7148 13754
101792 68644
181973 90376
38923 156379
135450 63521
166909 194316
174383 160272
97650 147177
61633 98861
117492 182506
175348 172975
98161 53454
85890 62423
107166 50820
87877 59346
26540 44161
124817 151041
13175 157922
180641...

output:

99956
193559 199630
81052 103933
55871 177036
23629 8298
135397 132292
132292 119669
16662 60447
26059 60447
119790 33653
185550 20410
101333 148461
20410 15768
136330 98350
15768 31157
23633 6441
31157 193147
50747 29172
117854 29172
82625 26981
176557 74957
95109 18656
187176 104948
119143 52565
5...

result:

ok OK!

Test #53:

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

input:

199925
122816 155960
51410 83244
192469 8224
109882 166481
80996 119182
99616 106781
95986 29932
105417 195450
74229 146285
161628 141421
194857 57413
17530 16086
45693 125337
109571 80706
75053 141884
199715 10155
142843 146009
152509 28805
55975 42900
104001 10362
92486 32688
118337 114698
11878 1...

output:

99962
170534 138062
49190 138062
112367 101847
127140 101847
159646 24241
47374 57495
176942 32767
18325 136084
72970 157313
6815 164842
157313 57892
103835 125173
127265 127725
93465 57892
178216 94103
102583 35329
67464 48675
48675 8539
21609 126883
11669 112271
8539 49678
49678 89762
89762 22050
...

result:

ok OK!

Test #54:

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

input:

199913
25526 125004
89400 125004
71408 125004
120356 125004
125004 50195
98306 125004
100982 125004
125004 161525
125004 18367
181109 125004
125004 140109
68728 125004
125004 95745
106445 125004
125004 2761
171403 125004
125004 111690
125004 122803
125004 42200
74721 125004
125004 192880
125004 5094...

output:

99956
100980 177173
118246 8409
103090 12615
26322 171508
105735 107279
127474 124498
148340 199395
20982 121941
164236 129864
98357 105479
165067 113793
170957 128711
21883 15147
118512 164178
166093 194875
6390 3987
119940 100947
155097 27012
87332 113115
54915 164741
140315 104569
177488 64553
10...

result:

ok OK!

Test #55:

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

input:

199907
65617 81592
65617 63032
84439 65617
67463 65617
65617 195540
175967 65617
65617 1113
103535 65617
9031 65617
65617 87368
65617 168986
114165 65617
11359 65617
36819 65617
18853 65617
65617 49440
128085 65617
106566 65617
94040 65617
65617 5620
65617 162332
65617 24671
65617 182265
88260 65617...

output:

99953
129262 131927
185703 164631
180339 23739
84861 70409
193365 23750
90733 127878
168346 195113
75788 174082
62522 88181
21166 137397
103574 92351
49949 82187
140959 10176
64658 163207
157828 133788
124441 174971
135058 146331
58777 160385
62345 112182
170365 18394
8382 65448
26293 52213
183154 4...

result:

ok OK!

Test #56:

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

input:

199923
19916 55755
179914 19916
6641 19916
153236 19916
19916 153590
19916 78760
152747 19916
166147 19916
19916 58682
59563 19916
108924 19916
19916 105088
71362 19916
19916 88387
1718 19916
7380 19916
19916 9694
19916 12548
115646 19916
45043 19916
23861 19916
19916 146408
89121 19916
7583 19916
1...

output:

99961
117484 47337
83195 110333
19353 107972
148175 148064
199819 106781
175889 71200
1490 32574
189158 39739
18299 110247
134437 37745
64970 172239
80804 16308
192305 156324
163818 147660
119685 165457
182452 36030
118200 34142
140212 143077
136774 125350
107200 72485
63715 137369
178361 197641
124...

result:

ok OK!

Test #57:

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

input:

199912
122660 51495
51495 72892
118948 51495
141375 51495
51495 27932
51495 93647
51495 2068
113109 51495
51495 195751
101007 51495
119864 51495
51495 80001
32300 51495
59611 51495
51495 23963
51495 13305
51495 157130
190486 51495
183280 51495
196300 51495
11864 51495
151471 51495
51495 175892
42381...

output:

99955
53158 165985
78272 85239
34064 153440
167012 178584
176523 19660
198418 75527
157383 198575
165140 53747
92066 136944
86567 9280
23634 92195
164924 186168
118650 113875
56172 169779
166243 124826
87082 186457
90841 110745
89420 147930
12345 199
138495 6380
110805 43277
158323 92244
185251 5845...

result:

ok OK!

Test #58:

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

input:

199938
146709 33119
83165 116674
92602 53385
73406 121662
174206 150374
116325 121456
69180 36439
105804 19517
176359 104210
11417 167822
189223 62528
34513 82826
54802 9376
167727 126397
185628 108018
1745 42120
90597 37109
31897 85002
14522 137665
24778 164762
104667 88692
195311 67768
163883 8537...

output:

99968
177793 97163
89376 99011
112550 84931
197865 117394
20781 125356
125356 21761
57568 21761
182875 97163
198214 80377
148624 69066
129475 29288
49566 80377
117394 25768
96430 100831
195235 26911
171943 193267
58023 9331
162773 131593
117465 131593
169033 121724
123311 131593
42107 3444
3444 1243...

result:

ok OK!

Test #59:

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

input:

199957
88614 184184
38035 199289
18777 111658
56683 45067
5509 172115
163655 61311
74445 79563
19166 148719
86332 165911
58281 62645
21599 142122
14144 150457
195151 136941
172228 129287
140681 182568
11843 58498
107204 45467
71185 4995
139571 143055
134088 165041
143987 16288
150087 130339
123136 6...

output:

99978
94121 1
69294 26829
178863 149030
49222 1083
185729 41558
170130 30751
41558 36662
36662 64026
32517 79414
83349 17706
117835 65135
65135 105489
85712 79414
147504 140593
178810 69313
75447 114225
123467 83710
65664 110409
168205 83710
83165 168045
162239 194002
168045 54101
120276 21301
21301...

result:

ok OK!

Test #60:

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

input:

199921
33997 18326
53963 59408
108385 47626
33272 97976
122313 115689
44290 7670
29106 85161
164828 97467
157804 64989
155124 86920
179976 22885
161616 144799
23294 118418
129925 73440
189916 189275
63389 106916
33718 132810
50055 188175
199624 110266
143613 82602
83607 179545
18071 101655
146537 16...

output:

99960
110485 148974
28461 92731
158395 8073
166762 191398
186643 172580
128775 106525
75716 191398
192586 176086
79459 67558
123431 176086
84945 149628
70814 46724
22725 130923
186125 191589
24056 130923
65406 191589
30704 102414
83490 151105
63516 96211
140468 81674
29750 149953
140701 119684
14995...

result:

ok OK!

Test #61:

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

input:

199915
122582 87063
188805 122876
16790 105312
16903 33475
197834 184107
162147 3607
170356 18641
59081 112380
12292 96443
19356 157801
21957 19045
9119 94921
112685 131710
13544 138493
161747 19805
173405 181506
136891 2669
59179 60948
64223 172398
25352 175425
40884 5721
188956 52097
171615 121166...

output:

99957
55861 9806
144671 185617
92962 159626
159339 109036
117264 11147
99640 155701
67479 31767
120106 28621
84047 169780
34447 67647
64152 155083
126114 95659
95659 155083
20715 55101
184622 19903
194115 82774
126691 28621
19219 111010
140592 134604
111010 28621
163976 188332
151709 188332
6236 456...

result:

ok OK!

Test #62:

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

input:

199940
66456 140097
103102 87684
127778 4150
189931 125840
82216 127778
41510 90771
152439 40469
198408 195551
87684 69470
127778 128952
62306 125840
185622 162713
151168 90771
90771 181481
178009 158099
187881 87684
87684 19
158168 195551
66456 150724
187640 127778
80509 66456
87684 167836
10178 19...

output:

99969
195401 105300
28317 173525
146848 193050
142391 136884
115201 32258
119902 193311
177958 157267
14911 66367
105819 10806
141815 133000
183844 71796
43803 95154
164727 70223
45783 146749
187350 144813
47545 140955
197015 175901
50834 63969
1196 24006
60548 127809
27034 157075
13125 129840
15519...

result:

ok OK!

Test #63:

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

input:

199977
164143 138916
84005 21816
162732 138916
96290 129265
84005 175111
84005 85173
44130 41927
36086 138401
100745 152361
89138 84005
103066 109847
157121 152361
154208 44130
113806 80547
146218 147963
173481 113806
129265 174558
30407 138916
44130 130076
84005 89033
43123 146218
138916 10660
3608...

output:

99988
12606 41118
123722 160083
152258 133773
44181 153634
21095 157970
123957 151116
42141 88183
66611 23656
190740 163438
54326 179281
81939 188154
89636 190790
91228 185100
135694 34374
107837 56962
198966 16605
93667 60818
116924 8153
39309 118489
8668 111648
35287 15176
189457 152078
31875 1261...

result:

ok OK!

Test #64:

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

input:

199942
90485 105332
48294 44231
41038 35338
91002 86846
35187 197389
39380 94397
168242 54395
35338 72784
29872 91002
94397 87968
168242 45799
197389 167786
159284 146996
39315 168242
49039 146996
91002 113537
98226 146996
186324 184995
89352 94397
121990 168242
133689 21171
51166 105332
26280 35338...

output:

99970
141232 155384
144550 59071
98307 27086
68339 185557
97317 57189
58360 184505
180725 17926
23021 128915
162536 105687
160517 184878
74584 88102
165652 160416
11956 91454
90014 94988
1489 173392
122899 124930
52169 89767
61379 58011
95145 71609
109127 47589
79871 3315
147970 86614
84000 10481
40...

result:

ok OK!

Test #65:

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

input:

199913
139902 85199
2061 113204
34626 38253
121462 113204
143383 76969
151308 11997
38253 10763
38253 116890
118068 139902
13143 27800
76969 93855
35878 38253
80596 87300
11290 27800
42415 87300
38253 185231
62770 175557
42098 97752
38253 161302
144003 97752
139902 73086
165013 27800
38253 56548
769...

output:

99956
16009 45356
16931 173263
125903 63597
168022 175564
66898 128903
147653 146570
138600 17801
30335 12807
102056 13477
133111 192516
21521 196263
144135 54620
45293 84397
86197 27801
8018 33728
103683 134616
91831 75446
111334 1839
29945 106180
74190 158922
179911 177807
92255 142520
41758 13037...

result:

ok OK!

Test #66:

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

input:

199955
40520 132592
172032 132247
13784 68836
34039 75050
32619 120665
124108 96305
96428 3448
187356 127594
150635 184872
136659 53645
31499 121234
5432 136402
193507 137831
120657 156354
139161 97649
163315 98207
156632 1659
23273 28896
196113 54618
145873 146004
104885 68240
172773 153580
146689 ...

output:

99977
93025 71751
132141 71751
162200 159753
112801 191586
165692 191586
149028 46440
32027 127544
25032 143006
181072 166905
166905 184834
89045 196007
142711 32187
154202 103233
103064 54552
54552 180487
64325 40131
25775 139152
27784 40131
40131 98116
83996 23207
153207 103233
48474 148392
128859...

result:

ok OK!

Test #67:

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

input:

199974
15339 39709
5607 42178
24227 143689
132066 193157
45718 36378
155262 170804
175056 175681
194460 68612
65199 20645
63888 183985
176171 121527
196797 24532
142654 61381
1060 26023
139203 21340
134044 38959
123291 48096
183803 60994
40427 122797
4493 155458
143909 8627
175071 42994
170433 18820...

output:

99986
64522 152476
152476 81148
193345 1
28508 61633
16926 121706
43361 159132
159132 102668
102668 183215
199368 28858
28858 125352
170836 125352
171543 148331
97106 148331
98993 47067
107449 185585
34315 121141
185585 82201
82201 44488
90494 61231
88679 127484
37987 52362
172371 30286
151667 37777...

result:

ok OK!

Test #68:

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

input:

199993
190169 142345
22003 36453
182819 73168
111663 85123
187544 176767
126926 166283
88876 13900
24668 171944
210 12847
15581 60591
33750 114768
149450 115466
95893 144968
114551 43555
182387 15540
154803 41651
110709 103926
20703 167054
150751 98434
161866 84604
80196 148638
198436 165233
102487 ...

output:

99996
149065 27018
26963 86705
86705 124582
86333 93659
177587 94080
131270 35932
74302 35932
187094 133177
191320 71389
181305 51235
51235 8008
6795 103683
161340 174721
29779 70060
184926 97261
82971 157077
86832 27325
179084 97261
49685 28420
191182 51101
51101 129114
168392 9655
46245 45909
5859...

result:

ok OK!

Test #69:

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

input:

199905
172929 9663
119374 149323
36000 79028
157727 100775
195854 74044
160292 107613
115887 20358
162068 171020
167418 78328
43042 56479
85750 53820
195187 2510
72093 69934
40429 133662
85651 68063
36269 114971
67580 5297
123134 191375
69767 27940
194809 103152
131197 69198
70570 172046
140282 1981...

output:

99952
24113 44718
126788 66518
66518 44718
18877 147980
107038 185119
11533 158597
7358 75304
75304 148294
148294 73966
73966 151178
72080 56931
90980 103352
50021 56931
152658 163965
77981 27797
4790 15242
41418 156018
77602 156018
110506 163919
55156 163919
126816 145230
7240 59670
145230 138007
7...

result:

ok OK!

Test #70:

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

input:

60491
12181 57085
14666 5992
17058 50664
47424 44136
27981 45709
12600 28973
4340 18463
29707 29034
44225 51679
37548 8956
11461 53021
19716 40198
25332 58844
29276 9303
30943 58859
41432 42611
22575 36018
38508 49812
27074 24480
54605 45088
487 50483
35065 14426
2340 51264
30506 5701
37159 22959
13...

output:

30245
49766 58264
36140 23080
48289 23080
1852 50787
653 50787
47693 44947
43246 58264
28465 42088
42528 39292
42088 23919
46052 9875
46632 14922
23409 47322
1574 49187
45112 14922
15632 33577
41724 25842
41687 35488
35488 53218
57681 16435
44243 6641
29765 30599
22035 293
46942 35820
39090 35820
13...

result:

ok OK!

Test #71:

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

input:

55143
47431 40215
18547 5296
45636 32729
24402 34827
33614 51580
54370 5236
18071 31086
39859 26642
46317 6846
25037 11168
26326 48044
13108 14164
14585 17504
4715 51111
558 644
39807 35745
54740 22551
43220 17222
44651 52351
39984 40540
49298 54379
24552 52467
941 32928
13064 27670
28137 46518
1638...

output:

27571
16309 18245
21200 48520
17071 1
40240 14915
41968 14915
49300 2874
46932 37928
48655 26918
39251 26918
2874 44293
23498 763
763 26978
1453 47360
25870 19241
21401 38131
4552 8686
42359 8686
4064 40299
20555 19241
18686 40877
52531 16801
9286 16586
4744 3784
49399 52870
3300 43327
6438 43327
26...

result:

ok OK!

Test #72:

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

input:

37855
13076 8382
25950 5204
28117 7356
31882 16227
2302 30699
13063 5513
1431 22479
32641 19220
32260 31975
17214 20131
15856 15604
18284 5571
16829 15195
14504 33280
32901 13132
16762 25638
29815 10256
6952 4259
11789 31635
7625 18630
15417 20291
28669 10409
2536 21310
25231 23075
2165 20171
18871 ...

output:

18927
24529 33007
9766 33007
19522 2312
32530 10271
7522 33007
15017 5468
11814 33007
3960 33007
1394 1273
28443 1273
22610 25222
14440 1276
17601 28916
7240 2258
7402 13889
10233 24415
37698 8062
17760 16636
8572 16636
4203 28299
27874 23124
26625 28992
404 31344
4030 9041
54 9041
22246 31344
1829 ...

result:

ok OK!

Test #73:

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

input:

98460
50549 47064
28713 37846
53842 4190
96199 71967
27412 47653
89811 20107
21776 38192
2389 68566
26695 52547
15638 44169
82697 55721
87049 52538
92136 83719
48406 71242
59742 67163
36029 97370
65139 19373
56436 51550
28420 22891
83192 38598
28807 56685
55511 41972
75102 1437
19717 31862
97505 509...

output:

49229
58151 23506
23506 53951
14912 9931
38402 24133
75774 53480
24074 97293
84677 9367
91598 50872
90473 32423
669 96853
81141 19582
29673 75367
23350 62976
49739 27415
93329 50872
23082 50872
32242 61494
67982 1287
1287 56025
83869 43100
56025 35425
43100 44068
86333 76989
25958 59347
72275 44884
...

result:

ok OK!