QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#282164#1173. Knowledge Is...crescentAC ✓109ms11496kbC++141.1kb2023-12-11 15:27:392023-12-11 15:27:40

详细

Test #1:

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

input:

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

output:

3 4 1 2 2 1 3 

result:

ok answer = 7

Test #2:

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

input:

2 2
1 2
3 4

output:

1 1 

result:

ok answer = 2

Test #3:

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

input:

2 1
1 2
2 3

output:

1 0 

result:

ok answer = 1

Test #4:

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

input:

1 1
4 26

output:

1 

result:

ok answer = 1

Test #5:

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

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:

39 19 119 21 68 67 120 1 26 121 122 54 61 60 40 123 124 125 56 89 41 87 6 30 126 127 128 129 29 130 74 42 35 32 49 43 131 132 44 45 133 37 134 46 2 135 52 47 136 48 40 39 137 49 34 138 1 139 3 4 18 11 140 141 15 50 142 143 144 10 51 145 146 147 148 52 149 150 151 152 153 154 5 6 7 155 20 156 157 158...

result:

ok answer = 376

Test #6:

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

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:

230 170 231 132 172 45 167 45 70 112 168 169 71 232 170 136 233 97 234 5 171 235 236 6 172 12 207 237 135 238 239 115 7 55 72 59 21 73 210 116 117 66 74 117 173 8 118 214 240 22 111 9 134 23 203 241 23 242 10 46 146 24 166 0 75 4 119 174 0 222 76 72 10 86 120 226 175 176 121 0 177 178 229 179 179 15...

result:

ok answer = 471

Test #7:

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

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 117 221 118 178 194 95 130 78 250 180 109 108 2 145 243 120 162 107 186 191 195 35 227 61 172 236 64 109 41 181 244 169 188 159 40 200 115 181 170 50 38 56 234 33 50 218 228 38 61 193 125 151 93 79 235 116 245 190 39 161 132 5 92 67 216 135 221 16 168 55 234 236 27 159 10 98 189 89 148 30 199...

result:

ok answer = 500

Test #8:

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

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 90 8 81 36 243 110 225 206 116 52 202 74 189 221 196 149 244 1 211 127 155 98 225 50 228 40 43 160 135 69 17 123 21 239 57 183 169 84 210 204 247 75 27 121 125 83 178 156 194 86 37 135 119 158 4 104 29 192 93 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: 3064kb

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

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

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

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

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

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

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

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 33 110 10 1 84 79 77 111 76 75 74 112 113 34 114 2 47 35 115 116 117 36 118 51 3 2 36 37 119 120 17 42 121 45 44 15 122 123 124 125 38 126 127 128 129 130 131 132 133 39 4 134 40 135 136 41 137 138 42 139 140 141 142 43 143 44 22 144 145 45 146 147 148 ...

result:

ok answer = 483

Test #17:

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

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 1 223 64 192 116 65 10 1 159 107 191 117 224 26 43 190 189 66 225 76 122 188 160 77 161 67 118 2 44 162 79 187 108 81 163 226 227 68 37 45 228 229 164 165 166 83 167 186 168 74 230 88 89 185 169 27 170 171 69 109 172 91 110 184 11 173 3 70 28 4 62 183 46 71 72 111 143 112 30 92 59 56 151 231 ...

result:

ok answer = 494

Test #18:

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

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 117 98 58 19 34 38 140 225 129 123 74 63 209 243 234 137 249 70 183 207 132 167 86 80 16 126 84 231 180 62 142 217 122 82 129 195 27 118 241 237 147 22 43 81 77 52 85 177 245 39 48 86 174 198 233 31 207 91 143 223 159 108 221 82 65 239 193 66 206 93 178 222 181 161 28 87 188 137 135 203 108 1...

result:

ok answer = 500

Test #19:

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

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 109 115 32 65 99 143 192 230 44 20 21 125 52 106 4 203 82 121 226 60 83 78 250 225 221 66 125 197 187 27 72 222 84 130 59 36 25 49 137 70 7 132 155 81 19 114 140 6 184 116 207 48 97 126 120 245 76 129 62 208 248 111 172 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: 0ms
memory: 3132kb

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

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

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

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

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

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

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

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:

