QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#69521#989. Into Cactuschenshi#AC ✓81ms24096kbC++692b2022-12-28 08:56:362022-12-28 08:56:37

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-12-28 08:56:37]
  • 评测
  • 测评结果:AC
  • 用时:81ms
  • 内存:24096kb
  • [2022-12-28 08:56:36]
  • 提交

answer

#include<cstdio>
#include<vector>
using namespace std;
const int o=4e5+10;
int n,h[o],cnt,ax[o],ay[o],K;
struct Edge{int v,p;}e[o];
inline void ad(int U,int V){e[++cnt].v=V;e[cnt].p=h[U];h[U]=cnt;}
bool dfs(int nw,int fa){
	vector<int> vec;int sz;
	for(int i=h[nw];i;i=e[i].p) if(e[i].v^fa) if(dfs(e[i].v,nw)) vec.push_back(e[i].v);
	sz=vec.size();
	for(int i=0;i<sz-1;i+=2) ax[++K]=vec[i],ay[K]=vec[i+1];
	if(sz&1){if(fa) ax[++K]=vec.back(),ay[K]=fa;return false;}
	return true;
}
int main(){
	scanf("%d",&n);
	for(int i=1,u,v;i<n;++i) scanf("%d%d",&u,&v),ad(u,v),ad(v,u);
	dfs(1,0);
	printf("%d\n",K);
	for(int i=1;i<=K;++i) printf("%d %d\n",ax[i],ay[i]);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 2976kb

input:

1

output:

0

result:

ok OK!

Test #3:

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

input:

2
1 2

output:

0

result:

ok OK!

Test #4:

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

input:

3
3 1
1 2

output:

1
2 3

result:

ok OK!

Test #5:

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

input:

4
1 3
1 4
2 1

output:

1
2 4

result:

ok OK!

Test #6:

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

input:

5
5 4
2 3
1 2
1 4

output:

2
5 1
3 1

result:

ok OK!

Test #7:

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

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: 2ms
memory: 3060kb

input:

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

output:

3
4 6
3 7
7 1

result:

ok OK!

Test #9:

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

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: 2ms
memory: 3020kb

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: 2ms
memory: 3024kb

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: 3080kb

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: 3060kb

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: 2ms
memory: 3012kb

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: 2ms
memory: 3036kb

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: 2ms
memory: 3060kb

input:

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

output:

3
3 2
5 4
6 7

result:

ok OK!

Test #17:

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

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: 0ms
memory: 3096kb

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: 2ms
memory: 3064kb

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: 2ms
memory: 3088kb

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: 0ms
memory: 3064kb

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: 2ms
memory: 2968kb

input:

6
3 2
2 5
1 3
3 4
6 4

output:

2
6 3
5 3

result:

ok OK!

Test #23:

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

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: 2ms
memory: 2968kb

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: 2ms
memory: 3012kb

input:

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

output:

3
4 2
5 2
6 2

result:

ok OK!

Test #26:

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

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: 2ms
memory: 3036kb

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: 0ms
memory: 2964kb

input:

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

output:

3
5 1
4 6
2 7

result:

ok OK!

Test #29:

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

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: 2ms
memory: 3036kb

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: 2ms
memory: 3076kb

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: 2ms
memory: 2996kb

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: 3060kb

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: 2ms
memory: 2980kb

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: 3172kb

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: 2964kb

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: 2ms
memory: 3012kb

input:

5
5 4
2 3
1 4
1 3

output:

2
2 1
5 1

result:

ok OK!

Test #38:

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

input:

1

output:

0

result:

ok OK!

Test #39:

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

input:

2
2 1

output:

0

result:

ok OK!

Test #40:

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

input:

3
1 3
3 2

output:

1
2 1

result:

ok OK!

Test #41:

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

input:

4
2 4
1 3
2 3

output:

1
4 3

result:

ok OK!

Test #42:

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

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: 2ms
memory: 3172kb

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: 2ms
memory: 3060kb

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: 3092kb

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: 17460kb

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
17378 129720
129720 195706
195706 136025
136025 103252
103252 87350
87350 44878
44878 73369
73369 37525
37525 83657
83657 175861
175861 178722
178722 53914
53914 138504
138504 25630
25630 7120
7120 153349
153349 92716
92716 65378
65378 1813
1813 64457
64457 49165
49165 57497
57497 137337
13733...

result:

ok OK!

Test #47:

score: 0
Accepted
time: 58ms
memory: 17988kb

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
81769 124755
124755 33825
33825 161864
161864 160059
160059 139400
139400 135927
135927 99169
99169 123734
123734 52316
52316 193129
193129 152185
152185 45736
45736 40355
40355 117740
117740 79538
79538 180887
180887 181423
181423 159185
159185 70502
70502 74463
74463 180673
180673 69876
6987...

result:

ok OK!

Test #48:

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

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
23452 10636
10636 195043
195043 179234
179234 147681
147681 113415
113415 98565
98565 190046
190046 160807
160807 59997
59997 105472
105472 150510
150510 33397
33397 150061
150061 37984
37984 122503
122503 140401
140401 192266
192266 105994
105994 192996
192996 122603
122603 175129
175129 5917...

result:

ok OK!

Test #49:

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

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
39794 161599
161599 47081
47081 143393
143393 20310
20310 40447
40447 119519
119519 142292
142292 149252
149252 132030
132030 71278
71278 72516
72516 104406
104406 52786
52786 36265
36265 107076
107076 171135
171135 168796
168796 124755
124755 129589
129589 17656
17656 181721
181721 103535
103...

result:

ok OK!

Test #50:

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

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
110415 114520
34114 199755
18299 50829
199755 20150
20150 98806
99645 129216
129216 57513
57513 171135
126552 72501
199757 191224
93451 41081
81331 188621
85936 92053
178224 9641
195748 76286
40505 67200
159379 76286
145908 42734
152696 40327
29029 5992
99512 64343
185605 64343
112365 28464
89...

result:

ok OK!

Test #51:

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

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
106141 139830
99740 78280
133910 170985
129510 135582
106310 22814
188532 144662
12630 95093
133758 174548
92809 42375
174548 35379
2247 20952
162281 9608
138644 23927
23927 8515
67407 76143
76143 23515
95933 43257
120028 43917
143866 148265
43257 150203
53332 179106
155702 152247
140312 16720...

result:

ok OK!

Test #52:

score: 0
Accepted
time: 78ms
memory: 15864kb

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
123328 27608
27608 33004
65222 140573
105896 76777
128885 140573
70805 177327
11112 44964
113544 138950
185378 138950
114809 7905
107592 7905
62510 102180
52688 71008
10618 127385
49777 90610
158871 193415
37280 66172
193415 193861
168375 13756
77207 36991
146077 13756
58668 70363
87188 163536...

result:

ok OK!

Test #53:

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

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
85452 150747
94579 46609
56640 46609
186283 192116
140976 145360
170380 101750
101750 40774
190781 63274
194484 82233
39082 63274
119576 147230
46821 45602
85202 155672
124938 76112
76112 94107
66756 28412
122704 117617
53385 2241
103810 143821
1683 198949
9870 143821
124687 171564
98149 13450...

result:

ok OK!

Test #54:

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

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: 59ms
memory: 8272kb

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: 47ms
memory: 8304kb

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: 49ms
memory: 8344kb

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: 60ms
memory: 7744kb

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
174779 165422
145080 58688
131342 73013
62280 188205
9421 181260
152087 151693
92748 167818
53593 189326
56477 35752
186607 152623
164230 106795
33321 193122
43919 17914
17914 6823
165667 102180
146057 106795
811 56453
89722 175397
152299 88460
190261 94
92507 130576
40473 98031
72472 9451
456...

result:

ok OK!

Test #59:

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

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
129388 66674
117381 33841
47296 59815
191504 39452
45196 64346
193505 129194
118016 50568
80909 20253
193550 64346
83083 122470
158093 160577
66096 29089
92413 175861
34198 173165
108052 30854
31742 12268
160368 65299
173165 86614
175861 88573
22231 114447
175312 40382
157623 3249
205 120062
1...

result:

ok OK!

Test #60:

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

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
175215 132773
127175 30604
18213 24469
189737 109591
105238 174498
41909 63391
90010 24851
112635 111474
130331 187958
67841 963
7895 963
963 63391
67087 63391
190619 40340
60408 19783
51762 40340
190164 40340
71214 174498
56028 109591
29317 21747
8233 116825
31241 109591
15814 111815
191294 9...

result:

ok OK!

Test #61:

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

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
168229 183206
84752 183206
183206 5311
148268 190834
190834 7255
153920 117065
117679 124011
21676 67887
182225 116259
74272 168820
19668 105128
67887 1631
25121 176914
40554 176914
73219 108447
147104 68538
95521 168075
127374 130521
168075 501
63857 56309
69657 154456
90809 56309
126510 3819...

result:

ok OK!

Test #62:

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

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
40148 84636
169953 85539
144361 143408
55043 38898
34703 84382
4362 6707
35129 109639
88088 101938
12486 174348
173092 80508
125817 50396
68467 25290
152843 119158
188195 21067
7150 169803
75310 157006
171133 26060
138497 23525
127262 127494
83112 97069
61355 181524
24697 182951
66595 167847
4...

result:

ok OK!

Test #63:

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

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
55441 47596
107091 127211
85936 26728
95405 89240
83754 183069
31957 78731
105682 6803
122797 149611
50561 135174
97944 189153
42462 128861
55354 11603
12473 13598
127428 103352
63459 164566
135527 120387
45291 176423
163361 173555
161396 157344
151118 150198
87178 134603
72122 86873
32153 767...

result:

ok OK!

Test #64:

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

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
88833 114181
164140 56672
122388 109466
143709 32410
114862 65937
5355 117781
188435 65711
36376 22499
118716 23342
172382 46731
71315 82730
73434 134852
109692 142694
172858 104591
187596 126016
117107 185600
138368 139712
194731 74076
82479 109388
15147 9419
10733 160962
171050 119041
65831 ...

result:

ok OK!

Test #65:

score: 0
Accepted
time: 58ms
memory: 7820kb

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
59134 156285
96938 133134
42328 140413
147721 1303
184272 116997
145379 113534
111462 31745
31938 81502
109255 37998
133066 4314
77492 10289
137244 3095
167031 122259
31805 114257
194869 33576
141016 64962
45119 50186
59577 5695
159050 70378
37407 20431
167994 35060
144957 139029
130260 31653
...

result:

ok OK!

Test #66:

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

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
144965 1
149847 89923
84636 142987
199435 148447
142987 148447
14225 177277
172926 70515
36275 146656
147546 146656
91086 188211
188211 86675
86675 23365
193985 118441
171024 37531
37531 183554
137444 183554
183554 89237
172912 30651
147239 80888
75058 128710
13564 191877
173148 145013
40934 1...

result:

ok OK!

Test #67:

score: 0
Accepted
time: 78ms
memory: 10560kb

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
45009 34768
81925 168042
16568 152150
196487 118028
89074 118028
112670 32777
112819 112533
112533 90435
22978 179431
43800 179431
115802 26065
146461 196493
26065 90435
90435 32777
32777 173240
14617 34261
423 29337
9638 158713
158713 99985
83659 65475
32141 94368
133657 21315
198377 128087
1...

result:

ok OK!

Test #68:

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

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
59306 20341
154282 164944
92328 32547
135920 12725
69587 164944
34200 147252
114647 67984
147252 85902
136625 198562
167222 70599
25859 183980
90048 149115
67632 26149
149115 26149
118969 157430
157430 76079
147247 46199
28954 181512
135519 195993
195993 113540
12584 154303
144974 79757
143174...

result:

ok OK!

Test #69:

score: 0
Accepted
time: 81ms
memory: 10116kb

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
49379 142336
142336 1737
10613 63957
63957 95988
95988 166945
88192 91041
34454 171908
155620 91041
153271 179450
179450 33982
181346 173984
109414 8693
16171 34576
166929 78429
78429 158952
62056 114674
121156 33265
151770 158952
33265 111843
4352 57864
57864 160306
160306 30999
93656 186669
...

result:

ok OK!

Test #70:

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

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
9692 18225
1354 5401
41088 5401
39431 24083
14695 24576
47793 58917
700 58917
988 2520
42852 8336
53099 57924
29676 57924
18011 57721
8204 24291
52024 60088
21668 17686
3009 3312
25939 50874
26292 9877
14753 9941
3194 58466
56071 58466
49872 52481
7795 58457
60439 9877
50341 33900
47815 53800
...

result:

ok OK!

Test #71:

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

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
34156 22194
37039 8550
3065 30420
50429 44472
13966 8550
54489 28734
42372 43269
24031 48
48 28678
35408 44244
49916 37755
45940 51760
48303 31424
31424 41259
5684 35042
37755 21375
28742 3118
30337 11484
1642 12455
9617 17606
11484 50893
17606 28235
34624 50997
33123 38137
27019 25188
44244 4...

result:

ok OK!

Test #72:

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

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
15066 24973
19828 26465
16147 20528
14551 31786
36839 30998
25582 30998
30998 31786
31786 33683
36454 8390
21007 13783
13783 33683
37717 10860
11482 7267
1294 1273
20240 1273
6455 10980
23675 6086
35313 4099
2984 15006
24244 28
15006 29710
13573 25428
21177 29459
25428 24201
26611 4347
31528 4...

result:

ok OK!

Test #73:

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

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
40384 51716
27933 63928
43670 97713
81949 47945
50904 90223
33612 85106
26347 90223
56947 63928
91456 62840
62840 47326
26628 11021
33600 49404
56718 17579
32926 17579
17579 11153
87289 84264
49395 14353
86112 9891
27619 5215
57829 92751
63928 11153
85080 24915
36767 33916
15339 13287
56443 13...

result:

ok OK!