QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#32870#1173. Knowledge Is...Wu_RenAC ✓156ms12116kbC++17801b2022-05-25 11:07:272022-05-25 11:07:28

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-25 11:07:28]
  • 评测
  • 测评结果:AC
  • 用时:156ms
  • 内存:12116kb
  • [2022-05-25 11:07:27]
  • 提交

answer

#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
struct seg{
	int l,r,id;
}a[300010];
int n,m,ans[300010];
priority_queue<pair<int,int> >er,rt;
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) scanf("%d%d",&a[i].l,&a[i].r),a[i].id=i;
	sort(a+1,a+n+1,[](seg &a,seg &b){return a.l<b.l;});
	for(int i=1;i<=n&&m;i++){
		if(er.size()&&-er.top().fi<a[i].l){
			ans[er.top().se]=ans[a[i].id]=m--;
			er.pop();
			rt.push({-a[i].r,a[i].id});
		}
		else if(rt.size()&&-rt.top().fi<a[i].r){
			ans[a[i].id]=ans[rt.top().se],ans[rt.top().se]=0;
			er.push(rt.top()),rt.pop();
			rt.push({-a[i].r,a[i].id});
		}
		else er.push({-a[i].r,a[i].id});
	}
	for(int i=1;i<=n;i++){
		if(!ans[i]&&m) ans[i]=m--;
		printf("%d ",ans[i]);
	}
	puts("");
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 5796kb

input:

7 5
9 10
7 9
3 4
9 10
2 6
8 9
5 8

output:

3 4 5 5 4 2 3 

result:

ok answer = 7

Test #2:

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

input:

2 2
1 2
3 4

output:

2 2 

result:

ok answer = 2

Test #3:

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

input:

2 1
1 2
2 3

output:

1 0 

result:

ok answer = 1

Test #4:

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

input:

1 1
4 26

output:

1 

result:

ok answer = 1

Test #5:

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

input:

500 258
1 3
3 5
2 4
3 5
4 5
4 5
1 4
1 2
3 5
2 5
2 5
4 5
4 5
4 5
2 3
1 4
1 4
1 4
4 5
4 5
2 3
4 5
3 5
3 5
1 5
1 4
2 5
1 5
3 5
3 4
4 5
2 3
3 5
3 5
4 5
2 3
1 5
1 5
2 3
2 3
3 4
3 5
3 4
1 3
1 2
1 5
4 5
2 3
2 4
1 3
4 5
4 5
4 5
1 3
3 5
4 5
3 5
1 5
1 2
1 2
3 5
3 5
4 5
3 4
3 5
2 3
2 5
2 4
2 5
3 5
2 3
1 5
4 5
...

output:

141 247 140 242 191 192 139 221 258 138 137 205 198 199 142 136 135 134 203 170 143 172 226 225 133 132 131 130 230 129 185 144 224 227 210 145 128 127 146 147 126 221 125 148 222 124 207 149 123 150 219 220 122 151 229 121 233 120 223 224 236 249 119 118 244 152 117 116 115 248 153 114 113 112 111 ...

result:

ok answer = 376

Test #6:

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

input:

500 242
8 9
9 10
2 9
8 10
9 10
6 10
4 8
4 5
2 6
7 10
3 8
1 8
1 6
5 9
7 8
8 10
8 9
8 10
2 9
2 3
6 8
3 10
5 9
1 3
6 8
4 10
9 10
8 9
8 10
1 9
3 9
3 7
2 3
6 10
3 6
6 10
3 4
3 6
9 10
5 7
8 10
6 10
5 6
5 7
7 8
1 3
4 7
9 10
4 9
2 4
8 9
1 3
8 10
3 4
9 10
4 9
5 10
8 9
1 3
1 5
8 10
3 4
8 9
3 9
3 6
3 10
6 7
7 ...

output:

97 73 13 111 71 189 12 174 129 141 11 10 130 217 9 107 102 168 8 223 7 6 204 224 5 227 36 118 108 4 3 77 225 178 131 184 199 132 33 78 126 177 133 79 14 226 80 29 224 200 166 227 109 201 40 235 220 2 228 175 94 202 77 1 134 242 81 15 0 21 135 129 233 161 82 17 16 17 83 0 18 19 14 20 64 87 84 148 176...

result:

ok answer = 471

Test #7:

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

input:

500 250
50 84
36 68
94 98
13 88
4 62
45 74
80 89
56 87
65 89
44 52
69 78
29 76
61 90
91 99
16 98
69 92
50 77
86 95
73 79
83 90
78 89
1 79
81 86
14 37
91 94
27 48
11 73
94 97
49 80
15 60
26 39
34 76
69 77
22 72
6 78
92 96
46 83
83 94
62 95
77 80
32 72
46 90
41 88
47 91
68 75
14 36
26 43
14 87
49 74
2...

output:

186 97 197 29 127 18 57 156 121 167 107 68 142 118 249 106 2 183 89 112 65 58 56 214 24 187 74 15 187 140 210 69 3 80 62 153 212 51 136 70 81 201 213 195 13 217 198 31 72 211 190 58 120 100 156 168 14 135 6 61 212 90 117 246 159 184 35 110 30 235 83 196 17 15 224 89 238 92 62 162 100 221 52 143 49 1...

result:

ok answer = 500

Test #8:

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

input:

500 250
614 964
380 709
272 969
626 788
156 927
270 842
448 984
184 224
602 953
249 887
665 904
212 300
715 787
557 948
906 977
117 824
504 567
848 884
817 824
462 930
768 816
890 940
193 784
653 897
973 974
21 64
515 700
361 595
670 1000
854 943
530 739
816 828
918 979
270 354
288 369
56 697
622 92...

output:

119 32 227 5 247 232 184 235 197 243 170 215 6 141 26 45 134 199 49 177 62 30 55 102 7 250 39 124 96 160 26 201 23 211 208 91 116 182 234 128 230 12 194 67 82 167 41 47 4 175 224 130 126 167 79 95 57 205 214 116 132 93 247 147 222 59 157 236 92 117 118 240 171 138 140 200 34 214 204 198 144 142 72 2...

result:

ok answer = 500

Test #9:

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

input:

500 250
7369 7544
7194 8983
8758 9759
1077 5486
8604 9375
9468 9854
9259 9276
6147 7585
2527 2818
1034 2634
1382 3694
1863 8040
5952 6207
685 3506
3618 9242
1204 3382
569 8063
6515 6861
6025 7856
2053 7457
961 3813
87 9321
2787 9389
4754 8473
6781 7817
7113 9489
6831 9207
5210 9788
7003 8417
9361 99...

output:

34 93 197 172 110 19 114 33 238 242 221 66 139 225 224 228 65 92 12 83 219 23 240 192 17 97 169 179 101 150 109 204 89 199 90 207 213 152 250 48 211 26 169 121 138 69 156 226 24 38 130 182 22 177 128 234 51 228 197 244 85 155 50 187 120 68 206 34 243 58 44 101 203 82 229 195 212 235 176 144 78 28 18...

result:

ok answer = 500

Test #10:

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

input:

500 250
94664 97792
42412 79567
78199 93246
1309 6050
21787 62661
32852 47312
72165 96025
22335 87724
98737 98949
32333 45109
98197 98696
66004 84303
64971 93765
48220 78217
75132 77121
3250 99214
76296 83179
18937 19783
24224 29268
76617 77302
64571 88215
56891 67172
32945 97861
75 35393
74113 9254...

output:

12 205 61 247 129 185 94 238 66 197 5 119 121 1 7 250 70 239 226 4 133 105 224 217 124 130 166 45 11 169 241 23 193 45 184 189 119 110 85 234 114 153 99 198 8 225 140 218 20 247 149 37 59 196 237 230 38 160 75 143 186 39 19 148 161 208 36 1 154 152 81 151 57 17 142 15 182 30 181 28 207 55 229 82 65 ...

result:

ok answer = 500

Test #11:

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

input:

500 250
249258 633953
692064 923461
236526 494453
63236 665418
813697 915066
231324 853677
850867 946695
354813 439441
555846 920488
978644 998640
280905 357712
300337 869138
111591 375301
754196 825433
681966 906746
566646 913535
958025 996696
122927 989918
162477 948024
464228 474279
735561 874801...

output:

121 101 170 112 64 46 110 188 165 163 213 227 209 127 108 153 9 247 243 176 84 199 192 74 53 38 78 57 3 163 207 105 142 95 158 238 221 195 79 143 13 169 79 45 142 63 164 38 139 36 145 69 145 186 129 45 13 116 120 196 76 194 71 171 205 198 100 167 22 85 138 140 156 133 77 115 118 224 74 241 174 168 9...

result:

ok answer = 500

Test #12:

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

input:

500 250
6592945 8873042
9610368 9920200
3224618 6472104
7312354 9075859
366928 6614625
7107690 8990826
4712035 4850963
8634845 9127832
7054047 9358572
9187658 9589004
6621468 7586829
7375455 9328669
2076424 5016969
8848028 9107864
6625184 7368290
801465 9195989
3228163 3972918
3386844 9342995
366556...

output:

133 13 128 178 121 158 200 143 111 30 31 161 195 100 53 28 216 238 122 218 149 199 77 79 233 9 91 231 234 99 67 208 52 126 42 94 76 123 40 120 113 5 22 221 4 77 168 31 108 29 88 95 124 115 117 174 144 194 39 202 203 245 95 200 153 233 2 78 68 174 98 155 23 141 249 82 222 105 50 190 165 83 136 184 23...

result:

ok answer = 500

Test #13:

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

input:

500 250
80571694 85803063
51768736 93848632
66413497 76615996
83050382 99992350
8073944 91324998
18047715 58689728
8708611 51201572
29489394 73271018
24239602 65348190
64220050 71579063
50414980 65877100
86190696 92867069
34515283 94334986
8551872 68258618
18296336 36436754
94799273 95174013
8666001...

output:

65 165 10 59 30 132 166 45 113 58 99 51 224 104 216 98 48 150 203 190 174 169 135 182 131 8 184 194 3 80 160 96 56 32 245 192 60 18 106 238 191 201 183 12 170 83 81 183 23 163 68 243 149 139 138 140 239 95 107 127 58 230 213 48 147 101 249 143 212 130 22 161 210 5 55 19 102 163 222 79 72 243 166 211...

result:

ok answer = 500

Test #14:

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

input:

500 250
966174904 986708402
946554500 952001265
914838165 993300555
89795526 975540133
235762788 364735276
340662053 547524158
330027012 366955963
633114013 756706517
868314624 992777729
843328851 965147665
943958099 956095329
243336632 710281553
576757478 948905845
778782824 978759308
370097409 470...

output:

225 131 212 6 213 155 212 31 192 230 17 96 147 74 182 3 19 205 75 30 39 182 247 190 187 110 238 152 47 163 203 98 122 200 233 2 179 5 178 199 61 238 115 165 173 102 153 145 105 82 66 122 6 209 51 78 138 146 114 129 144 11 15 19 86 81 33 246 28 189 64 89 128 250 35 176 154 11 132 159 126 214 125 14 8...

result:

ok answer = 500

Test #15:

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

input:

500 67
1 2
1 2
2 3
1 2
2 3
1 3
1 3
2 3
2 3
1 2
1 3
2 3
1 2
1 2
2 3
2 3
2 3
1 3
2 3
1 2
1 3
2 3
2 3
2 3
2 3
1 2
2 3
2 3
1 3
2 3
1 3
2 3
1 2
1 2
1 2
2 3
1 2
2 3
2 3
2 3
1 2
2 3
1 3
2 3
1 2
1 2
2 3
1 2
1 3
1 2
2 3
2 3
1 3
1 3
1 2
1 2
1 2
1 2
2 3
2 3
1 2
2 3
1 2
1 3
1 3
2 3
1 3
1 3
2 3
1 3
1 3
2 3
1 3
1...

output:

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

result:

ok answer = 67

Test #16:

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

input:

500 379
2 5
2 4
4 5
4 5
4 5
1 4
2 5
4 5
4 5
4 5
1 5
4 5
3 5
3 5
3 5
1 3
1 5
3 5
1 2
4 5
4 5
4 5
3 4
4 5
4 5
4 5
3 5
3 5
1 3
2 4
1 2
4 5
2 3
1 5
2 5
2 5
1 3
1 4
4 5
1 2
3 5
4 5
1 3
1 5
1 5
3 5
4 5
3 4
4 5
4 5
3 5
3 4
2 4
4 5
1 4
1 3
1 4
4 5
1 4
4 5
1 4
4 5
4 5
4 5
2 3
1 2
3 4
1 3
3 4
2 5
1 3
3 4
1 5
...

output:

275 274 311 312 317 273 272 320 322 323 271 324 374 373 371 276 270 370 348 296 301 303 269 304 305 306 268 267 277 266 349 333 278 265 264 263 279 262 329 350 372 344 280 261 260 355 338 259 335 336 356 258 257 256 255 281 254 253 252 251 250 249 248 247 282 351 246 283 245 244 284 243 242 285 241 ...

result:

ok answer = 483

Test #17:

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

input:

500 273
1 9
7 10
1 2
2 9
5 6
9 10
8 10
5 6
2 3
3 10
4 8
4 7
9 10
8 9
1 9
1 4
3 5
9 10
9 10
1 6
2 10
7 9
8 9
9 10
5 8
7 10
4 8
5 6
8 9
1 2
1 5
6 8
7 10
9 10
3 7
7 9
3 8
1 9
2 9
3 6
5 10
4 5
5 9
3 9
5 8
1 8
5 8
7 10
7 8
9 10
1 8
7 9
5 9
7 9
7 10
9 10
1 8
2 4
7 8
1 8
3 6
4 7
6 8
7 10
2 7
9 10
2 3
6 8
1...

output:

52 199 265 51 168 82 158 169 249 273 50 116 83 157 49 232 211 84 85 170 48 198 152 86 47 197 46 171 156 266 212 45 195 87 117 193 44 43 42 172 248 213 41 40 39 38 37 191 190 88 36 200 35 186 185 89 34 233 53 54 173 118 55 183 119 90 250 56 267 174 234 265 212 91 214 175 176 120 131 121 235 182 215 2...

result:

ok answer = 494

Test #18:

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

input:

500 250
47 82
75 84
56 61
27 57
32 48
28 85
15 38
36 39
56 65
88 94
87 97
64 79
15 51
50 93
83 100
74 77
59 74
66 99
57 78
51 90
47 76
64 68
89 97
15 71
38 54
57 83
26 91
90 94
98 100
70 73
40 75
52 82
67 100
14 85
57 62
47 53
40 63
79 97
3 33
16 61
4 94
94 99
68 80
23 30
41 81
54 81
51 52
36 45
54 ...

output:

201 80 130 149 189 232 214 210 109 26 125 128 175 188 42 3 17 114 184 181 64 44 116 78 159 171 235 122 90 18 70 189 109 32 123 166 115 56 223 131 10 14 104 229 208 170 170 199 166 72 6 211 203 165 77 50 18 220 44 160 108 28 132 139 21 169 186 12 58 178 45 156 73 23 70 167 224 164 63 112 119 48 143 5...

result:

ok answer = 500

Test #19:

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

input:

500 250
151 592
747 974
832 938
56 960
567 882
851 900
338 901
168 265
916 964
581 880
177 284
456 921
298 540
378 651
190 785
908 992
180 371
271 823
245 983
328 603
211 425
561 996
61 134
820 934
934 975
595 945
896 982
245 443
208 487
567 945
999 1000
483 748
882 887
383 459
607 910
57 797
12 771...

output:

130 74 45 10 143 39 214 223 79 136 219 186 152 108 59 21 207 231 230 126 198 145 247 48 77 130 25 190 168 173 1 23 30 185 126 54 64 224 179 29 167 121 192 214 226 172 114 180 244 119 95 169 232 137 111 245 66 135 44 203 153 125 131 6 175 122 189 43 3 81 78 37 33 80 186 12 182 57 236 239 14 210 101 2...

result:

ok answer = 500

Test #20:

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

input:

500 250
8878 9054
7943 8545
9886 9945
6698 8053
3466 6453
8106 8870
7114 9642
4807 4824
2334 4079
2778 3817
5111 7104
1252 4542
3555 6851
3663 5645
5567 7655
324 2086
4056 8603
1406 7470
9064 9448
1484 5836
7466 7945
2607 3711
5253 6112
3192 4008
9549 9852
9198 9709
4169 8558
2268 7806
5575 6209
826...

output:

30 60 3 105 111 54 91 159 202 208 48 185 99 142 22 238 205 74 24 137 78 212 121 204 13 21 203 65 118 178 227 76 24 229 45 207 188 96 236 214 197 6 219 23 5 48 246 133 61 170 77 115 119 35 78 240 166 109 133 153 200 49 168 160 185 28 224 101 219 11 53 56 147 152 70 158 135 191 9 165 176 61 84 155 163...

result:

ok answer = 500

Test #21:

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

input:

500 251
46165 49590
70151 85269
27899 40324
62135 64549
79159 94410
75003 79189
50178 81874
56192 88209
21577 95025
84261 96039
18414 90970
81196 83290
83331 83488
14574 39965
4268 32434
88164 89600
12144 29112
870 72365
9975 51580
92179 98369
28511 57700
33237 75390
24902 28700
94544 95300
65682 97...

output:

176 104 201 93 65 81 175 162 241 48 242 217 179 202 222 32 232 91 167 18 147 15 233 12 117 40 58 109 112 99 153 209 194 11 55 84 110 113 81 58 5 103 243 248 163 180 141 180 98 87 17 191 195 163 98 147 212 55 45 238 230 198 145 48 228 229 46 88 44 36 185 171 160 93 237 76 7 151 173 4 210 95 153 53 24...

result:

ok answer = 500

Test #22:

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

input:

500 250
997100 999305
50160 723310
530874 700434
482814 725372
898138 942005
227563 606578
465297 983061
288595 865469
971584 983736
84196 662089
716660 851207
874207 995804
742642 760966
412491 418432
721831 897885
453604 941851
404413 589262
363242 694198
71736 189776
340057 706243
591745 899767
9...

output:

1 75 37 28 177 132 188 222 7 100 90 172 6 199 88 189 144 86 235 84 145 9 130 4 96 97 9 63 243 155 105 41 239 128 70 97 6 244 159 117 26 51 157 86 223 207 39 16 38 79 173 50 62 39 136 247 129 208 223 206 127 14 125 215 15 107 248 94 213 134 94 11 32 232 8 132 36 18 148 158 66 21 156 209 188 184 144 2...

result:

ok answer = 500

Test #23:

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

input:

500 250
816808 8979893
577273 5159166
6890110 9974354
7539249 9013575
7780990 9685125
284302 8308896
2859745 8347237
5896988 9556377
4465806 5463028
8279297 8819929
1361353 5720171
2467636 8115256
5879674 7044297
661648 5198202
4725290 5204346
2612798 8161805
9812485 9996590
2285372 4614496
1962475 ...

output:

27 167 99 171 70 49 231 146 154 169 144 7 52 166 165 2 6 186 242 68 223 106 193 87 20 134 219 139 243 81 60 237 242 24 131 61 169 249 221 220 95 55 108 84 117 203 125 152 73 188 136 79 71 3 75 196 128 165 226 1 32 71 215 51 191 105 66 29 163 238 160 216 200 107 235 25 34 15 127 182 31 196 230 91 96 ...

result:

ok answer = 500

Test #24:

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

input:

500 250
81661382 94717306
89850268 94839225
72615579 73753927
19190949 39608724
129611 33966748
36897319 96344937
77381982 94746565
49637131 94881993
71774738 87773217
5955861 68864001
55863683 69339123
25998069 29895468
85528105 96959461
12833512 31610705
4726009 31932075
18119656 87239085
31722731...

output:

190 125 26 192 207 199 177 166 72 84 63 217 36 213 212 31 213 150 59 195 156 241 40 47 15 229 80 66 193 178 208 154 183 32 38 106 27 153 250 186 170 133 234 108 229 83 132 105 129 180 136 45 39 236 179 152 154 77 90 135 20 46 235 22 164 114 244 169 191 71 107 126 233 111 13 173 236 223 16 225 34 202...

result:

ok answer = 500

Test #25:

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

input:

500 250
159147753 849387872
678679305 958626578
736410066 762171088
51820203 846735349
483826312 744440062
76859389 682174032
127183476 195547079
339099076 948562984
46616987 234754210
871306758 893541852
261351936 390635591
441516403 995769500
522385081 715755202
729932064 859205804
998688267 99968...

output:

38 113 20 39 27 96 242 222 240 34 213 198 66 83 2 93 116 75 87 202 152 9 216 196 67 135 57 79 172 8 36 145 179 225 17 94 44 145 114 10 129 29 132 75 208 65 233 59 121 128 147 106 229 65 45 139 244 249 137 160 43 28 178 6 225 113 200 54 219 14 96 91 62 173 221 142 195 230 38 181 199 250 134 238 164 1...

result:

ok answer = 500

Test #26:

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

input:

500 236
1 3
1 3
1 2
2 3
2 3
1 3
1 3
2 3
2 3
1 3
2 3
1 2
1 2
2 3
2 3
1 2
1 2
2 3
2 3
2 3
2 3
1 3
2 3
1 2
2 3
1 2
1 2
1 3
1 3
2 3
2 3
1 3
2 3
2 3
2 3
2 3
1 2
1 2
1 3
2 3
2 3
2 3
1 2
1 3
1 2
1 2
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 3
2 3
1 2
2 3
1 3
1 2
1 3
1 2
2 3
2 3
2 3
1 3
2 3
2 3
1 2
2 3
2 3
2 3
2 3
...

output:

236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 ...

result:

ok answer = 236

Test #27:

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

input:

500 450
1 5
4 5
4 5
3 5
2 5
3 4
4 5
4 5
1 3
1 4
4 5
3 4
3 4
3 4
3 4
2 3
4 5
4 5
1 5
3 4
2 3
3 4
1 3
2 5
2 4
4 5
1 3
1 2
2 4
3 5
4 5
2 5
4 5
4 5
2 3
1 5
1 4
2 5
2 3
4 5
2 4
1 3
2 4
1 5
4 5
3 5
3 4
4 5
1 3
4 5
4 5
3 5
2 3
4 5
3 4
2 4
4 5
1 4
2 3
1 3
3 4
1 4
2 4
4 5
2 3
1 5
4 5
3 4
1 2
2 4
2 4
4 5
1 3
...

output:

345 365 364 437 344 343 363 362 346 342 361 341 340 339 338 347 360 359 337 336 348 335 349 334 333 358 350 421 332 428 357 331 356 355 351 330 329 328 352 354 327 353 326 325 353 324 323 352 354 366 350 322 355 349 321 320 348 319 356 357 318 317 316 347 358 315 346 314 422 313 312 311 359 310 360 ...

result:

ok answer = 500

Test #28:

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

input:

500 321
6 10
3 6
4 6
5 10
5 7
5 10
3 7
3 8
3 8
4 8
7 8
6 8
3 5
5 9
8 9
4 7
4 9
3 9
9 10
1 8
3 9
5 10
8 9
6 8
4 9
8 10
9 10
2 4
1 10
4 5
5 8
1 7
7 8
7 9
8 9
6 9
4 8
8 9
5 9
1 9
9 10
7 8
1 10
5 9
7 10
7 8
5 6
4 7
9 10
5 8
4 8
3 4
7 9
5 9
2 8
5 9
2 3
3 10
9 10
9 10
6 8
9 10
7 10
1 5
5 10
3 9
2 5
4 6
5 ...

output:

271 218 219 308 173 295 174 118 117 116 115 114 255 113 193 175 315 112 128 111 110 311 216 109 310 210 141 287 108 256 107 176 106 227 230 276 105 279 104 103 131 102 101 100 241 99 220 177 121 98 97 288 247 96 95 94 301 93 169 129 92 144 249 257 296 91 258 221 222 132 186 223 90 171 89 317 224 161...