106 86 87 14 107 108 88 89 31 109 90 110 111 112 113 32 91 92 114 115 33 116 34 117 118 93 35 1 119 23 94 120 95 96 36 121 122 123 37 97 124 38 125 126 98 127 128 99 39 85 101 129 40 102 130 131 103 132 41 42 133 134 135 104 43 136 105 137 2 138 139 140 44 141 45 142 46 143 144 145 146 147 21 148 14...

result:

ok answer = 500

Test #28:

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

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:

51 68 69 8 105 35 106 150 151 152 153 154 36 204 205 107 206 207 194 155 208 6 209 156 210 112 181 22 211 37 157 108 158 212 213 214 159 73 215 216 191 160 217 218 81 161 70 109 201 162 163 23 75 219 164 220 5 221 153 193 165 178 71 38 26 222 39 71 72 190 136 73 166 151 223 12 74 161 138 167 224 110...

result:

ok answer = 500

Test #29:

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

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:

150 196 23 160 40 108 219 54 84 246 202 87 170 100 91 39 195 106 29 199 234 40 27 1 151 231 205 214 208 53 92 136 237 48 127 124 93 11 155 173 224 113 101 37 166 247 58 177 70 2 53 66 134 201 51 248 18 152 38 155 120 145 222 114 81 167 102 215 115 180 28 164 87 154 138 10 103 168 223 225 197 177 33 ...

result:

ok answer = 500

Test #30:

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

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:

160 171 203 6 80 94 66 145 150 1 232 159 110 104 242 13 162 62 224 103 118 46 70 49 62 74 55 236 220 67 13 22 212 49 152 205 184 218 207 245 117 114 174 90 164 52 73 149 194 130 204 79 25 41 121 129 214 182 148 68 82 98 14 64 113 95 94 201 77 121 206 170 140 27 43 219 58 44 112 8 83 213 5 222 158 23...

result:

ok answer = 500

Test #31:

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

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:

129 180 189 89 161 65 90 30 202 159 47 122 57 54 51 218 165 58 39 116 51 111 32 168 6 13 36 35 149 246 123 169 123 127 55 184 94 188 133 144 27 69 83 72 135 169 41 221 147 61 234 20 114 238 78 119 101 138 118 102 203 110 171 203 139 153 122 217 132 199 6 248 187 207 190 71 12 248 125 23 212 161 223 ...

result:

ok answer = 500

Test #32:

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

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:

84 250 233 27 247 142 32 23 64 131 20 136 183 215 154 70 177 163 128 93 41 106 49 162 92 55 195 91 110 77 66 75 19 154 214 23 204 180 232 211 199 48 2 35 209 188 1 250 109 123 236 11 52 176 191 166 116 218 30 201 149 140 237 69 76 60 77 103 36 159 90 244 40 193 75 159 132 127 230 27 201 48 214 249 1...

result:

ok answer = 500

Test #33:

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

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:

155 92 197 192 231 14 185 214 37 200 221 106 239 230 200 2 244 23 103 107 108 78 168 190 147 75 89 119 42 224 33 95 227 194 51 101 52 118 91 132 202 154 84 199 1 232 224 21 38 23 111 28 151 220 169 137 213 181 80 99 88 188 178 143 171 55 160 238 96 189 134 50 198 24 7 79 246 87 55 210 43 64 66 81 24...

result:

ok answer = 500

Test #34:

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

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:

139 63 148 18 220 87 170 130 128 143 12 57 1 233 132 224 69 52 48 50 17 192 107 43 93 24 175 195 177 180 80 160 194 64 221 34 40 197 217 71 246 177 190 83 140 114 69 57 171 207 246 218 79 228 158 97 42 249 77 91 130 38 26 110 166 132 54 216 52 223 37 29 26 44 113 247 103 155 138 181 63 138 64 28 102...

result:

ok answer = 500

Test #35:

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

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:

113 152 41 233 145 39 221 215 229 84 134 176 195 125 56 213 228 12 197 158 170 126 92 55 39 158 52 131 26 65 181 238 202 160 162 131 119 193 146 85 62 42 167 114 58 116 81 144 186 190 130 121 71 87 219 75 86 246 168 236 60 55 107 151 174 211 26 90 78 89 243 211 161 75 191 206 175 121 156 74 8 129 24...

result:

ok answer = 500

Test #36:

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

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:

37 16 193 186 82 183 225 208 131 245 38 91 236 56 232 199 94 53 203 204 158 42 234 100 19 143 52 220 111 65 129 68 203 224 242 162 180 217 101 176 8 132 99 134 229 68 239 45 26 231 212 107 132 115 189 220 28 138 196 145 93 140 58 205 160 72 95 243 104 173 246 25 249 31 143 62 161 116 6 176 205 173 1...

result:

ok answer = 500

Test #37:

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

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: 54ms
memory: 9884kb

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 18688 1 18689 62463 62464 2 33656 33658 62465 33660 33662 62466 33664 62467 33666 62468 62469 62470 62471 33667 33669 18690 33670 33671 62472 33673 18691 62473 62474 18692 62475 62476 33645 62477 62478 62479 18693 33635 33636 33638 62480 62481 62482 33640 62483 3 62484 62485 18694 18695 62486 ...

result:

ok answer = 230231

Test #39:

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

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:

67167 76744 100531 24189 100532 67168 133729 133730 59843 100533 103464 67169 103463 76742 11558 100534 24190 33444 103455 133731 42239 67170 76741 100535 133732 42240 133733 59811 33564 42241 67171 133734 42242 42243 133735 5987 67172 23790 100536 11559 42244 133736 76740 76739 64090 100537 76738 1...

result:

ok answer = 292561

Test #40:

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

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:

84424 114110 87694 47557 78550 64849 72581 50376 118116 72582 64833 59411 131152 7609 5537 131153 131154 50205 140182 56914 146754 78551 73031 12776 25953 25500 124046 27517 21862 45721 48871 146805 115827 18168 131155 103967 54671 112392 54672 35996 37718 118390 127027 101456 84425 32144 97244 7855...

result:

ok answer = 299930

Test #41:

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

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 139866 9255 121517 90666 64708 98071 103335 137565 144741 34651 89717 82116 33103 3299 130943 144695 52979 97238 96310 134104 59849 11181 34652 110747 89025 22866 35765 132270 77490 149546 46188 123921 46499 48273 123686 33763 144822 98093 88285 123666 59747 119702 25691 16394 36197 76273 3540...

result:

ok answer = 300000

Test #42:

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

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:

72848 145908 128070 53228 128581 92855 43053 142450 70750 29560 77809 55936 136918 29027 18046 94439 32394 6870 72134 119563 41534 101574 60922 129811 33272 45810 91828 113047 98146 32283 77039 74024 139258 31521 37745 81886 56805 120270 55034 120795 35543 78469 62619 72076 139798 14690 35724 37968 ...

result:

ok answer = 300000

Test #43:

score: 0
Accepted
time: 102ms
memory: 9824kb

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:

4448 16977 95687 109437 633 27124 36986 28818 35942 93255 24501 31715 79956 18105 47688 77181 43926 80355 5099 52559 72632 20547 86862 19103 55775 12581 147800 59390 148127 17074 82933 74338 19588 70613 59017 114741 200 43798 72264 106360 75808 18421 15654 100360 63415 86454 53299 59098 127038 14878...

result:

ok answer = 300000

Test #44:

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

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 79494 80635 145598 134367 31462 91002 149919 4476 90701 2689 85365 124448 15027 25585 29841 148321 29552 17981 104447 41356 122792 90398...

result:

ok answer = 300000

