QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#288308#1173. Knowledge Is...ToxicWA 75ms13900kbC++141.6kb2023-12-22 14:48:072023-12-22 14:48:08

Judging History

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

  • [2023-12-22 14:48:08]
  • 评测
  • 测评结果:WA
  • 用时:75ms
  • 内存:13900kb
  • [2023-12-22 14:48:07]
  • 提交

answer

#include<cstdio>
#include<queue>
#include<algorithm>
using namespace std;
const int N=3e5+5;
struct node
{
	int x,y,id;
	friend bool operator < (node p,node q)
	{
		return p.x<q.x;
	}
}a[N];
struct edge
{
	int id,val;
	friend bool operator < (edge x,edge y)
	{
		return x.val>y.val;
	}
};
int n,m,ak[N],bk[N],pos[N],outp[N];
priority_queue<edge> p,q;
int read()
{
	int res,f=1;
	char ch;
	while((ch=getchar())<'0'||ch>'9')
	if(ch=='-')
	f=-1;
	res=ch^48;
	while((ch=getchar())>='0'&&ch<='9')
	res=(res<<1)+(res<<3)+(ch^48);
	return res*f;
}
int main()
{
	int i,x,ans=0,cnt=0;
	n=read();m=read();
	for(i=1;i<=n;i++)
	{
		a[i].x=read();a[i].y=read();a[i].id=i;
	}
	sort(a+1,a+n+1);
	for(i=1;i<=n;i++)
	{
		if(q.size()&&q.top().val<a[i].x)
		{
			p.push((edge){a[i].id,a[i].y});
			ans++;ak[ans]=q.top().id;bk[ans]=a[i].id;
			pos[q.top().id]=pos[a[i].id]=ans;
			q.pop();
		}
		else
		{
			if(p.size()&&p.top().val<a[i].y)
			{
				q.push(p.top());
				bk[pos[a[i].id]=pos[p.top().id]]=a[i].id;
				pos[p.top().id]=0;
				p.pop();p.push((edge){a[i].id,a[i].y});
			}
			else
			q.push((edge){a[i].id,a[i].y});
		}
	}
	if(m+ans>=n)
	{
		x=m+ans-n;
		for(i=1;i<=x;i++)
		{
			outp[ak[i]]=++cnt;
			outp[bk[i]]=++cnt;
		}
		for(i=x+1;i<=ans;i++)
		outp[ak[i]]=outp[bk[i]]=++cnt;
		for(i=1;i<=n;i++)
		if(!outp[i])
		outp[i]=++cnt;
	}
	else
	{
		for(i=1;i<=ans;i++)
		outp[ak[i]]=outp[bk[i]]=++cnt;
		for(i=1;i<=n&&cnt<=m-1;i++)
		if(!outp[i])
		outp[i]=++cnt;
	}
	for(i=1;i<=n;i++)
	printf("%d ",outp[i]);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 7896kb

input:

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

output:

4 5 1 3 3 2 4 

result:

ok answer = 7

Test #2:

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

input:

2 2
1 2
3 4

output:

1 2 

result:

ok answer = 2

Test #3:

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

input:

2 1
1 2
2 3

output:

1 0 

result:

ok answer = 1

Test #4:

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

input:

1 1
4 26

output:

1 

result:

ok answer = 1

Test #5:

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

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:

104 12 119 26 68 67 120 13 38 121 122 54 61 60 41 123 124 125 56 89 44 87 28 3 126 127 128 129 29 130 74 117 35 32 49 62 131 132 60 61 133 1 134 83 21 135 52 58 136 76 40 39 137 68 34 138 19 139 14 35 18 8 140 141 15 113 142 143 144 23 50 145 146 147 148 43 149 150 151 152 153 154 37 34 9 155 20 156...

result:

ok answer = 376

Test #6:

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

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:

146 170 230 132 172 48 194 64 82 96 215 214 87 26 207 136 141 74 231 13 232 233 41 9 222 16 207 125 135 234 235 133 10 65 109 59 38 97 210 143 117 66 74 132 178 15 149 214 19 31 86 14 134 34 203 8 23 236 18 65 58 33 166 237 93 1 155 184 238 222 70 107 10 72 161 226 213 210 136 239 212 202 229 192 17...

result:

ok answer = 471

Test #7:

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

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:

65 152 63 222 122 178 194 95 130 82 144 180 109 133 2 145 249 149 162 139 186 193 195 35 227 63 173 236 64 109 41 181 248 170 189 98 39 200 115 181 171 50 38 56 238 33 53 218 233 40 61 193 126 151 93 83 234 116 245 190 38 161 134 5 164 67 216 141 221 16 168 55 234 236 27 159 11 159 189 89 151 30 199...

result:

ok answer = 500

Test #8:

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

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:

132 219 24 246 4 19 67 16 54 8 81 36 244 110 225 206 117 52 202 74 189 221 196 149 244 1 212 127 155 91 225 50 228 40 43 160 135 69 17 123 21 239 57 184 169 84 210 204 247 76 27 121 125 83 172 156 194 46 37 135 119 158 4 104 29 192 94 15 159 134 133 11 80 113 111 51 217 37 47 52 107 109 179 24 150 1...

result:

ok answer = 500

Test #9:

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

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:

217 158 54 79 141 232 137 218 13 9 30 185 112 26 27 23 186 159 239 168 32 228 11 59 234 154 82 72 150 101 142 47 162 52 161 44 38 99 1 203 40 225 82 130 113 182 95 25 227 213 121 69 229 74 123 17 200 23 54 7 166 96 201 64 131 183 45 217 8 193 207 150 48 169 22 56 39 16 75 107 173 223 67 118 134 125 ...

result:

ok answer = 500

Test #10:

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

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:

239 46 190 4 122 66 157 13 185 54 246 132 130 250 244 1 181 12 25 247 118 146 27 34 127 121 85 206 240 82 10 228 58 206 67 62 132 141 166 17 137 98 152 53 243 26 111 33 231 4 102 214 192 55 14 21 213 91 176 108 65 212 232 103 90 43 215 250 97 99 170 100 194 234 109 236 69 221 70 223 44 196 22 169 18...

result:

ok answer = 500

Test #11:

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

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:

130 150 81 139 187 205 141 63 86 88 38 24 42 124 143 98 242 4 8 75 167 52 59 177 198 213 173 194 248 88 44 146 109 156 93 13 30 56 172 108 238 82 172 206 109 188 87 213 112 215 106 182 106 65 122 206 238 135 131 55 175 57 180 80 46 53 151 84 229 166 113 111 95 118 174 136 133 27 177 10 77 83 158 16 ...

result:

ok answer = 500

Test #12:

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

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:

118 238 123 73 130 93 51 108 140 221 220 90 56 151 198 223 35 13 129 33 102 52 174 172 18 242 160 20 17 152 184 43 199 125 209 157 175 128 211 131 138 246 229 30 247 174 83 220 143 222 163 156 127 136 134 77 107 57 212 49 48 6 156 51 98 18 249 173 183 77 153 96 228 110 2 169 29 146 201 61 86 168 115...

result:

ok answer = 500

Test #13:

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

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:

186 86 241 192 221 119 85 206 138 193 152 200 27 147 35 153 203 101 48 61 77 82 116 69 120 243 67 57 248 171 91 155 195 219 6 59 191 233 145 13 60 50 68 239 81 168 170 68 228 88 183 8 102 112 113 111 12 156 144 124 193 21 38 203 104 150 2 108 39 121 229 90 41 246 196 232 149 88 29 172 179 8 85 40 24...

result:

ok answer = 500

Test #14:

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

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:

26 120 39 245 38 96 39 220 59 21 234 155 104 177 69 248 232 46 176 221 212 69 4 61 64 141 13 99 204 88 48 153 129 51 18 249 72 246 73 52 190 13 136 86 78 149 98 106 146 169 185 129 245 42 200 173 113 105 137 122 107 240 236 232 165 170 218 5 223 62 187 162 123 1 216 75 97 240 119 92 125 37 126 237 1...

result:

ok answer = 500

Test #15:

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

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:

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 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: 1ms
memory: 7964kb

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:

105 106 69 68 63 107 108 60 58 57 109 56 6 7 9 69 110 10 13 84 79 77 111 76 75 74 112 113 59 114 12 47 33 115 116 117 50 118 51 16 25 36 81 119 120 18 42 121 45 44 11 122 123 124 125 76 126 127 128 129 130 131 132 133 46 9 134 44 135 136 36 137 138 49 139 140 141 142 52 143 51 26 144 145 53 146 147 ...

result:

ok answer = 483

Test #17:

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

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:

222 75 4 223 95 192 116 89 25 2 220 158 191 117 224 32 62 190 189 73 225 76 122 188 226 77 227 90 118 7 48 179 79 187 113 81 177 228 229 101 36 61 230 231 180 167 211 83 182 186 219 74 232 88 89 185 183 34 181 233 103 156 178 91 118 184 17 193 9 99 40 4 62 183 44 75 71 128 143 129 42 92 59 56 151 27...

result:

ok answer = 494

Test #18:

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

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:

50 171 120 102 59 19 34 38 140 225 126 123 75 63 209 243 234 137 71 70 185 207 132 169 87 80 16 135 158 233 180 62 142 217 124 84 135 195 28 121 241 237 147 22 43 81 77 52 85 178 245 41 48 86 174 201 233 31 207 91 143 223 146 108 227 82 65 239 193 67 206 94 178 230 181 84 27 87 188 137 61 203 108 20...

result:

ok answer = 500

Test #19:

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

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:

121 177 206 241 108 212 37 28 172 115 32 65 99 143 192 230 44 20 21 125 52 106 4 203 82 121 226 60 83 78 250 228 221 66 125 197 187 27 72 222 84 130 59 37 25 79 137 70 7 132 156 81 19 114 140 6 184 116 207 48 98 126 120 245 76 129 62 208 248 170 173 214 218 170 65 239 69 194 15 12 237 41 100 15 38 1...

result:

ok answer = 500

Test #20:

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

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:

221 191 248 146 140 197 160 92 49 43 203 66 152 109 229 13 46 177 227 114 173 39 130 47 238 230 48 186 133 73 24 175 227 22 206 44 63 155 15 37 54 245 32 228 246 203 5 118 190 81 174 136 132 216 173 11 85 142 118 98 51 202 83 91 66 223 27 150 32 240 198 195 104 99 181 93 116 60 242 86 75 190 167 96 ...

result:

ok answer = 500

Test #21:

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

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:

76 148 51 159 187 171 77 90 11 204 10 35 73 50 30 220 20 161 85 234 105 237 19 240 135 212 194 143 140 153 99 43 58 241 197 168 142 139 171 194 247 149 9 4 89 72 111 72 154 165 235 61 57 89 154 105 40 197 207 14 22 54 107 204 24 23 206 164 208 216 67 81 92 159 15 176 245 101 79 248 42 157 99 199 8 1...

result:

ok answer = 500

Test #22:

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

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:

250 176 214 223 74 119 63 29 244 151 161 79 245 52 163 62 107 165 16 167 106 242 121 247 155 154 242 188 8 96 146 210 12 123 181 154 245 7 92 134 225 200 94 165 28 44 212 235 213 172 78 201 189 212 115 4 122 43 28 45 124 237 126 36 236 144 3 157 38 117 157 240 219 19 243 119 215 233 103 93 185 230 9...

result:

ok answer = 500

Test #23:

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

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:

224 84 152 80 181 202 20 105 97 82 107 244 199 85 86 249 245 65 9 183 28 145 58 164 231 117 32 112 8 170 191 14 9 227 120 190 82 2 30 31 156 196 143 167 134 48 126 99 178 63 115 172 180 248 176 55 123 86 25 250 219 180 36 200 60 146 185 222 88 13 91 35 51 144 16 226 217 236 124 69 220 55 21 160 155 ...

result:

ok answer = 500

Test #24:

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

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:

61 126 225 59 44 52 74 85 179 167 188 34 215 38 39 220 38 101 192 56 95 10 211 204 236 22 171 185 58 73 43 97 68 219 213 145 224 98 1 65 81 118 17 143 22 168 119 146 122 71 115 206 212 15 72 99 97 174 161 116 231 205 16 229 87 137 7 82 60 180 144 125 18 140 238 78 15 28 235 26 217 49 168 206 39 141 ...

result:

ok answer = 500

Test #25:

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

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:

213 138 231 212 224 155 9 29 11 217 38 53 185 168 249 158 135 176 164 49 99 242 35 55 184 116 194 172 79 243 215 106 72 26 234 157 207 106 137 241 122 222 119 176 43 186 18 192 130 123 104 145 22 186 206 112 7 2 114 91 208 223 73 245 26 138 51 197 32 237 155 160 189 78 30 109 56 21 213 70 52 1 117 1...

result:

ok answer = 500

Test #26:

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

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:

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 = 236

Test #27:

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

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:

161 141 142 28 162 163 143 144 112 164 145 165 166 167 168 123 146 147 169 170 121 171 97 172 173 148 75 7 174 46 149 175 150 151 139 176 177 178 140 152 179 71 180 181 153 182 183 154 107 140 156 184 126 157 185 186 158 187 132 83 188 189 190 159 152 191 160 192 9 193 194 195 99 196 101 197 61 198 ...

result:

ok answer = 500

Test #28:

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

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:

75 97 113 56 156 53 143 219 228 197 192 210 87 229 153 161 28 230 218 211 231 36 130 205 232 136 205 52 233 88 225 171 215 119 65 70 234 235 236 237 215 238 239 240 105 220 103 168 225 241 224 56 99 242 243 244 29 245 177 217 195 202 123 72 50 246 66 122 108 214 160 125 223 175 247 16 104 185 162 19...

result:

ok answer = 500

Test #29:

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

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:

186 228 46 192 184 143 251 86 116 282 234 122 223 133 127 71 227 138 57 231 266 72 55 1 184 263 240 246 240 85 126 168 269 81 161 156 124 21 187 205 260 150 134 70 199 280 90 250 105 3 88 98 167 234 80 281 37 183 70 187 156 100 254 146 113 200 137 249 151 212 56 196 119 186 170 19 135 200 255 256 22...

result:

ok answer = 500

Test #30:

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

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:

210 221 253 11 130 145 116 195 201 1 286 209 52 154 292 26 212 112 274 153 169 92 120 98 112 124 105 282 270 117 25 44 262 97 202 255 234 268 257 295 167 164 224 100 214 102 123 199 244 180 254 129 49 81 171 179 264 232 198 118 132 148 28 114 163 145 144 251 127 171 256 220 191 54 85 269 108 88 162 ...

result:

ok answer = 500

Test #31:

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

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:

203 254 263 163 235 129 164 60 276 233 94 196 113 108 101 292 239 116 78 190 102 185 63 242 11 25 71 70 223 320 197 243 197 201 109 258 168 262 207 218 54 138 157 143 209 243 81 295 221 121 308 39 188 312 152 193 175 212 192 176 277 184 245 277 213 227 196 291 206 273 12 322 261 281 264 141 23 322 1...

result:

ok answer = 500

Test #32:

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

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:

168 470 453 53 467 283 64 46 128 262 40 271 365 429 308 139 353 325 256 185 82 211 97 324 183 110 389 181 220 153 131 149 38 307 427 45 408 359 452 422 398 95 4 70 417 375 1 470 217 245 456 21 104 351 381 331 231 436 59 402 298 280 457 138 152 120 154 205 72 318 180 464 80 386 150 317 264 254 450 54...

result:

ok answer = 500

Test #33:

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

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:

270 183 312 307 346 28 300 329 73 315 336 212 354 345 315 3 359 46 206 214 216 155 283 305 262 150 177 234 83 339 66 189 342 309 101 201 104 233 182 247 317 269 168 314 2 347 339 42 76 45 222 56 266 335 284 252 328 296 160 197 175 303 293 258 286 109 275 353 192 304 249 99 313 48 14 157 361 174 110 ...

result:

ok answer = 500

Test #34:

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

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:

278 125 296 35 405 174 339 259 255 285 23 114 2 418 264 409 138 104 95 100 34 377 213 85 185 48 349 380 353 360 160 319 379 127 406 68 80 382 402 142 431 354 375 166 280 228 137 113 341 392 431 403 157 413 316 193 83 434 154 182 260 75 52 220 331 263 108 401 103 408 73 57 51 88 225 432 206 309 275 3...

result:

ok answer = 500

Test #35:

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

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:

194 233 82 314 226 78 302 296 310 165 215 257 276 206 112 294 309 23 278 239 251 207 173 109 77 239 104 212 51 130 262 319 283 241 243 212 200 274 227 166 124 83 248 195 116 197 161 225 267 271 211 202 142 168 300 149 167 327 249 317 119 110 188 232 255 292 52 171 155 170 324 292 242 150 272 287 256...

result:

ok answer = 500

Test #36:

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

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:

74 32 386 372 164 366 450 415 261 472 75 182 463 111 459 397 187 105 406 407 315 84 461 199 37 286 103 439 221 129 257 135 405 447 469 324 360 434 202 351 15 263 197 268 456 136 466 89 51 458 423 213 264 229 377 440 56 275 391 289 186 280 116 410 319 144 190 470 208 346 473 49 476 61 285 124 321 232...

result:

ok answer = 500

Test #37:

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

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:

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 = 500

Test #38:

score: 0
Accepted
time: 29ms
memory: 13868kb

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:

62462 28269 3963 48062 62463 62464 3962 33656 33658 62465 33660 33662 62466 33664 62467 33666 62468 62469 62470 62471 33667 33669 28286 33670 33671 62472 33673 59013 62473 62474 28241 62475 62476 33645 62477 62478 62479 48038 33635 33636 33638 62480 62481 62482 33640 62483 3958 62484 62485 59061 282...

result:

ok answer = 230231

Test #39:

score: 0
Accepted
time: 40ms
memory: 13788kb

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:

100414 76744 33479 35652 115134 85509 133729 133730 54404 130506 103464 95240 103463 76742 19100 108333 41888 33444 103455 23656 57394 85606 76741 127396 133731 53863 133732 54500 33564 53884 95220 133733 53883 60224 133734 5987 99659 23790 108334 18982 46026 23796 76740 76739 54398 126577 76738 332...

result:

ok answer = 292561

Test #40:

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

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:

84820 115618 39574 47036 79357 64849 72785 50376 121935 72820 64833 110315 134301 7844 5781 131270 134129 50205 140357 58532 146754 80236 73031 13547 82659 25500 124046 27228 21901 46935 48871 146805 115827 19072 134015 104444 55329 112557 56644 102637 38681 118926 129604 101478 85784 31825 97929 80...

result:

ok answer = 299930

Test #41:

score: 0
Accepted
time: 53ms
memory: 13900kb

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:

44424 140120 9560 121517 90686 34864 98071 103335 137565 144741 34829 89717 74325 33141 3299 131094 144695 53144 97649 96340 134104 94267 11181 34825 110747 89025 22822 35765 132270 36408 149787 46188 124005 46499 48283 123686 33844 144822 83904 88404 123708 59851 119760 25691 16394 78581 53186 3556...

result:

ok answer = 300000

Test #42:

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

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:

72866 145908 128070 53228 128595 92866 43057 142450 69804 29578 77811 56210 136918 29041 18054 94439 32400 6870 72134 119563 41550 101574 67034 129811 33272 45823 91828 113048 98154 32287 77064 74038 139258 31524 82522 81891 56809 120270 55062 120795 35543 78489 62643 72076 139802 14690 35733 37968 ...

result:

ok answer = 300000

Test #43:

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

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:

4449 16977 95694 109437 633 21678 36989 28818 35942 93255 24501 31715 79956 83117 47690 77187 43926 80356 5099 52559 72632 20547 86862 19104 55775 12581 147801 59390 148131 17074 82933 74338 19588 70613 59017 114741 200 43800 72264 106360 75811 18421 15654 22542 63416 86454 53299 59098 127038 148782...

result:

ok answer = 300000

Test #44:

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

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:

95367 51965 100048 61261 124793 112842 146998 133822 71387 96493 109530 19086 86743 42510 32693 124513 103312 24744 10728 82337 86294 59628 34493 67070 82513 21398 79495 80635 145600 134367 31463 91002 149919 4476 90701 2689 85365 124448 15027 25585 29841 148322 29552 17981 104447 41356 122792 90398...

result:

ok answer = 300000

Test #45:

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

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:

141201 11697 136860 109402 135430 122244 40566 15143 111433 46518 51671 91875 97680 22840 106414 38668 18469 95091 112221 82749 77799 136678 14448 18583 50569 13878 7769 46135 19471 142588 148807 140263 98858 142664 147752 48948 83568 59656 122274 115969 74055 7759 15541 38295 61346 87413 86028 8170...

result:

ok answer = 300000

Test #46:

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

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:

10596 126750 103437 31096 67484 133259 143472 22292 98633 19283 77160 63774 70171 16761 55402 98127 146993 23413 60403 106047 37710 23031 112474 43258 49459 62063 26495 112798 91271 98293 42541 90887 126970 109139 11665 119761 16355 7071 23787 103057 81799 103062 79509 115654 68453 91105 106171 1190...

result:

ok answer = 300000

Test #47:

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

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:

85538 72533 115124 72319 129708 102110 65540 123604 26184 23729 82633 140854 97759 60600 147609 31108 72595 114906 52703 55752 34570 46440 77561 129036 52945 79306 115580 44722 80921 61227 11820 117175 60021 143043 120544 145357 129353 135229 123597 140382 103538 9248 93983 46445 120431 4357 39345 1...

result:

ok answer = 300000

Test #48:

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

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:

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 = 259601

Test #49:

score: 0
Accepted
time: 34ms
memory: 13876kb

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:

62454 62455 52802 62456 23286 62457 14543 62458 24584 62459 24586 62460 14395 62461 62462 62463 23318 23322 24593 24594 62464 23264 23266 62465 23254 62466 24595 62467 62468 62469 62470 62471 62472 24597 62473 62474 62475 62476 24601 24604 62477 55061 62478 62479 62480 24605 55864 62481 24608 62482 ...

result:

ok answer = 296054

Test #50:

score: 0
Accepted
time: 40ms
memory: 13376kb

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:

24362 74588 48058 67450 52542 133688 13108 356 133689 26414 4934 14690 101007 38078 38352 14710 90532 90503 70862 103061 90495 58518 48075 90498 8488 103048 133224 8459 42684 103002 1114 133217 67022 30631 48046 90024 14680 133690 102998 90508 90103 100595 48042 133465 102987 14765 133691 100779 845...

result:

ok answer = 290604

Test #51:

score: 0
Accepted
time: 42ms
memory: 13468kb

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:

25475 8635 101943 95076 84995 107103 47063 102287 122556 41345 111263 6483 34010 31581 77481 136936 75679 39153 101981 71915 3678 40254 80146 89241 81866 81913 125308 83547 113782 54413 111668 113176 116127 131669 3778 23230 128136 148738 70830 116875 33391 136702 2172 93531 29818 134478 120183 1458...

result:

ok answer = 299989

Test #52:

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

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:

57911 132171 138005 84208 40870 140807 91753 48651 136862 130603 1643 44491 45117 130683 18493 144903 4779 135135 32749 83923 38228 76021 123973 10343 1583 136574 141839 75456 122203 111020 148611 118236 7966 117451 81271 39819 116840 41275 26322 91229 89023 79077 42227 117321 18382 107342 124757 21...

result:

ok answer = 299998

Test #53:

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

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:

42877 116112 74129 8882 143918 39893 96965 78737 41362 36990 124425 63633 33112 47416 110528 94361 112357 119782 49371 51845 67951 133411 12244 51818 135971 91511 112206 36969 77144 33050 15889 99266 20513 21825 102422 18268 136295 95430 35736 114918 247 121046 127189 73011 102189 96310 84144 5240 2...

result:

ok answer = 299999

Test #54:

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

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:

135093 62890 15122 66622 107208 3887 147577 124146 79150 84567 122002 112886 36324 24612 104892 1767 9826 10602 45513 67527 58175 57674 92799 149151 121961 22752 35501 91852 117784 6566 148361 59613 39441 18048 7721 38567 117675 138839 144230 125126 13657 25202 45004 137911 149846 47982 141975 6045 ...

result:

ok answer = 300000

Test #55:

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

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:

79087 45811 48788 117212 99027 111494 127954 99929 100090 1077 63871 25327 111707 49180 55830 51017 113357 98762 11348 31828 149955 120448 139831 956 4339 106864 85057 136082 26172 6727 106812 137530 27384 11156 144556 68427 45459 114005 19519 113022 40438 91800 940 141550 59490 84455 88552 45665 66...

result:

ok answer = 300000

Test #56:

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

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:

71743 18157 80901 102436 89252 2026 96656 1460 15163 8774 1678 139814 34218 82605 46299 116999 56950 42528 76072 86052 130856 3609 290 135015 16605 86802 98896 103235 132558 115222 43971 98958 29597 101409 107433 84787 40403 8643 24629 129966 5212 145945 90114 622 147631 128887 62096 47700 100738 51...

result:

ok answer = 300000

Test #57:

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

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:

135594 77743 138263 33778 63741 131319 88252 66392 139599 70324 61263 42717 130231 58503 70528 51459 149734 84522 57161 125565 102390 568 96792 17884 76598 19697 142739 126569 38954 25369 77341 40762 16223 55711 32381 28005 24594 142290 137148 107379 135040 98346 26234 97174 78251 90414 60916 115929...

result:

ok answer = 300000

Test #58:

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

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:

143480 104046 113207 105193 91527 102058 51222 85447 64335 60976 54491 128386 102404 54625 51363 6040 40182 8014 119358 43485 81861 35907 103726 74963 25979 140652 127735 30430 40858 133530 57307 138619 129541 111334 141486 23025 140096 60605 133514 74327 30789 76543 126728 2332 142180 57910 109132 ...

result:

ok answer = 300000

Test #59:

score: 0
Accepted
time: 21ms
memory: 12060kb

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:

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 = 152784

Test #60:

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

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:

2784 62547 18956 62548 18930 62549 18946 62550 62551 38792 62552 62553 19030 62554 19331 62555 62556 62557 53764 62558 62559 62560 62561 62562 62563 62564 62565 62566 62567 38801 14275 62568 20128 62569 19939 19905 19903 20016 62570 54141 62571 20287 20305 62572 20401 20360 62573 62574 38757 62575 1...

result:

ok answer = 148740

Test #61:

score: 0
Accepted
time: 40ms
memory: 13752kb

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:

44968 44963 103953 15922 44971 11534 33538 10098 63611 103947 33212 11525 78433 133778 107309 78430 44942 103977 45033 33185 4999 45029 39581 103964 69482 133779 78426 33443 78425 15901 33169 33171 103868 66889 103880 103879 33095 33137 45042 103910 10162 63548 66846 63551 69805 78427 103971 44985 3...

result:

ok answer = 275741

Test #62:

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

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:

58898 142914 13189 149480 110555 115997 1218 144745 72367 88264 20972 135234 70043 76337 83323 106655 121941 88136 137447 135159 10954 134002 22013 143969 143858 64107 88504 92812 83467 63161 101255 73950 118998 133081 31478 6386 146507 134461 117195 93582 50569 2102 7807 140490 144516 140510 4539 1...

result:

ok answer = 299817

Test #63:

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

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:

107324 140538 57352 47172 6914 124416 43021 27303 28555 62114 28886 44986 105795 43135 136955 122824 52767 95133 53367 81884 68446 82245 144454 36256 74506 120405 142477 8278 140319 49905 53270 5025 118851 22761 100100 44007 26398 22554 122067 37684 14937 40195 55991 76312 62362 93792 120207 12525 8...

result:

ok answer = 299999

Test #64:

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

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:

46206 16963 90285 9723 125758 138004 70150 136924 123890 916 144317 62577 37765 23729 85600 55508 133552 73991 128853 16776 51755 97738 50686 30172 47458 2892 18214 62683 98536 115197 39224 114429 54096 100689 113629 87633 13773 101165 82373 12799 2964 100799 12779 84813 29072 82563 99653 10959 6943...

result:

ok answer = 300000

Test #65:

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

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:

31525 57654 8100 109520 57958 129651 1213 94881 54166 37567 101650 14128 144051 133570 113261 50127 116172 65387 87818 130345 58507 19631 30055 134589 132939 58733 19815 113068 136058 84894 105477 58035 42105 23185 10172 137932 121420 76198 12347 62767 126061 100478 131090 8866 132216 71121 102788 8...

result:

ok answer = 300000

Test #66:

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

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:

24198 36605 40354 122294 104520 6909 126227 41384 109580 13931 77337 126095 111086 82795 13429 2659 116936 115486 66558 139767 117072 145420 5057 34236 46171 75890 142043 146585 106926 87963 18772 125761 2438 46154 74386 42554 107561 127825 123057 73492 54203 119577 115540 107829 116677 30621 108950...

result:

ok answer = 300000

Test #67:

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

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:

56169 149073 45820 48642 107719 112833 122344 91452 139567 5036 134522 30402 43617 10591 90159 131247 134458 80724 39082 73204 11210 16771 112729 132992 40559 10786 58543 130887 79151 38612 57865 30649 62690 133314 116625 97988 47478 107904 23767 13351 127858 106101 23882 49000 21496 92121 47569 115...

result:

ok answer = 300000

Test #68:

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

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:

86747 119105 42196 25344 87262 129950 112297 104478 16072 148473 57955 137896 123560 82353 104225 56871 18378 7093 141423 45905 33248 10393 89443 148384 140767 97242 122972 93864 34609 112549 106455 63796 144127 40364 23628 41021 117781 121149 104817 103262 87039 41625 106171 8382 25619 63266 145317...

result:

ok answer = 300000

Test #69:

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

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:

119401 70943 139636 71157 109842 78115 121255 126319 35028 73513 32863 100444 71742 112014 53971 4427 68463 77708 46872 90948 80464 73498 103216 113027 83933 97565 94047 107325 45659 1723 4111 135411 28020 35113 74098 82138 53162 80165 104051 65158 49894 119093 126561 121511 143624 48248 70957 80217...

result:

ok answer = 300000

Test #70:

score: 0
Accepted
time: 23ms
memory: 12484kb

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:

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 = 192988

Test #71:

score: 0
Accepted
time: 30ms
memory: 13812kb

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:

57850 53703 62573 59870 62574 59866 62575 62576 59863 53702 62577 53701 17969 62578 62579 53700 53699 53698 62580 53697 62581 53696 62582 62583 62584 53695 53694 59841 62585 59838 53693 62586 62587 62588 62589 53692 62590 53691 53675 59850 60995 53689 60987 62591 62592 53688 17975 62593 62594 59903 ...

result:

ok answer = 297533

Test #72:

score: 0
Accepted
time: 35ms
memory: 13584kb

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:

17541 9582 9606 14638 65307 67077 123641 67245 44634 29438 67190 67665 82719 106651 67340 85178 29177 72136 314 46867 29202 106647 106646 87932 133576 6031 87908 133577 60728 133578 69263 46856 66460 106641 54648 67344 67262 60680 117357 118712 80146 28316 60496 133579 111686 46877 84839 15917 28075...

result:

ok answer = 278039

Test #73:

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

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:

75749 4380 96593 13385 143714 85431 138538 46824 143583 17863 42799 145369 97874 52052 106631 75823 40709 148625 18936 62 2694 87454 47067 133495 43795 98104 6717 106787 135106 124195 46278 84567 63589 141872 48210 72620 6365 111728 146208 770 52557 111100 72793 113822 119550 55274 75798 106524 1348...

result:

ok answer = 299938

Test #74:

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

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:

124915 46717 129381 138448 74571 114524 123861 79902 53800 133709 102938 92352 91018 67389 9743 10550 154 526 59238 9089 141200 127473 120606 54584 82211 112779 30382 22873 121918 146199 19949 72601 40759 25012 107356 133835 90256 49068 137450 51983 75359 10683 126772 30730 90469 102764 89266 29624 ...

result:

ok answer = 299996

Test #75:

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

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:

24122 16007 42014 63122 56786 25597 25550 85700 37400 82212 25435 45566 58352 48013 149244 82923 20521 73382 147810 111753 17527 141399 9922 83217 131785 41522 41187 9285 1831 95280 74901 56768 69465 25328 145240 96400 46462 57131 139358 77675 93862 107020 112441 28554 92955 86463 25140 87739 112876...

result:

ok answer = 300000

Test #76:

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

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:

143700 145971 136451 119028 119252 25463 133756 23518 48557 142582 99591 24997 65808 40621 60186 34945 91108 68057 88685 52698 83636 85208 83788 95497 121351 66258 6679 86969 135482 65090 70900 148807 50507 16263 140267 41320 57833 31151 35858 145412 82611 128908 37477 1406 141873 129608 121070 8847...

result:

ok answer = 300000

Test #77:

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

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:

14264 26604 139727 109488 34985 137219 96005 105709 5841 109599 73433 125565 63115 106955 124621 3286 32232 97781 102018 101373 127543 134422 90315 23989 34096 125079 119312 18874 80157 77328 65541 69430 35132 60297 45428 147494 6127 70151 22474 94191 121947 136532 114861 103566 128803 35597 106616 ...

result:

ok answer = 300000

Test #78:

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

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:

120653 89485 24348 54100 14307 3879 44573 4674 74705 125348 19565 147596 133981 29712 149428 95248 22459 89810 65203 8594 146032 27186 133438 142665 137421 123759 55845 26448 123378 72540 44785 92595 91141 139717 50511 16021 115586 149970 13272 33157 77950 86271 52307 23337 8046 82982 110133 108891 ...

result:

ok answer = 300000

Test #79:

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

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:

111736 122719 2732 126823 83023 69340 34817 8739 29732 135564 148510 914 65712 19031 149195 115518 117817 55042 30449 94595 94200 101632 64833 119693 25319 116438 48950 119085 87808 5976 20785 135751 134764 46152 136299 23366 112944 141030 61494 128132 40818 9965 18637 8262 75044 24468 109813 45229 ...

result:

ok answer = 300000

Test #80:

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

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:

47669 93387 135010 13595 42757 138566 95326 69829 15202 142486 36722 129747 10226 121950 140170 73795 110078 126436 20233 66888 24378 60530 98925 87241 31072 13721 68410 30906 54263 98567 136056 95746 10944 50410 130197 51376 110911 20551 59659 102686 134493 56849 107242 93260 121626 24941 81800 968...

result:

ok answer = 300000

Test #81:

score: 0
Accepted
time: 23ms
memory: 12800kb

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:

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 = 233191

Test #82:

score: -100
Wrong Answer
time: 32ms
memory: 13880kb

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 53669 28543 53668 0 0 0 23881 53667 0 23882 0 0 0 0 53666 53665 23883 53664 0 0 0 0 0 0 23888 0 0 28515 0 0 28517 0 28520 53663 4011 0 0 23886 53662 53661 0 0 0 0 0 0 0 0 28536 23889 0 53660 28568 0 53659 23871 0 23870 28582 0 53658 0 0 23873 23875 0 0 0 0 53657 53641 0 53655 0 53654 53653 0 0 404...

result:

wrong answer Integer 53669 violates the range [0, 24012]