result:

ok answer = 500

Test #29:

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

input:

500 282
8 65
78 90
26 99
97 99
94 95
1 56
62 73
41 87
46 51
70 78
81 99
15 52
98 100
39 54
31 53
20 34
9 77
75 84
2 29
4 79
92 96
6 34
23 28
4 7
11 65
3 90
63 69
48 72
82 95
41 93
47 53
65 92
46 76
39 87
25 60
87 97
18 53
10 18
68 100
31 69
38 74
15 57
40 54
16 33
46 68
77 78
42 88
45 72
14 47
2 10
...

output:

129 87 260 192 220 171 60 229 197 121 81 193 161 177 184 242 88 177 254 83 49 243 255 282 130 52 75 65 75 230 185 147 42 234 150 206 186 271 128 109 55 164 178 245 79 33 225 66 210 280 227 203 146 81 233 34 264 131 245 122 159 248 61 165 217 111 179 67 166 103 255 119 196 129 142 273 180 115 60 56 8...

result:

ok answer = 500

Test #30:

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

input:

500 300
510 553
741 866
603 700
36 128
503 944
356 533
43 466
917 960
375 678
38 84
603 748
900 954
951 972
25 548
965 980
204 928
541 594
362 453
904 939
4 547
322 583
870 911
359 470
397 896
772 953
95 483
527 853
631 748
886 955
178 468
127 202
249 912
869 887
154 386
688 948
847 853
783 908
881 ...

output:

141 130 97 295 221 206 235 156 149 300 65 142 165 197 59 288 139 239 77 198 182 255 231 252 239 227 246 69 81 234 288 279 89 252 149 96 117 83 94 56 185 187 127 251 137 249 228 152 107 171 97 222 276 260 180 172 87 119 153 233 219 203 287 237 188 206 207 100 224 179 94 131 160 274 258 82 243 257 189...

result:

ok answer = 500

Test #31:

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

input:

500 324
9666 9764
5 7711
5764 6747
2737 5398
4206 7020
351 4635
4073 5399
3611 9328
1945 8418
7455 9537
4107 8882
1584 6200
3868 4517
9853 9898
2506 4277
4014 7539
3274 7131
4991 9996
9163 9430
3958 6082
4305 9426
1905 6005
545 3515
7652 9689
1027 1438
1658 2555
3483 3669
3645 9546
3339 6780
368 978...

output:

196 145 136 236 164 260 235 295 123 166 278 203 268 271 274 107 160 267 286 209 274 214 293 157 319 312 289 290 176 79 202 156 202 198 270 141 231 137 192 181 298 256 242 253 190 156 284 104 178 264 91 305 211 87 247 206 224 187 207 223 122 215 154 122 186 172 203 108 193 126 319 77 138 118 135 254 ...

result:

ok answer = 500

Test #32:

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

input:

500 470
48935 84694
99749 99923
67360 75782
2621 28649
97920 99396
43999 62734
31792 93093
27130 95814
86217 97217
96404 98372
24819 99995
19043 61210
48522 67115
9948 85463
68373 86119
41827 44815
3885 70986
61638 63427
71822 81341
44961 51570
35696 82618
54669 54869
24868 37898
67579 83939
10309 5...

output:

387 221 238 444 224 329 439 448 407 340 451 335 288 256 317 401 294 308 343 378 430 365 422 309 379 416 276 380 361 394 405 396 452 317 257 448 267 291 239 260 272 423 469 436 262 283 470 221 362 348 235 460 419 295 280 305 355 253 441 270 322 331 234 402 395 411 394 368 435 312 381 227 431 278 396 ...

result:

ok answer = 500

Test #33:

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

input:

500 365
45762 693754
534202 559740
475894 692574
187566 781410
918494 925845
248194 930644
769148 995474
849975 944570
274210 388210
809281 978707
881685 943753
593867 809666
941967 942436
917009 921677
623403 694445
14648 44821
973042 987690
275841 883296
587146 857139
601250 981414
602336 913679
2...

output:

211 274 169 174 135 352 181 152 329 166 145 260 127 136 166 364 122 343 263 259 258 288 198 176 219 291 277 247 324 142 333 271 139 172 315 265 314 248 275 234 164 212 282 167 365 134 142 345 328 343 255 338 215 146 197 229 153 185 286 267 278 178 188 223 195 311 206 128 270 177 232 316 168 342 359 ...

result:

ok answer = 500

Test #34:

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

input:

500 435
8942882 9009137
2960339 4249642
6469497 9548984
1335505 1977271
8656424 8708138
8855830 9941526
120428 6845949
4297409 6050960
4211118 5999754
5292184 6371662
1257452 1532520
4172544 8586887
420009 9449705
9256685 9947310
6863833 8506653
5057204 7529960
4548338 8379192
3876868 8854349
331804...

output:

297 373 288 418 216 349 266 306 308 293 424 379 435 203 304 212 367 384 388 386 419 244 329 393 343 412 261 241 259 256 356 276 242 372 215 402 396 239 219 365 190 259 246 353 296 322 367 379 265 229 190 218 357 208 278 339 394 187 359 345 306 398 410 326 270 304 382 220 384 213 399 407 410 392 323 ...

result:

ok answer = 500

Test #35:

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

input:

500 331
9630011 57589654
22572747 68645689
38328399 81622066
94933642 97311408
58050148 62455346
37318915 88117879
68029610 74080275
87750454 92553676
46660595 74511474
32473872 49596859
63350036 89789394
75407776 80074289
80027461 88388093
61349773 99476335
69370190 83482845
70440345 73157341
67787...

output:

219 180 291 99 187 293 111 117 103 248 198 156 137 207 276 119 104 320 135 174 162 206 240 277 293 174 280 201 306 267 151 94 130 172 170 201 213 139 186 247 270 290 165 218 274 216 251 188 146 142 202 211 261 245 113 257 246 86 164 96 272 277 225 181 158 121 306 242 254 243 89 121 171 257 141 126 1...

result:

ok answer = 500

Test #36:

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

input:

500 477
343566419 927547482
827556406 860923139
786265094 867699424
768873550 983848460
587486802 980298997
991532621 996136199
878431940 941182908
689945290 738517801
517657626 628309437
983790110 985304593
272482247 338862765
740802646 818566102
938911500 949187177
185204729 426499829
724561978 76...

output:

441 462 285 292 396 295 253 270 347 233 440 387 242 422 246 279 384 425 275 274 320 436 244 378 459 335 426 258 367 413 349 410 275 254 236 316 298 261 377 302 470 346 379 344 249 410 239 433 452 247 266 371 346 363 289 258 450 340 282 333 385 338 420 273 318 406 383 235 374 305 232 453 229 447 335 ...

result:

ok answer = 500

Test #37:

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

input:

500 500
2 3
1 2
2 3
2 3
1 2
1 2
2 3
1 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
2 3
1 2
1 3
1 3
2 3
2 3
2 3
1 2
1 2
2 3
1 2
1 2
1 2
2 3
2 3
2 3
2 3
1 3
1 3
1 3
1 3
1 2
2 3
2 3
2 3
1 2
2 3
2 3
2 3
2 3
2 3
2 3
1 2
1 2
2 3
2 3
2 3
1 2
2 3
1 2
2 3
2 3
1 2
1 2
1 2
1 2
1 2
2 3
1 3
2 3
2 3
1 2
2 3
2 3
2 3
2 3
1 2
...

output:

500 499 498 497 496 495 494 493 492 491 490 489 488 487 486 485 484 483 482 481 480 479 478 477 476 475 474 473 472 471 470 469 468 467 466 465 464 463 462 461 460 459 458 457 456 455 454 453 452 451 450 449 448 447 446 445 444 443 442 441 440 439 438 437 436 435 434 433 432 431 430 429 428 427 426 ...

result:

ok answer = 500

Test #38:

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

input:

300000 167770
1 5
1 3
1 2
2 3
2 5
2 4
1 2
4 5
4 5
2 5
4 5
4 5
3 4
4 5
3 5
4 5
1 4
2 4
2 5
3 4
4 5
4 5
1 3
4 5
4 5
2 5
4 5
2 3
3 4
3 4
1 3
2 5
2 4
4 5
2 5
3 5
2 5
2 3
4 5
4 5
4 5
3 4
2 4
3 4
4 5
2 5
1 2
2 4
3 4
2 3
1 3
2 5
2 5
2 4
1 3
4 5
3 4
1 3
4 5
3 4
4 5
1 4
2 4
1 3
2 3
1 5
1 2
4 5
4 5
1 4
3 4
2 ...

output:

105309 105310 149084 105311 105308 105307 149085 134115 134113 105306 134111 134109 105305 134107 105304 134105 105303 105302 105301 105300 134104 134102 105312 134101 134100 105299 134098 105313 105298 105297 105314 105296 105295 134126 105294 105293 105292 105315 134136 134135 134133 105291 105290...

result:

ok answer = 230231

Test #39:

score: 0
Accepted
time: 110ms
memory: 10960kb

input:

300000 158833
1 7
8 9
6 8
4 5
7 8
6 7
2 9
3 10
7 9
4 8
9 10
5 7
9 10
8 10
2 4
7 8
1 5
6 10
9 10
5 9
3 6
6 7
8 9
4 8
2 9
5 6
2 9
7 9
6 9
5 6
5 7
1 10
5 6
4 6
4 9
4 10
1 7
5 10
7 8
2 4
3 6
5 9
8 10
8 10
7 10
4 8
8 10
6 8
7 10
1 7
9 10
1 7
9 10
3 7
2 9
2 8
9 10
6 7
9 10
2 5
2 7
2 3
5 7
1 7
8 10
4 9
9 1...

output:

58304 82090 125355 116596 25105 58305 25104 25103 101876 25102 55370 58306 55371 82092 134646 25101 116597 125390 55379 135178 91668 58307 82093 25100 25099 91669 25098 101657 125270 91670 58308 25097 91671 91672 152789 152847 58309 135044 25096 134647 91673 135038 82094 82095 102889 25095 82096 125...

result:

ok answer = 292561

Test #40:

score: 0
Accepted
time: 101ms
memory: 10616kb

input:

300000 150009
55 66
55 72
76 99
74 95
20 64
60 85
52 62
54 100
62 73
30 62
60 96
99 100
66 76
10 23
4 20
59 76
67 76
54 95
2 93
18 56
98 100
59 64
63 100
16 29
95 97
40 83
84 93
41 84
37 92
34 51
53 100
98 99
80 88
18 34
68 76
20 74
54 55
16 78
38 55
86 89
8 47
18 81
66 75
60 69
22 66
44 89
19 71
4 ...

output:

62966 31895 108360 63606 68462 85161 74444 99634 27060 74445 85177 63150 14388 141624 143832 14389 14390 99805 9558 90676 3256 68463 76979 136233 110175 124510 25964 122684 128104 102105 101139 3205 34183 130598 14391 44686 93097 36558 93098 95163 110313 30819 18859 44298 62967 118560 51217 68464 80...

result:

ok answer = 299930

Test #41:

score: 0
Accepted
time: 108ms
memory: 10456kb

input:

300000 150001
494 988
672 774
243 913
828 988
37 677
885 943
710 899
735 934
920 922
965 966
140 442
673 881
899 974
326 433
1 144
518 752
965 990
177 532
625 672
530 670
899 994
856 986
262 864
146 442
771 873
671 978
813 927
449 894
888 965
785 926
508 798
502 849
521 735
503 886
119 511
840 894
2...

output:

105578 9732 140442 28485 59189 110387 51931 46667 12437 5261 115157 60285 108533 116734 146651 18624 5307 96820 52308 53383 15898 74544 138821 115158 39255 60977 88698 114237 17732 84381 34 103814 25645 103503 101530 26316 116063 5180 92385 61553 26283 89997 30228 124311 133608 107266 98469 114438 1...

result:

ok answer = 300000

Test #42:

score: 0
Accepted
time: 119ms
memory: 10544kb

input:

300000 150000
3973 6094
9736 9998
70 8639
5326 8325
3999 7450
3662 6854
4709 4858
9516 9896
9504 9728
1704 4105
4802 6265
5454 9534
9173 9814
1798 4071
2241 3267
6925 9683
2779 4274
2065 9713
6068 8558
1614 8165
1662 4784
7247 9243
8942 9067
8742 9131
4327 8619
4359 4989
6812 8809
5706 7074
2583 708...

output:

77128 4093 21930 96773 21369 57133 106926 7551 69120 120419 72162 93791 13083 120955 131938 55562 117593 143131 77867 30429 108446 48427 133466 20190 116729 104173 58173 36910 51847 117704 72935 75950 10743 118465 63537 68093 93169 29731 94938 29206 114458 71498 87358 77925 10157 135311 114256 11203...

result:

ok answer = 300000

Test #43:

score: 0
Accepted
time: 132ms
memory: 10504kb

input:

300000 150000
12903 16631
31740 87010
65263 66809
76325 96234
6447 96997
93658 98279
37116 45312
40450 92176
39259 44730
68790 89767
37526 84109
33305 42208
63474 88851
92816 93071
32193 50697
34927 62503
48938 97474
32975 63610
1315 17769
30877 52937
60916 91584
14355 34674
63709 64927
6280 33513
5...

output:

145552 133024 54307 40564 149368 128323 113012 121183 114059 56746 125500 118286 70045 131896 102309 72813 106075 69644 144902 97439 77369 129453 63139 130897 94226 137419 2198 90610 1870 132927 67066 75663 130413 79387 90984 35259 149801 106200 77737 43641 74189 131579 134347 126957 86584 63547 967...

result:

ok answer = 300000

Test #44:

score: 0
Accepted
time: 141ms
memory: 10532kb

input:

300000 150000
567775 666457
837755 984411
718168 903846
272041 566674
845286 892912
657558 706979
979998 984740
897850 920288
573988 604802
125953 702072
763586 844301
293648 334208
270686 660835
362992 482276
789500 805601
843735 845131
733248 894850
241109 377437
254656 819746
559713 638355
309262...

output:

54634 98036 49953 88740 25208 37159 3003 16179 78614 53507 40471 130915 63257 107491 117308 25488 46689 125257 139273 67664 63707 90373 115508 82931 67488 128603 70506 69366 4401 15634 118537 58999 82 145525 59300 147312 64636 25553 134974 124416 120160 1679 120449 132020 45554 108645 27209 59603 14...

result:

ok answer = 300000

Test #45:

score: 0
Accepted
time: 152ms
memory: 10500kb

input:

300000 150000
7170989 7769844
956107 2663875
9166687 9506653
1888701 7639977
3302208 7630940
4857987 7312608
3733996 4738647
3006274 9521928
6370314 7064994
3306420 5033814
2310651 5271171
1032455 6819687
7079130 9908748
3293168 3641704
1367057 7494712
4640369 8126591
3301376 9160271
5655785 6679644...

output:

8800 138304 13141 40599 14571 27757 109435 134858 38568 103483 98330 58126 52321 127161 43587 111333 131532 54910 37780 67252 72202 13323 135553 131418 99432 136123 142232 103866 130530 7413 1194 9738 51143 7337 2249 101053 66433 90345 27727 34032 75946 142242 134460 111706 88655 62588 63973 68293 1...

result:

ok answer = 300000

Test #46:

score: 0
Accepted
time: 124ms
memory: 10388kb

input:

300000 150000
11552304 25238941
57725800 74297686
59777617 68784124
34279072 42026700
59218385 84180847
89474693 95274286
95736555 96601153
35992390 95512251
71239164 91666139
97076370 97098897
40156523 62645281
32000954 57819471
60179257 88102512
5595628 31475314
55261116 84822976
71013050 92071206...

output:

139405 23251 46564 118905 82517 16742 6529 127709 51368 130718 72841 86227 79830 133240 94599 51874 3008 126588 89598 43954 112291 126970 37527 106743 100542 87938 123506 37203 58730 51708 107460 59114 23031 40862 138336 30240 133646 142930 126214 46944 68202 46939 70492 34347 81548 58896 43830 3092...

result:

ok answer = 300000

Test #47:

score: 0
Accepted
time: 152ms
memory: 10632kb

input:

300000 150000
654384400 971241348
70913001 607674248
792436692 958757039
493420264 606937015
872887558 973264081
626376272 682239078
582160167 908877630
658835446 733627713
385361776 871189995
334846500 367802854
124802907 643036263
443283183 775149618
514358696 672677144
480809185 562611368
6290012...

output:

64463 77468 34877 77682 20293 47891 84461 26397 123817 126272 67368 9147 52242 89401 2392 118893 77406 35095 97298 94249 115431 103561 72440 20965 97056 70695 34421 105279 69080 88774 138181 32826 89980 6958 29457 4644 20648 14772 26404 9619 46463 140753 56018 103556 29570 145644 110656 139877 32074...

result:

ok answer = 300000

Test #48:

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

input:

300000 259601
2 3
1 2
2 3
1 3
1 3
1 3
2 3
2 3
1 2
1 2
2 3
2 3
1 2
1 3
1 2
1 2
2 3
1 2
2 3
2 3
1 2
2 3
2 3
1 3
1 2
2 3
2 3
2 3
1 2
1 3
2 3
2 3
1 2
1 2
2 3
2 3
2 3
1 3
2 3
1 2
2 3
1 2
1 3
2 3
2 3
2 3
1 2
2 3
2 3
2 3
2 3
1 2
1 2
2 3
1 2
2 3
1 2
2 3
2 3
2 3
2 3
1 2
2 3
1 3
2 3
2 3
2 3
2 3
1 2
2 3
1 2
1 ...

output:

259601 259600 259599 259598 259597 259596 259595 259594 259593 259592 259591 259590 259589 259588 259587 259586 259585 259584 259583 259582 259581 259580 259579 259578 259577 259576 259575 259574 259573 259572 259571 259570 259569 259568 259567 259566 259565 259564 259563 259562 259561 259560 259559...

result:

ok answer = 259601

Test #49:

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

input:

300000 233601
3 5
3 4
1 3
1 4
2 3
2 5
1 2
3 5
4 5
2 4
4 5
3 4
1 2
1 5
2 4
1 4
2 3
2 3
4 5
4 5
2 5
2 3
2 3
2 5
2 3
2 5
4 5
2 4
2 4
3 4
3 5
3 4
2 4
4 5
3 4
2 4
3 4
3 4
4 5
4 5
1 5
1 3
2 4
3 5
2 4
4 5
1 3
2 5
4 5
3 5
4 5
2 3
3 5
1 5
2 3
1 5
3 5
3 5
3 5
3 5
3 4
4 5
2 5
3 4
2 5
2 3
2 3
2 3
3 5
2 3
1 3
4 ...

output:

171148 171147 171149 171146 171150 171145 214862 171144 209018 171143 209016 171142 214863 171141 171140 171139 171151 171152 209009 209008 171138 171153 171154 171137 171155 171136 209007 171135 171134 171133 171132 171131 171130 209005 171129 171128 171127 171126 209001 208998 171125 171156 171124...

result:

ok answer = 296054

Test #50:

score: 0
Accepted
time: 109ms
memory: 10864kb

input:

300000 156917
6 9
5 7
7 9
6 7
4 6
3 8
3 4
1 2
3 9
1 5
1 3
5 9
6 8
6 9
6 10
5 10
8 10
8 10
6 7
9 10
8 9
2 6
7 9
8 10
4 10
9 10
4 8
4 9
3 6
9 10
1 2
4 8
2 6
4 5
7 9
5 7
5 9
4 8
9 10
8 9
5 7
7 8
7 9
7 8
9 10
5 9
2 10
6 8
4 10
8 9
1 7
3 6
6 8
9 10
4 8
2 7
4 10
1 4
6 7
9 10
4 8
8 10
1 5
1 7
3 9
4 8
8 9
3...

output:

132556 56692 108860 56693 89691 23230 132707 153182 23229 114360 145427 144681 23228 123658 119451 144777 66386 66415 56694 53857 66423 89692 108843 66420 150616 53870 23227 150826 89693 53916 153183 23226 89694 114361 108872 56695 139803 23225 53920 66410 56696 108881 108876 108875 53931 144623 232...

result:

ok answer = 290604

Test #51:

score: 0
Accepted
time: 109ms
memory: 10472kb

input:

300000 150061
40 82
23 24
73 94
66 67
66 93
17 75
27 51
54 69
84 92
39 48
14 77
9 21
45 90
44 82
41 63
92 94
63 85
11 47
73 95
86 94
17 92
35 47
45 64
35 67
93 99
65 97
38 74
56 65
23 78
3 54
27 77
79 91
70 72
88 92
17 88
19 37
87 91
99 100
11 61
26 80
73 98
91 93
11 13
89 94
43 98
90 97
70 73
9 30
...

output:

124587 140771 48119 52734 65067 42242 101553 43898 27506 107756 38260 143093 116360 118481 70857 13126 77299 109687 48081 49567 146247 109688 67795 59816 104287 68149 22888 64765 36182 94897 38261 36886 31727 18393 146315 126337 21926 1324 76665 141346 68094 13360 147523 51501 120101 15584 27631 134...

result:

ok answer = 299989

Test #52:

score: 0
Accepted
time: 115ms
memory: 10644kb

input:

300000 149999
556 916
419 756
924 973
632 643
477 933
942 982
3 683
349 514
19 917
706 752
94 104
394 494
21 497
73 880
45 332
629 786
56 174
741 763
433 889
726 914
262 462
623 915
168 842
254 824
103 996
356 766
948 973
429 621
833 998
625 704
990 998
812 851
225 874
808 995
691 809
206 470
438 71...

output:

92089 17392 11995 65554 109130 9193 58153 101180 13123 19187 148326 105427 104799 19297 131460 5024 145174 14552 117251 87612 111658 73979 26026 139657 148417 13263 8161 74269 27797 38807 1389 31764 142034 32549 94184 110107 33151 108569 52196 58633 60977 70923 107773 32679 131577 42658 25243 147870...

result:

ok answer = 299998

Test #53:

score: 0
Accepted
time: 135ms
memory: 10568kb

input:

300000 150000
2952 4855
7982 9177
2483 6149
2332 8618
9598 9934
1792 4703
7046 9680
2410 6305
4047 4777
1499 4551
7242 7357
5766 9935
4189 4328
7115 9460
7695 9319
8328 8677
7785 9491
8174 8492
3883 5165
5277 9578
5928 9878
517 8949
2117 2724
5276 8352
6967 7641
1108 6809
6474 7064
4551 9396
6254 89...

output:

107111 33889 75850 141119 6083 110103 53036 71249 108630 113010 25545 86368 116877 60263 39473 69679 37644 30219 100623 98156 82050 16590 137753 98183 14019 58460 37772 113032 72857 97237 134108 50735 129486 128171 47568 131733 13706 54571 47235 35083 149754 28955 22791 76981 47812 53644 129329 1447...

result:

ok answer = 299999

Test #54:

score: 0
Accepted
time: 144ms
memory: 10388kb

input:

300000 150000
90462 99554
55705 57142
94440 97633
58596 96591
75226 94006
13368 15518
98383 98654
84117 94919
40069 63073
8004 65091
4385 82911
66462 70822
34454 44857
22507 37602
4845 74109
10526 95149
16021 24471
9617 25356
49732 92684
82188 93045
52592 55281
96908 97689
23937 68454
38080 79677
47...

output:

14908 87110 134879 83379 42793 146114 2424 25855 70851 65433 27998 37109 113677 125388 45109 148234 140174 139399 104488 73642 91826 92327 57200 848 28038 127249 114500 58149 32213 143435 1640 90388 110560 131953 142280 111433 32326 11160 5769 24875 136344 124799 102443 12090 155 102019 8026 143956 ...

result:

ok answer = 300000

Test #55:

score: 0
Accepted
time: 140ms
memory: 10572kb

input:

300000 150000
978631 982929
101663 499756
759816 798998
803333 838120
636964 675643
641278 704471
862290 919804
49691 717850
467443 677929
21596 84237
577153 844013
916660 917560
774572 929040
515474 806479
665250 888570
521313 523790
783160 877043
712485 825311
160449 264011
9658 425587
999666 9997...

output:

70914 104189 74441 32789 50974 38507 22047 50072 49911 148924 86130 124674 38294 100821 94171 98984 36644 51239 138653 118173 46 29553 10170 149045 145662 43137 64944 13919 123829 143274 91106 12471 122617 138845 5445 81574 104542 35996 130482 36979 109563 58201 149061 8451 90511 65546 61449 104336 ...

result:

ok answer = 300000

Test #56:

score: 0
Accepted
time: 146ms
memory: 10532kb

input:

300000 150000
9913013 9932632
1886090 3278627
15598 6396576
2951139 7310476
2824123 6726030
1142999 9790240
7041910 8793346
959943 9716348
3016613 8956537
2336065 9073451
1035455 9348843
3377319 7740855
4388032 8560696
3406865 6461910
8772807 9823783
1946767 8036961
5505173 8732456
8493741 8609530
8...

output:

78258 131844 69100 47565 60749 147975 53345 148541 134838 141227 148323 10187 115783 67396 103702 33002 93051 107473 73929 63949 19145 146392 149711 14986 133396 63199 51105 46766 17443 34779 106030 51043 120404 48592 42568 65214 109598 141358 125372 20035 144789 4056 59887 149379 2370 21114 87905 1...

result:

ok answer = 300000

Test #57:

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

input:

300000 150000
90841840 91559816
12499783 62748667
51355156 76943316
43673156 88083748
36949927 57673386
48735343 75253124
91558518 98845905
78717659 84832367
93306233 99008252
83511172 93934560
56671183 93733617
48444425 88876535
47109951 75003263
55556049 82291660
40401427 60213599
45748967 5257286...

output:

14407 72258 11738 116223 86260 18682 61749 83609 10402 79677 88738 107284 19770 91498 79473 98542 267 65479 92840 24436 47611 149433 53209 132117 73403 130304 7262 23432 111047 124632 72660 109239 133778 94290 117620 121996 125407 7711 12853 42622 14961 51655 123767 52827 71750 59587 89085 34072 104...

result:

ok answer = 300000

Test #58:

score: 0
Accepted
time: 151ms
memory: 10556kb

input:

300000 150000
957293988 962106030
736798587 808067623
782742114 966585014
742593057 923915720
679625821 902064761
877600863 924157346
873528366 936110266
677729400 918693297
577428362 992519997
350536068 564404168
538943592 889454752
438784335 746201316
501004965 684782755
185477041 538309098
524300...

output:

6521 45955 36794 44808 58474 47943 98779 64554 85666 89025 95510 21615 47597 95376 98638 143961 109819 141987 30643 106516 68140 114094 46275 75038 124022 9349 22266 119571 109143 16471 92694 11382 20460 38667 8515 126976 9905 89396 16487 75674 119212 73458 23273 147669 7821 92091 40869 73555 98214 ...

result:

ok answer = 300000

Test #59:

score: 0
Accepted
time: 72ms
memory: 10944kb

input:

300000 152784
2 3
1 2
1 3
2 3
2 3
1 3
2 3
2 3
1 2
2 3
1 2
1 3
2 3
2 3
1 3
1 2
2 3
2 3
2 3
1 2
1 2
1 2
1 2
2 3
1 3
1 2
2 3
1 2
2 3
1 2
2 3
1 2
2 3
1 2
2 3
1 3
2 3
2 3
2 3
1 2
1 3
2 3
2 3
1 3
1 2
1 2
2 3
2 3
2 3
2 3
2 3
1 2
2 3
2 3
1 3
1 2
1 3
1 2
2 3
2 3
1 2
2 3
1 3
1 2
1 2
2 3
1 2
2 3
1 2
1 3
2 3
2 ...

output:

152784 152783 152782 152781 152780 152779 152778 152777 152776 152775 152774 152773 152772 152771 152770 152769 152768 152767 152766 152765 152764 152763 152762 152761 152760 152759 152758 152757 152756 152755 152754 152753 152752 152751 152750 152749 152748 152747 152746 152745 152744 152743 152742...

result:

ok answer = 152784

Test #60:

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

input:

300000 86194
1 2
3 4
4 5
1 5
4 5
2 4
4 5
2 4
3 5
2 3
2 5
2 4
4 5
3 4
4 5
1 4
2 5
3 4
1 3
2 4
3 4
3 5
1 5
1 4
3 5
3 4
1 5
2 4
2 4
2 3
1 2
3 4
4 5
3 4
4 5
4 5
4 5
4 5
3 5
1 3
3 4
4 5
4 5
1 4
4 5
4 5
3 5
3 4
2 3
3 5
1 2
3 5
2 4
3 4
1 4
4 5
4 5
4 5
4 5
2 3
1 3
2 4
1 4
1 2
3 4
4 5
2 4
2 4
1 3
4 5
3 4
3 4...

output:

67491 23648 67239 23647 67265 23646 67249 23645 23644 23649 23643 23642 67165 23641 66864 23640 23639 23638 23650 23637 23636 23635 23634 23633 23632 23631 23630 23629 23628 23651 67492 23627 66067 23626 66256 66290 66292 66179 23625 23652 23624 65908 65890 23623 65794 65835 23622 23621 23653 23620 ...

result:

ok answer = 148740

Test #61:

score: 0
Accepted
time: 93ms
memory: 10952kb

input:

300000 141964
7 9
7 9
9 10
5 10
7 10
1 3
3 5
4 10
2 6
9 10
6 9
1 3
8 9
2 8
5 8
8 10
7 10
9 10
7 8
6 8
4 10
7 10
2 5
9 10
1 7
2 9
8 10
3 5
8 10
5 10
6 10
6 10
9 10
1 6
9 10
9 10
6 8
6 9
7 8
9 10
4 9
2 6
1 6
2 6
5 7
8 10
9 10
7 8
6 9
9 10
1 6
1 3
8 9
8 10
6 9
2 5
5 8
2 5
5 10
3 7
3 4
4 9
5 9
5 10
7 9
...

output:

96997 97002 38012 124191 96994 130286 99205 136449 74510 38018 99680 130287 63532 8187 8186 63535 97023 37988 96932 99655 136676 96936 99206 38001 41351 8185 63539 99207 63540 126095 99554 99539 38097 74511 38085 38086 99598 99576 96923 38055 135901 74512 74513 74514 41352 63538 37994 96980 117296 3...

result:

ok answer = 275741

Test #62:

score: 0
Accepted
time: 124ms
memory: 10524kb

input:

300000 149911
43 56
67 78
30 90
55 80
24 77
80 88
2 10
96 97
86 98
19 67
37 84
91 97
62 82
53 63
66 93
22 75
64 73
74 88
92 94
91 92
29 100
90 98
37 99
96 100
63 78
59 82
68 92
70 85
66 91
97 100
61 68
63 90
82 93
40 76
99 100
20 21
97 100
50 76
81 86
70 84
54 94
13 100
24 85
94 99
68 79
94 98
19 88...

output:

90287 5592 136723 95413 38398 33915 148522 5167 79498 60182 128940 14678 79869 71309 66589 42448 26705 81050 12465 14753 137600 15910 128095 5943 5593 87444 61408 57100 66445 52592 48535 75962 30914 13936 61503 143087 3405 13937 32717 56330 99284 147982 142105 9422 1600 9402 145450 33101 38681 57846...

result:

ok answer = 299817

Test #63:

score: 0
Accepted
time: 115ms
memory: 10532kb

input:

300000 150000
754 812
673 775
487 552
507 917
210 819
374 736
487 994
397 873
928 980
319 571
408 853
4 496
747 810
131 486
916 956
7 834
699 862
353 697
732 822
898 934
257 595
50 643
707 785
837 931
920 951
822 958
653 780
60 226
937 987
35 519
381 534
179 883
109 813
128 364
628 678
247 491
221 3...

output:

42677 9325 92470 102829 143087 25373 106980 122698 132751 87728 121115 104828 44206 106863 13046 27164 68843 54721 81389 119085 81361 67674 5326 85952 119023 29596 7397 141721 9682 100051 96609 144976 31108 127239 49849 105868 123546 127447 27934 112251 135064 109670 94010 73689 87493 56078 29794 13...

result:

ok answer = 299999

Test #64:

score: 0
Accepted
time: 139ms
memory: 10564kb

input:

300000 150001
7546 9936
1162 3146
6754 9649
857 2413
8510 9893
4716 7705
7716 8415
9164 9410
6835 7368
759 9400
9631 9856
3406 5719
3351 4571
8626 9185
3958 6558
5502 9720
8962 9031
6145 9485
5618 7486
3125 9283
5266 8779
6399 6741
4401 5218
1184 4132
7703 9952
1349 9292
3287 8449
5724 8357
2213 711...

output:

80766 133028 59717 140274 24244 11988 72891 13078 26093 149086 5685 87409 112228 63057 64386 94494 16450 76011 21116 133226 98247 52244 99310 119818 99877 147110 131788 87319 51458 34805 110765 35568 70728 38719 36366 110970 136220 48831 74064 137202 147038 49186 137223 89541 120920 49219 50349 6915...

result:

ok answer = 300000

Test #65:

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

input:

300000 150000
42005 98322
36515 54982
22264 95585
64174 69821
55104 97778
87368 94373
7007 8996
31762 69343
49180 53546
37354 45525
72481 91425
91172 91934
392 96117
89666 96742
78212 94400
40210 51787
79757 90604
54590 58073
81825 88959
87777 95161
45753 55341
30650 33760
41139 89968
90264 98793
89...

output:

118476 92347 141901 40481 92043 20350 148788 55119 95835 112432 48351 79243 5950 16431 36740 99874 33829 84612 123300 19656 91494 130370 119946 15412 17062 91266 130182 36932 13943 65106 44524 91966 107896 126816 139829 12069 28581 73798 137653 87233 23940 49523 18911 141135 17785 78879 47213 65412 ...

result:

ok answer = 300000

Test #66:

score: 0
Accepted
time: 154ms
memory: 10532kb

input:

300000 150000
105608 372730
450920 939814
392570 470982
831537 960525
739274 852533
205877 847538
328947 740925
299221 476303
764013 815537
148257 288101
440116 625446
852887 985940
771596 826542
644437 892788
117118 283300
5525 130199
802505 908649
605317 714932
57259 586892
934933 944093
803203 95...

output:

125803 113396 109647 27707 45481 143092 23774 108617 40421 136070 72663 23906 38915 67206 136572 147342 33065 34515 83443 10234 32929 4581 144944 115765 103830 74111 7958 3416 43075 62038 131229 24240 147563 103847 75615 107447 69847 22176 26944 76509 95798 30424 34461 42172 33324 119380 41051 92162...

result:

ok answer = 300000

Test #67:

score: 0
Accepted
time: 143ms
memory: 10488kb

input:

300000 150000
5452202 9947793
9940079 9977522
9867053 9970459
3301439 5116018
6793328 6959345
295436 7809391
8314322 8332834
284652 6795243
9328222 9619914
1773012 9267574
3339832 7591959
2932404 4146637
1537431 4874682
2542828 9607098
3766697 6739632
8821649 9809564
9012909 9387656
6364569 8263430
...

output:

93832 928 104181 101359 42282 37168 27657 58549 10434 144965 15479 119599 106384 139410 59842 18754 15543 69277 110919 76797 138791 133230 37272 17009 109442 139215 91458 19114 70850 111389 92136 119352 87311 16687 33376 52013 102523 42097 126234 136650 22143 43900 126119 101001 128505 57880 102432 ...

result:

ok answer = 300000

Test #68:

score: 0
Accepted
time: 146ms
memory: 10572kb

input:

300000 150000
29256543 66052315
81437971 88272697
30361131 48076722
16393921 38228960
5190763 66267381
87549810 93687917
77861257 84376100
29951389 73926657
30887064 87431784
98966017 99489059
19806040 55359526
881837 92289084
83937815 96494313
39963981 64355637
57275584 68809544
54889048 82463209
1...

output:

63254 30896 107805 124657 62739 20051 37704 45523 133929 1528 92046 12105 26441 67648 45776 93130 131623 142908 8578 104096 116753 139608 60558 1617 9234 52759 27029 56137 115392 37452 43546 86205 5874 109637 126373 108980 32220 28852 45184 46739 62962 108376 43830 141619 124382 86735 4684 10492 126...

result:

ok answer = 300000

Test #69:

score: 0
Accepted
time: 138ms
memory: 10572kb

input:

300000 150000
97364729 815595008
542160770 603377615
577372596 773000925
493180194 604212827
148747585 765587621
781858891 841132159
825615549 958198318
853720291 982666126
443094830 832639056
265464744 612310444
430129832 962941028
720177015 997807318
606221899 916413997
266478160 776731954
4002806...

output:

30600 79058 10365 78844 40159 71886 28746 23682 114973 76488 117138 49557 78259 37987 96030 145574 81538 72293 103129 59053 69537 76503 46785 36974 66068 52436 55954 42676 104342 148278 145890 14590 121981 114888 75903 67863 96839 69836 45950 84843 100107 30908 23440 28490 6377 101753 79044 69784 14...

result:

ok answer = 300000

Test #70:

score: 0
Accepted
time: 77ms
memory: 10912kb

input:

300000 192988
1 2
1 2
2 3
1 3
2 3
2 3
2 3
2 3
1 2
1 3
2 3
1 3
1 3
1 2
2 3
2 3
1 3
2 3
1 3
1 3
1 2
1 3
1 2
1 2
1 2
1 3
1 3
1 3
1 2
2 3
1 3
1 3
1 3
1 3
2 3
2 3
1 3
1 2
1 2
2 3
2 3
1 2
2 3
1 3
2 3
1 2
1 2
2 3
2 3
2 3
2 3
1 2
1 3
2 3
1 2
2 3
1 3
2 3
1 2
1 3
1 2
1 3
2 3
2 3
2 3
1 3
1 2
1 3
2 3
2 3
2 3
1 ...

output:

192988 192987 192986 192985 192984 192983 192982 192981 192980 192979 192978 192977 192976 192975 192974 192973 192972 192971 192970 192969 192968 192967 192966 192965 192964 192963 192962 192961 192960 192959 192958 192957 192956 192955 192954 192953 192952 192951 192950 192949 192948 192947 192946...

result:

ok answer = 192988

Test #71:

score: 0
Accepted
time: 93ms
memory: 10288kb

input:

300000 234961
1 3
4 5
3 4
2 3
2 4
2 3
3 4
1 5
2 3
4 5
3 4
4 5
1 2
1 4
3 5
4 5
4 5
4 5
2 4
4 5
1 5
4 5
1 4
3 4
2 4
4 5
4 5
2 3
3 4
2 3
4 5
2 5
2 4
2 5
2 4
4 5
2 5
4 5
4 5
2 3
1 3
4 5
1 3
2 5
3 5
4 5
1 2
3 5
3 4
2 3
4 5
4 5
1 5
3 5
2 4
3 5
1 5
1 2
1 4
4 5
2 5
2 3
1 3
1 5
3 4
3 4
2 3
1 5
1 4
3 4
1 3
1 ...

output:

172390 181259 172389 172391 172388 172392 172387 172386 172393 181260 172385 181261 216217 172384 172383 181262 181263 181264 172382 181265 172381 181266 172380 172379 172378 181267 181268 172394 172377 172395 181269 172376 172375 172374 172373 181270 172372 181271 181287 172396 172397 181273 172398...

result:

ok answer = 297533

Test #72:

score: 0
Accepted
time: 109ms
memory: 10964kb

input:

300000 144464
3 4
4 10
4 10
2 4
1 6
8 9
6 8
8 10
5 6
6 10
8 9
1 7
4 7
9 10
8 10
6 7
6 10
2 7
1 2
2 6
6 9
9 10
9 10
3 7
1 10
2 3
3 7
4 8
7 9
3 10
5 7
2 6
4 6
9 10
4 6
8 10
8 10
7 9
2 8
7 8
6 7
6 9
7 10
1 10
7 8
2 6
6 7
5 10
6 10
4 5
9 10
2 6
9 10
9 10
5 7
8 10
3 10
7 10
1 10
4 6
2 9
5 7
6 10
8 10
8 9...

output:

120320 138578 138132 120321 77561 77388 115184 77220 77562 115027 77275 44311 44312 37814 77125 44313 115288 44314 140770 77563 115263 37818 37819 44315 10889 133023 44316 10888 97290 10887 44317 77564 77565 37824 77566 77121 77203 97416 10886 10885 44318 116149 95561 10884 10883 77567 44319 132732 ...

result:

ok answer = 278039

Test #73:

score: 0
Accepted
time: 118ms
memory: 10600kb

input:

300000 150022
74 99
18 100
43 70
30 95
2 95
67 85
93 97
21 51
96 100
2 33
50 93
74 79
43 71
54 85
76 86
95 100
5 48
99 100
35 94
2 3
15 99
68 88
48 51
90 100
47 50
82 96
22 96
76 82
4 90
84 94
52 91
66 87
81 95
94 96
53 83
62 98
10 21
78 86
97 99
9 98
51 54
7 77
60 62
47 71
82 84
54 55
56 63
76 97
9...

output:

112648 145643 53287 136556 6274 64592 11485 102189 6440 131829 107895 2236 35826 98197 43392 64400 108284 1398 131087 149936 147473 62569 102190 16528 104215 117719 143420 43236 14550 25828 103745 65456 89897 8151 101813 77403 143141 38295 3815 149220 95407 38308 74396 35827 30473 92986 71364 43499 ...

result:

ok answer = 299938

Test #74:

score: 0
Accepted
time: 145ms
memory: 10572kb

input:

300000 149998
846 912
507 874
872 908
926 962
959 961
791 821
840 964
858 889
833 959
897 978
734 817
686 915
292 679
418 592
247 966
975 984
16 33
62 987
397 560
239 859
363 777
861 945
823 946
145 540
682 838
782 824
206 417
368 819
53 829
345 789
38 344
889 980
260 476
253 382
188 754
898 954
346...

output:

25084 103282 20618 11551 133756 35475 26138 81403 103986 16290 47061 57647 58880 82392 140256 42524 149844 149473 90574 140910 8635 22526 29393 95393 82112 37220 119561 127126 28051 3725 130015 48415 109128 124917 42640 16164 59588 100846 12549 97931 74605 139316 22826 119269 59530 47154 60722 12034...

result:

ok answer = 299996

Test #75:

score: 0
Accepted
time: 131ms
memory: 10456kb

input:

300000 150000
3735 8768
3087 8764
3482 4806
5737 8689
9989 9992
9410 9674
3833 8798
6568 9556
1940 4565
6881 9857
1744 3824
4950 4980
3581 5547
5098 8827
9948 9992
2413 6458
9108 9257
4334 6121
4330 7925
2429 7742
3225 9979
6339 7770
1132 2452
7899 8950
5936 7534
4333 4780
4764 9001
385 2374
1066 92...

output:

125879 133994 107977 86879 134192 101346 124451 64301 112595 67789 124564 104414 91632 101988 757 67065 59841 76599 2190 38246 132474 8587 140073 66784 18210 108465 108814 140712 148170 54721 75100 41872 80536 124673 4761 53574 103539 92857 10643 72306 134915 42981 37560 121444 57030 63537 124853 62...

result:

ok answer = 300000

Test #76:

score: 0
Accepted
time: 135ms
memory: 10500kb

input:

300000 150000
49790 78377
97347 99479
72006 76581
43881 72339
81666 89279
2075 38244
89843 97604
77076 87731
28189 51164
28777 78100
53937 67907
22141 37944
11183 58352
78093 98649
95282 99006
99399 99405
4146 67855
59203 94723
66857 79990
74343 97034
11388 64823
57171 64530
54072 64158
36065 69808
...

output:

6301 4030 13549 30973 30749 124537 16245 55748 101443 7413 50410 125003 84193 125225 101148 115056 58887 81944 61316 74077 66365 64775 66208 54504 28650 83743 143322 63032 14519 84908 79099 1194 99494 133738 9734 108681 92168 118850 114143 4589 67390 21087 112524 148595 8124 20393 28931 141154 13213...

result:

ok answer = 300000

Test #77:

score: 0
Accepted
time: 154ms
memory: 10452kb

input:

300000 150000
291766 999528
239706 390565
933299 995606
273097 763455
851446 888731
543833 767589
699748 927426
664379 691555
190026 914875
764030 851584
611326 958847
62849 849203
573123 905908
900958 929788
593543 736367
143467 888350
121565 426255
341185 707591
831864 839245
636104 681776
402398 ...

output:

135737 123397 10274 40513 115016 12782 53996 44292 144160 40402 76568 24436 86886 43046 25380 146715 117769 52220 47983 48628 22458 15579 59686 126012 115905 24922 30689 131127 69844 72673 84460 80571 114869 89704 104573 2507 143874 79850 127527 86630 28054 13469 35140 46435 21198 114404 43385 37189...

result:

ok answer = 300000

Test #78:

score: 0
Accepted
time: 156ms
memory: 10532kb

input:

300000 150000
8227243 9686470
6719345 8881636
3775474 8198905
5364395 9947503
2981953 9696782
1329265 1565360
3644642 4928409
1716902 8967301
9699990 9988645
3821700 7387931
2856554 3399403
9842792 9957190
8991337 9997797
9923943 9959914
2779208 7972351
6971201 9876462
8441175 9612050
6121536 656518...

output:

29348 60516 125653 95901 135694 146122 105428 145327 75296 24653 130436 2405 16020 120289 573 54753 127542 60191 84798 141407 3969 122815 16563 7336 12580 26242 94156 123553 26623 77461 105216 57406 58860 10284 99490 133980 34415 31 136729 116844 72051 63730 97694 126664 141955 67019 39868 41110 455...

result:

ok answer = 300000

Test #79:

score: 0
Accepted
time: 136ms
memory: 10564kb

input:

300000 150000
77560217 84821462
57863108 73308827
13349108 92483582
10831881 85670719
92153207 98497873
21826186 59894512
5351484 44192081
23323148 98213132
83517574 87114426
1026504 90841700
99023752 99694292
6764164 7844534
43604894 58538721
33421423 79957123
45276705 79665537
79467172 80182633
80...

output:

38265 27282 147269 23178 66978 80661 115184 141262 120269 14437 1491 149087 84289 130970 806 34483 32184 94959 119552 55406 55801 48369 85168 30308 124682 33563 101051 30916 62193 144025 129216 14250 15237 103849 13702 126635 37057 8971 88507 21869 109183 140036 131364 141739 74957 125533 40188 1047...

result:

ok answer = 300000

Test #80:

score: 0
Accepted
time: 128ms
memory: 10572kb

input:

300000 150000
763814908 996726129
281635131 688248102
904370118 945799883
94949607 286111159
689327474 903697825
926497730 966723335
696541135 923862111
589032579 598315025
292449712 301680987
318552055 778181558
378162882 452092573
107483323 873580594
184668805 250494315
140236757 829538288
6751721...

output:

102332 56614 14991 136406 107244 11435 54675 80172 134799 7515 113279 20254 139775 28051 9831 76206 39923 23565 129768 83113 125623 89471 51076 62760 118929 136280 81591 119095 95738 51434 13945 54255 139057 99591 19804 98625 39090 129450 90342 47315 15508 93152 42759 56741 28375 125060 68201 53115 ...

result:

ok answer = 300000

Test #81:

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

input:

300000 233191
1 3
1 3
2 3
2 3
2 3
2 3
2 3
2 3
1 2
2 3
1 3
2 3
2 3
1 3
1 3
1 3
1 3
1 3
2 3
2 3
2 3
2 3
2 3
2 3
1 2
2 3
1 3
2 3
2 3
2 3
1 3
2 3
1 2
1 3
2 3
1 3
1 3
2 3
2 3
1 3
1 2
2 3
2 3
2 3
2 3
1 3
2 3
1 3
1 2
2 3
1 2
1 2
2 3
1 3
1 3
1 2
2 3
2 3
2 3
2 3
2 3
1 2
1 3
1 2
2 3
1 3
2 3
2 3
1 2
2 3
1 2
1 ...

output:

233191 233190 233189 233188 233187 233186 233185 233184 233183 233182 233181 233180 233179 233178 233177 233176 233175 233174 233173 233172 233171 233170 233169 233168 233167 233166 233165 233164 233163 233162 233161 233160 233159 233158 233157 233156 233155 233154 233153 233152 233151 233150 233149...

result:

ok answer = 233191

Test #82:

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

input:

300000 24012
4 5
4 5
1 3
4 5
2 4
2 5
2 5
2 3
4 5
2 4
2 3
3 4
3 4
3 4
2 4
4 5
4 5
2 3
4 5
1 5
1 5
3 5
1 4
3 5
1 4
2 3
2 4
1 4
1 3
1 5
2 4
1 3
3 4
1 3
4 5
1 2
3 4
1 4
2 3
4 5
4 5
2 4
3 4
2 4
2 5
2 5
2 4
2 4
1 5
1 3
2 3
3 5
4 5
1 3
1 4
4 5
2 3
2 5
2 3
1 3
3 5
4 5
3 5
1 5
2 3
2 3
3 5
2 4
3 4
2 4
4 5
4 5...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5257 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5258 0 0 0 0 0 0 0 0 0 5259 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5260 0 0 0 0 0 5261 0 0 0 0 0 0 0 0 5262 0 5263 0 0 0 0 0 0 0 0 0 0...

result:

ok answer = 48024

Test #83:

score: 0
Accepted
time: 106ms
memory: 10352kb

input:

300000 104991
7 8
5 10
2 4
3 4
3 9
2 9
3 4
7 9
6 9
3 10
4 8
7 8
9 10
6 8
2 8
2 10
3 5
3 10
5 9
4 10
7 8
7 10
3 9
3 10
1 2
3 4
9 10
3 9
7 9
1 5
1 7
1 8
8 10
6 9
7 10
9 10
9 10
2 5
6 10
7 10
9 10
8 9
4 8
6 8
1 9
9 10
1 5
6 10
4 7
5 8
3 9
6 7
6 7
8 9
5 9
4 7
5 10
9 10
8 10
8 9
9 10
9 10
9 10
9 10
7 8
5...

output:

0 82926 80762 80763 0 0 80764 61100 66054 0 0 0 0 0 0 0 62682 0 83858 99646 0 61050 0 0 101411 80765 0 0 60152 62683 4844 0 37292 67722 62192 0 0 62684 65862 59418 0 37571 0 0 0 0 62685 73853 4845 0 0 4846 4847 37581 81748 4848 86396 0 37566 37644 0 0 0 0 0 84413 0 62686 0 36906 0 89659 93484 0 6268...

result:

ok answer = 209982

Test #84:

score: 0
Accepted
time: 92ms
memory: 9200kb

input:

300000 47061
70 94
30 50
45 100
36 88
32 91
25 54
9 27
61 65
41 64
65 69
8 68
81 89
46 90
17 31
15 24
93 97
65 78
15 31
94 100
78 79
33 35
19 75
3 62
93 95
15 58
71 84
61 64
26 73
19 72
60 100
81 96
81 88
54 91
15 37
23 46
63 67
4 40
88 100
57 63
13 86
9 23
87 88
58 100
30 67
27 90
65 83
38 92
48 72...

output:

0 1315 13876 27102 31906 0 35279 0 0 0 0 0 12218 31161 37971 0 0 31162 0 0 26307 0 0 0 0 0 0 0 0 0 0 0 0 23638 9223 0 19240 0 0 0 38780 0 0 0 36533 0 23753 8492 0 3771 0 39495 0 0 0 0 0 0 0 0 0 0 17636 19241 0 36206 0 0 0 2445 0 9224 33311 0 0 22156 45358 4988 0 0 0 0 0 33312 0 0 0 22157 36434 8458 ...

result:

ok answer = 94122

Test #85:

score: 0
Accepted
time: 89ms
memory: 9012kb

input:

300000 24043
284 933
365 927
559 679
102 483
407 653
677 969
463 602
814 900
375 498
620 698
637 793
824 998
213 383
100 496
725 872
52 612
35 947
749 882
724 920
212 665
421 711
675 904
730 890
84 519
508 893
515 984
82 958
975 989
586 750
757 965
34 601
469 593
412 766
389 653
666 884
851 923
616 ...

output:

10604 1263 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 23125 0 0 0 0 0 0 0 0 0 0 23974 0 0 0 0 0 0 0 0 0 0 0 21806 1114 0 0 0 0 0 0 0 0 0 0 0 0 17802 0 0 0 0 0 0 0 15659 0 0 0 23631 1039 0 5177 0 16988 0 234 0 0 0 0 0 0 0 16138 0 0 0 0 0 0 0 0 2423 0 0 0 0 0 0 0 0 0 0 0 15141 0 0 0 0 0 0 0 0 213...

result:

ok answer = 48086

Test #86:

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

input:

300000 39197
3464 9192
2491 4593
8097 9019
4096 9853
8425 8896
361 3624
3848 5908
5689 7816
4995 9362
3956 4144
2335 9360
7158 9342
3450 7596
6058 9998
1016 5957
4091 9487
4355 5263
2859 9771
9072 9331
8269 8799
1081 5503
5930 8840
5606 6760
4876 7444
9610 9801
5986 9429
9001 9776
3594 8009
156 9211...

output:

18586 740 0 9316 0 16382 0 0 0 8503 30112 0 18745 0 0 9406 0 25427 0 0 0 0 0 0 0 0 0 16873 0 9910 0 0 0 0 0 18853 0 0 0 0 1037 18967 0 27301 0 0 0 28624 0 0 0 0 0 3841 0 28279 0 1071 24242 19431 0 0 0 22210 0 9360 0 0 3119 0 0 26264 0 0 0 0 24285 0 0 13813 0 0 0 35351 0 27025 0 0 0 0 0 0 0 0 8185 16...

result:

ok answer = 78394

Test #87:

score: 0
Accepted
time: 99ms
memory: 8648kb

input:

300000 12008
61060 93610
29964 39538
99379 99599
68300 85459
78526 92446
4557 64653
38330 54309
3419 86837
64888 74988
9351 68829
15679 22336
45276 86285
1753 67864
62960 77046
62686 94661
7937 11565
10790 12322
55724 71521
98415 99275
62100 78617
70531 89247
6543 29130
8246 50974
90235 99940
27517 ...

output:

0 0 0 0 0 0 0 0 0 0 3841 0 0 0 0 9913 9609 0 0 0 0 0 0 0 0 7706 0 0 0 0 0 0 0 0 0 0 0 0 0 5255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5302 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1806 0 0 0 10679 0 0 8574 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8397 0 0 0 0 0 0 0 0 0 9793 0 0 0 0 0 0 0 ...

result:

ok answer = 24016

Test #88:

score: 0
Accepted
time: 107ms
memory: 9156kb

input:

300000 51943
922968 931060
676228 902422
706391 835341
377320 837379
728897 785928
945419 983794
728153 742025
530848 705151
193003 410603
795045 976129
628017 856937
286764 722057
45994 560645
835098 931094
935878 983991
440103 965747
474374 609564
522246 850694
287757 962939
754589 843217
262173 7...

output:

0 0 0 27161 0 0 0 0 22094 0 0 0 0 0 0 17251 0 1058 38191 0 0 0 25984 28094 0 0 0 15786 0 42079 0 26571 0 6030 0 0 0 0 0 0 0 0 0 32853 0 0 12906 0 0 44623 0 16366 0 0 32216 0 0 0 8700 0 0 37444 7314 0 22122 0 19946 0 0 0 0 0 18471 0 45897 0 9985 0 0 2907 0 0 0 0 0 0 0 0 46367 0 0 0 0 0 0 42586 45696 ...

result:

ok answer = 103886

Test #89:

score: 0
Accepted
time: 124ms
memory: 9492kb

input:

300000 92186
5881667 9245835
585950 1112181
2359288 4822085
582150 3868378
2463796 8615660
5466872 7826770
4190126 6736016
5587359 7790977
9047264 9662912
5210034 8575619
8929902 9587777
6225173 9633255
891946 1478964
2631518 3196046
9369588 9836606
2702532 7732659
2191361 2486418
4246739 6627269
63...

output:

25422 90278 49862 66199 82241 35870 2608 33030 0 41802 0 15882 88801 74891 0 80095 82057 5198 12222 61403 7299 0 45309 12918 55130 46661 81961 83649 32984 47349 0 0 31464 0 45064 21741 80823 75807 31386 37493 34749 0 0 49124 15158 56358 19819 4295 0 56243 13583 7700 0 0 0 0 0 32067 29292 0 38817 605...

result:

ok answer = 184372

Test #90:

score: 0
Accepted
time: 96ms
memory: 8596kb

input:

300000 5101
22533551 61918934
55282140 76435955
67436320 75349037
25838176 76449937
72274253 73479904
12520364 55901303
63268357 78610611
90446269 98394669
45735435 58300568
65549491 93811961
53562826 72410596
98875739 99970807
76621426 81931190
49609129 77583583
10142883 58372718
2868357 10564697
5...

output:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3347 0 0 0 0 0 0 0 0 0 0 3316 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1747 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 762 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok answer = 10202

Test #91:

score: 0
Accepted
time: 123ms
memory: 9208kb

input:

300000 45343
161780904 410049562
283210989 686643566
75741737 207110089
133792723 222338922
681018503 797751796
882310807 893049049
7612807 793470558
622224492 928679497
145325156 991514099
270763472 617283828
259767717 509070778
918270298 952247865
656605285 954061584
531619154 652348482
693773286 ...

output:

15802 0 38445 37369 0 0 0 0 42107 0 0 0 0 0 0 26807 17479 13977 18066 0 9405 0 0 0 5046 21104 0 29256 0 0 0 0 0 0 18785 0 0 0 0 0 0 0 0 0 43449 0 0 0 0 0 0 0 9841 0 0 0 37055 0 0 0 28107 0 0 0 0 0 0 20859 0 24155 0 0 0 4595 43378 0 0 0 39549 0 0 0 31969 0 0 0 18298 0 0 0 0 0 0 26769 0 0 0 0 0 29350 ...

result:

ok answer = 90686

Test #92:

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

input:

300000 1
2 3
1 3
2 3
2 3
1 2
2 3
2 3
1 2
2 3
2 3
2 3
1 3
1 2
1 2
1 2
2 3
1 2
2 3
2 3
1 3
1 2
1 3
1 2
2 3
2 3
1 2
2 3
1 2
1 2
1 3
1 2
2 3
1 2
2 3
2 3
1 2
1 2
2 3
2 3
2 3
2 3
1 3
2 3
2 3
2 3
1 2
1 2
2 3
2 3
1 3
1 3
1 3
1 3
1 3
2 3
1 3
1 2
1 2
2 3
1 2
2 3
2 3
2 3
1 2
2 3
1 2
1 3
2 3
1 2
1 2
1 2
1 3
1 3...

output:

1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

ok answer = 1

Test #93:

score: 0
Accepted
time: 88ms
memory: 9820kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

149001 149002 149003 149004 149005 149006 149007 149008 149009 149010 149011 149012 149013 149014 149015 149016 149017 149018 149019 149020 149021 149022 149023 149024 149025 149026 149027 149028 149029 149030 149031 149032 149033 149034 149035 149036 149037 149038 149039 149040 149041 149042 149043...

result:

ok answer = 300000