Test #45:

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

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: 103ms
memory: 9812kb

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: 105ms
memory: 9920kb

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: 43ms
memory: 10228kb

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: 58ms
memory: 9712kb

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 18741 62456 18742 62457 1 62458 24584 62459 24586 62460 2 62461 62462 62463 18743 18744 24593 24594 62464 18745 18746 62465 18747 62466 24595 62467 62468 62469 62470 62471 62472 24597 62473 62474 62475 62476 24601 24604 62477 18748 62478 62479 62480 24605 18749 62481 24608 62482 24559 18...

result:

ok answer = 296054

Test #50:

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

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 67228 48058 67229 42559 100227 11492 1 133688 24212 3737 133689 100228 34988 32489 23986 90532 90503 67230 103061 90495 42560 48075 90498 6997 103048 100229 133690 42561 103002 2 100230 42562 24213 48046 67231 133691 100231 102998 90508 67232 100232 48042 100233 102987 133692 133693 100234 377...

result:

ok answer = 290604

Test #51:

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

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 8468 101943 92780 84995 106666 46405 101870 122556 40376 110820 6289 34793 31581 76276 136936 65497 38543 101981 33586 3667 38544 79206 88095 16369 81913 122432 82268 112834 52830 110821 113176 114269 131669 3461 22393 128136 148738 70573 116787 34853 136702 2107 71124 30732 134478 118336 1395...

result:

ok answer = 299989

Test #52:

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

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 132138 138005 83930 40870 140807 91657 48587 136844 130416 1631 44376 44970 130654 18424 144533 4774 135006 32749 80808 38132 76021 123928 10343 1583 136286 141839 75445 122203 110747 148611 118236 7966 117451 55816 39698 116439 41241 77998 91191 89023 79077 42227 117321 18320 107342 124757 20...

result:

ok answer = 299998

Test #53:

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

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:

42867 116112 74121 8882 143918 39878 96965 78726 41352 36975 124411 63633 33110 89104 110528 23770 112357 119782 49363 51845 67951 133410 12244 51818 135943 91511 112176 36969 77144 33050 15886 99266 20506 21820 102419 18268 136295 95430 53460 114918 247 121046 127175 72994 102189 96305 59886 5240 1...

result:

ok answer = 299999

Test #54:

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

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 62888 91150 66622 107208 3886 147577 124146 79150 84566 122002 112879 36324 24610 104892 1767 9825 10602 45513 67527 58175 25573 92799 149150 121961 22752 35501 91852 117784 6566 148361 59613 39440 18048 7721 38567 117675 138837 144226 125126 13657 25202 47558 137911 149846 47982 141975 6045 ...

result:

ok answer = 300000

Test #55:

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

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:

65114 45810 48788 117212 99027 111494 127954 99929 100083 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: 92ms
memory: 9984kb

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 116998 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: 99ms
memory: 9908kb

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: 105ms
memory: 9888kb

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

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: 75ms
memory: 9804kb

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:

1 62547 18956 62548 18930 62549 18946 62550 62551 18705 62552 62553 19030 62554 19331 62555 62556 62557 18706 62558 62559 62560 62561 62562 62563 62564 62565 62566 62567 18707 2 62568 20128 62569 19939 19905 19903 20016 62570 18708 62571 20287 20305 62572 20401 20360 62573 62574 18709 62575 3 62576 ...

result:

ok answer = 148740

Test #61:

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

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 24042 44971 3758 24480 6932 42761 103947 42216 3759 78433 100615 100616 78430 44942 103977 100617 100618 7017 45029 24481 103964 67456 133778 78426 24482 78425 23211 42632 42655 103868 42762 103880 103879 100619 42759 100620 103910 133779 42763 42764 42765 67457 78427 103971 10062...

result:

ok answer = 275741

Test #62:

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

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:

57082 140038 13189 148313 110487 115997 1111 144745 51181 87381 20972 135234 70043 75634 83323 106310 118303 54129 137447 135159 11522 134002 21855 143969 140039 64326 88504 92812 83467 49165 97031 73950 118998 131592 76287 6170 146507 131593 117195 93582 51584 2099 7807 140490 144321 140510 4508 11...

result:

ok answer = 299817

Test #63:

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

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 140294 57318 47172 6914 124243 43021 27303 102820 62002 28886 44962 105795 42927 136955 122786 63004 95124 89779 90019 68373 82061 144285 20701 17220 120405 142209 8193 140319 49731 53172 5025 118811 22626 99713 43915 26315 22498 122067 37585 14937 40165 55991 76312 62274 93784 120207 12525 8...

result:

ok answer = 299999

Test #64:

score: 0
Accepted
time: 97ms
memory: 9980kb

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:

38460 16962 90285 9719 125758 137972 70150 136924 123872 916 144317 62569 37762 86526 85594 55565 133552 73991 128850 16776 51755 97695 50663 30167 40793 2892 18214 62683 98530 115197 39216 114425 23926 82372 113627 85571 13772 101149 70484 12791 2964 100772 12779 42554 29061 40050 99653 57008 69428...

result:

ok answer = 300000

Test #65:

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

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 57651 8100 109520 57958 129651 1212 94880 54166 37564 101650 42304 144051 133570 113261 50123 116172 65387 53670 130345 58507 19631 30055 134589 132939 58731 19814 113068 136058 84894 105477 58034 42105 23184 10172 137932 121420 76198 12347 62765 126060 100478 131090 8866 132216 71117 102788 8...

result:

ok answer = 300000

Test #66:

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

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 115485 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 108947...

result:

ok answer = 300000

Test #67:

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

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: 95ms
memory: 9924kb

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: 109ms
memory: 9812kb

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

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: 54ms
memory: 9708kb

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:

18746 53703 62573 18747 62574 18748 62575 62576 18749 53702 62577 53701 1 62578 62579 53700 53699 53698 62580 53697 62581 53696 62582 62583 62584 53695 53694 18750 62585 18751 53693 62586 62587 62588 62589 53692 62590 53691 53675 18752 18753 53689 18754 62591 62592 53688 2 62593 62594 18755 53687 53...

result:

ok answer = 297533

Test #72:

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

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:

11443 5556 4601 11444 42257 67077 100155 67245 42258 29438 67190 66905 66906 106651 67340 66907 29177 66908 1 42259 29202 106647 106646 66909 133576 3696 66910 100156 48762 133577 66911 42260 42261 106641 42262 67344 67262 48490 100157 100158 66912 28316 47943 133578 100159 42263 66913 16567 28075 2...

result:

ok answer = 278039

Test #73:

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

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:

34769 4380 95012 13182 143526 85431 138538 45809 143583 17010 41746 143807 97377 51826 106631 56362 39863 148625 18936 28 2741 87454 45810 133495 43764 27729 6713 106787 135089 124195 46278 84567 65991 141872 48210 72620 6230 111728 146208 718 52258 110587 72675 110009 119550 54617 75628 106524 1348...

result:

ok answer = 299938

Test #74:

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

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 56805 114524 123861 47922 94622 133709 102938 92352 90939 67354 9747 75122 150 533 59196 9089 140955 127473 120606 54394 75571 112779 30263 22873 121877 145893 19847 16118 40684 24952 107242 133835 90230 48951 137450 51842 75085 10683 126745 30730 90469 102711 88798 29505 ...

result:

ok answer = 299996

Test #75:

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

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 42008 63122 19949 59743 25550 85700 37386 50762 25424 45558 58342 48013 149244 82914 58673 73375 147774 111744 17527 141373 9920 83217 131750 41517 41187 9278 1831 95280 74901 58240 69465 25319 145240 96399 46462 57113 139358 77675 27687 107008 112441 28547 92912 86461 25136 87739 112864...

result:

ok answer = 300000

Test #76:

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

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:

143698 145971 136448 119025 119252 25462 133756 94253 48557 142580 99591 24997 65808 40621 60806 10328 91108 68057 88685 52698 83636 85208 83788 95496 121351 66258 6679 86969 135482 65089 70900 148807 50507 16263 140267 41320 57829 90468 35856 145412 82611 128906 37473 1406 141872 129607 121065 8846...

result:

ok answer = 300000