Test #94:

score: 0
Accepted
time: 86ms
memory: 9816kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

149001 149002 149003 149004 149005 149006 149007 149008 149009 149010 149011 149012 149013 149014 149015 149016 149017 149018 149019 149020 149021 149022 149023 149024 149025 149026 149027 149028 149029 149030 149031 149032 149033 149034 149035 149036 149037 149038 149039 149040 149041 149042 149043...

result:

ok answer = 300000

Test #95:

score: 0
Accepted
time: 111ms
memory: 9908kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

149001 149002 149003 149004 149005 149006 149007 149008 149009 149010 149011 149012 149013 149014 149015 149016 149017 149018 149019 149020 149021 149022 149023 149024 149025 149026 149027 149028 149029 149030 149031 149032 149033 149034 149035 149036 149037 149038 149039 149040 149041 149042 149043...

result:

ok answer = 300000

Test #96:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

140001 140002 140003 140004 140005 140006 140007 140008 140009 140010 140011 140012 140013 140014 140015 140016 140017 140018 140019 140020 140021 140022 140023 140024 140025 140026 140027 140028 140029 140030 140031 140032 140033 140034 140035 140036 140037 140038 140039 140040 140041 140042 140043...

result:

ok answer = 300000

Test #97:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

140001 140002 140003 140004 140005 140006 140007 140008 140009 140010 140011 140012 140013 140014 140015 140016 140017 140018 140019 140020 140021 140022 140023 140024 140025 140026 140027 140028 140029 140030 140031 140032 140033 140034 140035 140036 140037 140038 140039 140040 140041 140042 140043...

result:

ok answer = 300000

Test #98:

score: 0
Accepted
time: 88ms
memory: 9968kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

140001 140002 140003 140004 140005 140006 140007 140008 140009 140010 140011 140012 140013 140014 140015 140016 140017 140018 140019 140020 140021 140022 140023 140024 140025 140026 140027 140028 140029 140030 140031 140032 140033 140034 140035 140036 140037 140038 140039 140040 140041 140042 140043...

result:

ok answer = 300000

Test #99:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040 100041 100042 100043...

result:

ok answer = 300000

Test #100:

score: 0
Accepted
time: 90ms
memory: 10096kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040 100041 100042 100043...

result:

ok answer = 300000

Test #101:

score: 0
Accepted
time: 90ms
memory: 10396kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

100001 100002 100003 100004 100005 100006 100007 100008 100009 100010 100011 100012 100013 100014 100015 100016 100017 100018 100019 100020 100021 100022 100023 100024 100025 100026 100027 100028 100029 100030 100031 100032 100033 100034 100035 100036 100037 100038 100039 100040 100041 100042 100043...

result:

ok answer = 300000

Test #102:

score: 0
Accepted
time: 84ms
memory: 10740kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50001 50002 50003 50004 50005 50006 50007 50008 50009 50010 50011 50012 50013 50014 50015 50016 50017 50018 50019 50020 50021 50022 50023 50024 50025 50026 50027 50028 50029 50030 50031 50032 50033 50034 50035 50036 50037 50038 50039 50040 50041 50042 50043 50044 50045 50046 50047 50048 50049 50050 ...

result:

ok answer = 300000

Test #103:

score: 0
Accepted
time: 77ms
memory: 10700kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50001 50002 50003 50004 50005 50006 50007 50008 50009 50010 50011 50012 50013 50014 50015 50016 50017 50018 50019 50020 50021 50022 50023 50024 50025 50026 50027 50028 50029 50030 50031 50032 50033 50034 50035 50036 50037 50038 50039 50040 50041 50042 50043 50044 50045 50046 50047 50048 50049 50050 ...

result:

ok answer = 300000

Test #104:

score: 0
Accepted
time: 79ms
memory: 10556kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50001 50002 50003 50004 50005 50006 50007 50008 50009 50010 50011 50012 50013 50014 50015 50016 50017 50018 50019 50020 50021 50022 50023 50024 50025 50026 50027 50028 50029 50030 50031 50032 50033 50034 50035 50036 50037 50038 50039 50040 50041 50042 50043 50044 50045 50046 50047 50048 50049 50050 ...

result:

ok answer = 300000

Test #105:

score: 0
Accepted
time: 77ms
memory: 10700kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

50001 50002 50003 50004 50005 50006 50007 50008 50009 50010 50011 50012 50013 50014 50015 50016 50017 50018 50019 50020 50021 50022 50023 50024 50025 50026 50027 50028 50029 50030 50031 50032 50033 50034 50035 50036 50037 50038 50039 50040 50041 50042 50043 50044 50045 50046 50047 50048 50049 50050 ...

result:

ok answer = 300000

Test #106:

score: 0
Accepted
time: 84ms
memory: 11980kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 300000

Test #107:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 300000

Test #108:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 300000

Test #109:

score: 0
Accepted
time: 82ms
memory: 11816kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 300000

Test #110:

score: 0
Accepted
time: 83ms
memory: 11812kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 300000

Test #111:

score: 0
Accepted
time: 77ms
memory: 11928kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 300000

Test #112:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 300000

Test #113:

score: 0
Accepted
time: 75ms
memory: 11816kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...

result:

ok answer = 300000

Test #114:

score: 0
Accepted
time: 75ms
memory: 12052kb

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

1 0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 10...

result:

ok answer = 299999

Test #115:

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

input:

300000 150000
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 2
1 ...

output:

150000 149999 149998 149997 149996 149995 149994 149993 149992 149991 149990 149989 149988 149987 149986 149985 149984 149983 149982 149981 149980 149979 149978 149977 149976 149975 149974 149973 149972 149971 149970 149969 149968 149967 149966 149965 149964 149963 149962 149961 149960 149959 149958...

result:

ok answer = 150000

Test #116:

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

input:

300000 150000
1 2
2 300000
1 3
3 300000
1 4
4 300000
1 5
5 300000
1 6
6 300000
1 7
7 300000
1 8
8 300000
1 9
9 300000
1 10
10 300000
1 11
11 300000
1 12
12 300000
1 13
13 300000
1 14
14 300000
1 15
15 300000
1 16
16 300000
1 17
17 300000
1 18
18 300000
1 19
19 300000
1 20
20 300000
1 21
21 300000
1 ...

output:

150000 1 149999 150000 149998 149999 149997 149998 149996 149997 149995 149996 149994 149995 149993 149994 149992 149993 149991 149992 149990 149991 149989 149990 149988 149989 149987 149988 149986 149987 149985 149986 149984 149985 149983 149984 149982 149983 149981 149982 149980 149981 149979 1499...

result:

ok answer = 299999

Test #117:

score: 0
Accepted
time: 117ms
memory: 12116kb

input:

300000 150000
1 2
3 300000
1 3
4 300000
1 4
5 300000
1 5
6 300000
1 6
7 300000
1 7
8 300000
1 8
9 300000
1 9
10 300000
1 10
11 300000
1 11
12 300000
1 12
13 300000
1 13
14 300000
1 14
15 300000
1 15
16 300000
1 16
17 300000
1 17
18 300000
1 18
19 300000
1 19
20 300000
1 20
21 300000
1 21
22 300000
1...

output:

150000 150000 149999 149999 149998 149998 149997 149997 149996 149996 149995 149995 149994 149994 149993 149993 149992 149992 149991 149991 149990 149990 149989 149989 149988 149988 149987 149987 149986 149986 149985 149985 149984 149984 149983 149983 149982 149982 149981 149981 149980 149980 149979...

result:

ok answer = 300000

Test #118:

score: 0
Accepted
time: 111ms
memory: 10996kb

input:

300000 151658
8 10
9 10
1 6
8 10
7 10
3 9
8 9
9 10
3 5
1 8
9 10
7 8
3 4
8 9
5 6
8 9
1 8
3 5
7 10
2 5
9 10
2 4
1 9
2 3
7 10
3 7
8 10
4 7
9 10
4 5
2 10
2 4
6 10
6 10
3 4
2 3
1 2
9 10
7 8
8 10
7 10
9 10
6 10
1 7
3 7
8 10
3 6
9 10
6 10
5 8
7 9
3 10
1 4
8 9
9 10
4 7
3 9
4 6
1 7
2 10
7 9
3 4
2 3
2 6
6 10
...

output:

52550 51281 84828 63013 108248 18302 63011 50059 109618 18301 50062 18300 127630 63003 84829 63000 18299 109619 108407 109620 50068 127631 18298 140160 108616 51547 63039 51548 50034 109621 18297 127632 111284 111283 127633 140161 147931 50035 18296 63034 108737 50040 111282 51549 51550 63026 84830 ...

result:

ok answer = 285014

Test #119:

score: 0
Accepted
time: 98ms
memory: 10944kb

input:

300000 161017
8 10
7 8
8 10
7 9
7 10
9 10
3 10
1 4
9 10
2 9
7 10
7 10
8 9
7 9
1 5
6 10
3 10
2 4
1 2
1 6
6 9
1 8
6 9
5 6
7 8
9 10
8 9
1 5
7 10
9 10
1 3
3 6
9 10
2 9
3 4
1 10
4 5
9 10
8 10
3 10
1 2
6 9
5 6
7 9
1 9
8 9
7 9
5 10
8 9
8 10
1 3
7 10
4 7
8 10
5 8
8 9
5 9
3 4
8 9
8 10
8 10
1 10
4 7
3 4
9 10
...

output:

93598 106902 93329 106906 106917 55556 27175 136594 55557 27174 106973 106979 93309 106945 118700 129724 27173 136595 157289 93696 118971 27172 123686 93697 106847 55611 92514 118701 106851 55473 149301 93698 55475 27171 136596 27170 118702 55424 92680 27169 157290 122936 93699 106835 27168 92314 10...

result:

ok answer = 294859

Test #120:

score: 0
Accepted
time: 93ms
memory: 10996kb

input:

300000 157295
1 2
3 7
5 6
8 9
3 9
4 6
4 7
8 9
2 7
9 10
1 6
8 10
3 4
9 10
9 10
2 3
2 4
9 10
4 6
9 10
5 10
6 10
9 10
4 5
8 9
3 10
1 9
2 10
2 4
5 8
4 6
9 10
5 8
1 5
1 9
1 7
5 10
6 9
3 4
2 5
8 9
8 9
1 10
2 9
9 10
2 3
8 9
3 4
4 7
5 8
9 10
5 10
5 9
5 8
2 7
9 10
4 8
4 9
5 8
5 8
9 10
2 4
7 9
4 10
5 10
5 7
2...

output:

153562 56898 89973 89468 23606 89974 56899 89473 56900 56540 89975 89478 133155 56628 56611 145687 133156 56614 89976 56548 142357 128202 56211 114970 89752 156633 23605 23604 133157 23603 89977 56393 23602 114971 23601 56901 141163 128134 133158 114972 89026 88939 23600 23599 56518 145688 89330 133...

result:

ok answer = 290984

Test #121:

score: 0
Accepted
time: 107ms
memory: 10760kb

input:

300000 152600
6 10
6 7
1 2
1 6
4 7
3 7
3 10
8 10
1 10
6 10
1 8
6 7
9 10
1 2
5 8
8 10
9 10
7 10
5 9
3 10
3 4
2 5
2 9
6 8
6 8
3 4
1 8
7 8
5 8
8 10
9 10
2 3
4 6
6 8
1 10
3 4
4 7
6 10
6 10
5 10
4 10
7 8
5 8
8 9
2 3
4 5
1 10
7 10
2 10
5 10
2 6
9 10
3 5
3 6
3 4
7 10
9 10
1 2
5 7
4 8
5 9
9 10
9 10
4 10
9 1...

output:

120487 52089 148961 85284 52090 52091 18882 56805 18881 120491 18880 52092 51500 148962 18879 56736 51478 95860 138410 18878 128359 110225 18877 120512 120501 128360 18876 95862 18875 56766 51354 141130 85285 120498 18874 128361 52093 120496 120442 140818 148693 95864 18873 56975 141131 110226 18872...

result:

ok answer = 286318