Test #77:

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

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 26603 139727 109488 34985 137219 96005 105709 5841 109599 73433 125565 63115 106955 124621 3286 32232 97780 102018 101373 127543 134422 90315 23989 34096 125079 119312 18874 80157 77326 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: 100ms
memory: 9988kb

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: 90ms
memory: 9944kb

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: 108ms
memory: 9992kb

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: 43ms
memory: 10256kb

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: 0
Accepted
time: 56ms
memory: 9836kb

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 18757 0 0 0 0 18758 0 0 18759 0 0 0 0 0 0 18760 0 0 0 0 0 0 0 18761 0 0 18762 0 0 18763 0 18764 0 1 0 0 18765 0 0 0 0 0 0 0 0 0 0 18766 18767 0 0 18768 0 0 18769 0 18770 18771 0 0 0 0 18772 18773 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 3 0 0 0 0 18774 0 0 0 0 0 0 0 0 18775 0 0 0 18776 0 0 ...

result:

ok answer = 48024

Test #83:

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

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:

100149 13440 11509 11510 0 0 11511 44389 33019 0 100150 100151 0 100152 100153 0 24231 0 0 5138 100154 45551 0 0 1 11512 0 0 45212 24232 67288 100155 67700 37648 43265 0 0 24233 32057 45100 0 67421 100156 100157 0 0 24234 33603 67289 100158 0 67290 67291 67411 0 67292 13280 0 67426 67348 0 0 0 0 100...

result:

ok answer = 209982

Test #84:

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

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 43753 33186 20322 15340 0 10857 0 0 0 0 0 34844 14840 8283 0 0 14841 42573 0 19434 0 0 0 0 0 0 0 0 0 28464 0 0 22066 36049 0 26329 26833 0 0 7568 0 0 0 10529 0 22953 0 0 43354 0 6884 0 0 0 0 0 0 0 0 0 0 27823 26330 0 9996 0 37770 0 44617 0 36050 12730 0 0 23425 1967 0 0 0 0 0 0 12731 0 0 26528 234...

result:

ok answer = 94122

Test #85:

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

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:

13440 22802 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 919 0 0 0 0 0 0 0 0 0 0 68 0 0 0 0 0 0 0 0 0 0 0 2207 22805 0 0 0 0 0 0 0 0 0 0 0 0 6242 0 0 0 0 0 0 0 8385 0 0 23528 393 23005 0 18810 0 7056 0 23674 0 0 0 0 0 0 0 7830 0 0 0 0 0 0 0 0 21644 0 17681 0 0 0 0 0 0 0 0 0 8903 0 0 0 0 15727 0 0...

result:

ok answer = 48086

Test #86:

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

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:

20612 38436 0 29882 0 22801 0 0 0 30677 9086 0 0 0 0 29792 0 13771 0 0 0 0 0 0 0 0 0 22325 0 29275 0 0 0 31186 0 20337 0 0 0 28200 38145 20222 0 11885 0 0 0 10574 0 0 0 0 0 35357 0 10919 0 38108 14956 19767 0 0 0 16979 0 29818 0 0 36079 0 0 12925 0 0 0 0 0 0 0 25364 0 0 0 3847 0 12173 0 0 0 0 0 0 0 ...

result:

ok answer = 78394

Test #87:

score: 0
Accepted
time: 91ms
memory: 9812kb

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 8168 0 0 0 0 2096 2400 0 0 0 0 0 0 0 0 4303 0 0 0 0 0 0 0 0 0 0 0 0 0 6754 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6707 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10203 0 0 0 1330 0 0 3435 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3612 0 0 0 0 0 0 0 0 0 2215 0 0 0 0 0 0 0 ...

result:

ok answer = 24016

Test #88:

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

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 24783 0 0 0 0 29850 0 0 0 0 0 39469 34693 0 50886 13753 0 0 0 25960 23850 0 0 0 36158 0 9865 0 25373 28722 45913 0 0 0 0 0 0 0 0 0 19091 0 0 39038 0 0 7321 0 35578 0 0 19728 0 0 0 43244 0 0 14500 44630 0 0 0 31998 0 0 0 0 0 33473 0 6047 0 41959 0 0 0 0 0 0 0 0 0 0 0 5577 0 0 0 0 0 0 9358 6248 ...

result:

ok answer = 103886

Test #89:

score: 0
Accepted
time: 91ms
memory: 9988kb

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:

66765 1909 42325 25988 9946 0 89579 0 0 50385 65461 76305 3386 17296 0 0 10130 86989 0 30784 84888 66577 46878 79269 37057 45526 10226 8538 59203 0 72410 0 60723 84883 0 70446 11364 16380 60801 54694 57438 0 87168 0 77029 35829 0 87892 0 0 78604 84487 0 0 0 0 0 60120 0 27122 53370 31650 0 9642 0 312...

result:

ok answer = 184372

Test #90:

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

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 1755 0 0 0 0 0 0 0 0 0 0 1786 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3355 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4340 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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: 99ms
memory: 9816kb

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:

29542 0 6899 7975 0 0 0 0 3237 0 0 0 0 0 0 18537 27865 31367 27278 0 35939 0 0 0 40298 24240 0 16088 0 0 0 0 0 0 26559 0 0 0 0 0 0 0 0 0 1895 0 0 0 0 0 0 0 35503 0 0 0 8289 0 0 25663 17237 0 0 0 0 0 0 0 0 21189 0 0 0 40749 1966 0 0 0 5795 0 43706 0 13375 42873 0 0 27046 0 0 0 0 0 0 18575 0 0 0 0 0 1...

result:

ok answer = 90686

Test #92:

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

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: 51ms
memory: 9236kb

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 #94:

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

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 #95:

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

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 #96:

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

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 #97:

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

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 #98:

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

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 #99:

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

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 #100:

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

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 #101:

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

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 #102:

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

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 #103:

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

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 #104:

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

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 #105:

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

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 #106:

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

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: 46ms
memory: 11368kb

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: 50ms
memory: 11420kb

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: 55ms
memory: 11396kb

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: 55ms
memory: 11296kb

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: 56ms
memory: 11296kb

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

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

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: 51ms
memory: 11496kb

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

Test #115:

score: 0
Accepted
time: 32ms
memory: 10404kb

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

Test #116:

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

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:

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

result:

ok answer = 299999

Test #117:

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

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:

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

result:

ok answer = 300000

Test #118:

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

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:

99109 100378 42042 88646 60163 133357 88648 101600 24030 100113 101597 100114 11500 88656 42043 88659 100115 24031 59950 24032 101591 11501 133358 3729 60836 66832 88620 66833 101625 24033 133359 11502 40375 40376 11503 3730 1 101624 100116 88625 60700 101619 40377 66834 66835 88633 42044 101615 403...

result:

ok answer = 285014

Test #119:

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

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:

67420 100575 67689 54112 54101 105462 133843 11718 105461 133844 54045 54039 67709 54073 24425 35200 133845 11719 1 42319 24969 100576 35375 42320 100577 105407 68504 24426 54167 105545 3730 42321 105543 133846 11720 133847 24427 105594 68338 133848 2 36228 42322 54183 133849 68704 54132 23961 68567...

result:

ok answer = 294859

Test #120:

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

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:

1 67324 42327 67828 133690 42328 67325 67823 67326 100756 42329 67818 11610 100668 100685 3735 11611 100682 42330 100748 24028 29286 101085 24142 67544 1961 133691 133692 11612 100399 42331 100903 100400 24143 133693 67327 13751 29552 11613 24144 68270 68357 133694 133695 100778 3736 67966 11614 673...

result:

ok answer = 290984

Test #121:

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

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:

32114 67318 1 42377 67319 67320 133719 95796 133720 32110 100513 67321 101101 2 100514 95865 101123 56741 133721 133722 11472 24243 133723 100515 100516 11473 100517 100518 100519 95835 101247 3641 42378 100520 133724 11474 67322 32105 32159 15262 3908 100521 100522 95626 3642 24244 133725 56735 133...

result:

ok answer = 286318