QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#513151#1173. Knowledge Is...GuanYunchangAC ✓101ms13752kbC++20953b2024-08-10 17:04:252024-08-10 17:04:29

详细

Test #1:

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

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

input:

2 2
1 2
3 4

output:

1 1 

result:

ok answer = 2

Test #3:

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

input:

2 1
1 2
2 3

output:

1 0 

result:

ok answer = 1

Test #4:

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

input:

1 1
4 26

output:

1 

result:

ok answer = 1

Test #5:

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

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 1 119 2 39 40 120 1 3 121 122 41 42 43 40 123 124 125 44 45 41 46 4 5 126 127 128 129 6 130 47 42 7 8 48 43 131 132 44 45 133 9 134 46 2 135 49 47 136 48 50 51 52 49 10 53 11 137 3 4 12 13 54 138 14 50 139 140 141 15 51 142 55 143 144 52 56 145 146 57 58 147 5 6 7 59 16 148 149 60 150 151 152 61 ...

result:

ok answer = 376

Test #6:

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

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 167 231 141 168 64 167 45 70 111 168 169 71 232 170 142 233 143 234 5 171 1 235 6 172 19 169 236 144 237 238 115 7 65 72 66 21 73 170 116 145 67 74 117 173 8 118 171 239 22 240 9 146 23 172 241 32 119 10 46 147 24 120 242 75 2 119 174 0 173 76 112 0 113 120 174 175 176 121 0 177 178 175 179 176 ...

result:

ok answer = 471

Test #7:

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

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:

61 152 97 221 118 178 193 95 131 78 250 180 109 135 2 144 243 212 164 201 107 191 197 35 225 61 172 234 64 109 41 181 244 169 188 158 48 202 115 178 170 39 40 56 234 33 50 218 228 38 60 75 125 151 93 79 235 113 245 188 39 166 132 5 162 46 216 135 221 16 168 55 125 236 36 159 10 232 190 92 148 29 199...

result:

ok answer = 500

Test #8:

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

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 68 16 90 9 80 36 243 110 225 206 116 209 202 72 189 60 196 109 244 1 211 127 155 98 225 50 228 40 43 160 136 170 17 122 21 239 57 183 169 84 52 204 42 75 27 201 125 83 178 156 194 86 34 135 214 158 4 104 36 192 93 15 159 134 133 11 157 113 111 51 217 37 47 52 107 149 179 24 150 1...

result:

ok answer = 500

Test #9:

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

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

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

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

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

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

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

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

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 33 34 35 107 108 36 37 38 109 39 1 2 3 33 110 4 1 40 41 42 111 43 44 45 5 6 34 112 2 46 35 113 114 115 36 116 47 3 7 48 37 117 118 8 49 119 50 51 9 120 121 52 122 38 123 53 124 54 125 55 56 57 39 4 126 40 127 128 41 129 130 42 58 59 131 132 43 60 44 10 11 61 45 62 133 134 63 135 46 5 6 47 64...

result:

ok answer = 483

Test #17:

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

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 64 1 223 64 152 131 65 10 1 159 107 153 107 224 26 43 154 155 66 225 85 108 156 160 65 161 67 109 2 44 162 66 157 108 86 163 226 227 68 36 45 228 229 164 165 166 67 167 158 168 87 230 88 68 159 169 27 170 171 69 109 172 69 110 160 11 173 3 70 28 2 47 161 46 71 72 111 132 112 37 89 56 57 133 231 ...

result:

ok answer = 494

Test #18:

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

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:

54 171 117 98 58 18 34 38 140 62 221 123 74 65 56 243 234 138 249 73 183 207 126 167 86 86 17 127 82 231 180 60 145 217 122 82 129 197 27 118 241 239 147 22 42 85 77 52 80 177 245 39 51 88 172 198 233 31 122 70 143 223 139 108 221 83 61 158 196 66 202 93 180 222 103 244 28 69 191 137 220 203 109 199...

result:

ok answer = 500

Test #19:

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

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 178 206 241 109 212 37 28 91 115 32 65 99 143 192 230 44 27 21 125 52 106 4 203 235 121 226 60 83 78 250 225 221 66 125 197 187 20 73 222 84 130 59 36 24 49 137 70 7 132 155 81 19 114 140 6 184 117 207 48 97 126 120 245 188 129 64 208 248 229 172 214 218 170 65 239 69 194 16 12 237 41 100 15 38 ...

result:

ok answer = 500

Test #20:

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

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 91 24 175 227 22 206 44 63 155 15 37 211 245 32 228 246 203 5 117 190 81 174 136 132 216 173 11 85 142 118 98 51 202 83 73 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: 0ms
memory: 3508kb

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

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

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

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

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

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

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 31 32 1 107 108 33 34 31 109 35 110 111 112 113 32 36 37 114 115 33 116 34 117 118 38 35 1 119 2 39 120 40 41 36 121 122 123 37 42 124 38 125 126 43 3 127 44 39 45 46 4 40 47 128 129 48 130 41 42 131 132 133 49 43 134 50 135 2 136 137 51 44 138 45 5 46 139 52 140 141 142 6 53 54 55 56 57 7 58 8 ...

result:

ok answer = 500

Test #28:

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

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:

40 68 69 26 105 9 106 150 151 152 153 154 36 204 205 107 206 207 150 155 208 10 209 156 210 130 151 22 211 37 157 108 158 212 213 214 159 215 216 217 152 160 218 219 68 161 70 109 153 162 163 23 85 220 164 221 5 4 154 155 165 156 69 38 27 222 39 71 72 157 131 73 166 158 223 28 74 159 109 160 224 110...

result:

ok answer = 500

Test #29:

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

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 195 22 245 238 108 219 54 84 246 206 87 248 100 91 39 195 181 29 199 233 40 27 1 151 231 205 214 208 55 92 137 237 45 127 219 93 11 154 173 224 113 101 37 166 247 51 177 70 2 53 71 134 201 52 248 18 152 37 155 120 140 73 114 70 167 102 215 115 106 25 164 179 155 138 10 103 168 223 225 197 177 33...

result:

ok answer = 500

Test #30:

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

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 82 94 66 145 150 1 232 159 238 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 222 164 52 73 149 194 130 204 79 25 41 122 129 214 182 148 68 144 98 14 64 113 95 94 57 78 121 206 170 140 27 43 219 59 43 112 11 83 213 5 222 158 ...

result:

ok answer = 500

Test #31:

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

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

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

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

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

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

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

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: 65ms
memory: 10428kb

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 18688 18689 62465 18690 18691 62466 18692 1 18693 62467 62468 62469 62470 18694 18695 18690 18696 18697 62471 18698 18691 62472 62473 18692 62474 62475 18699 62476 2 62477 18693 18700 18701 18702 62478 62479 62480 18703 62481 3 62482 62483 18694 18695 62484 62485 62...

result:

ok answer = 230231

Test #39:

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

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 67167 100531 24189 100532 67168 133729 1 53408 100533 100265 67169 100266 83805 11558 100534 24190 30982 100267 133730 42239 67170 67168 100535 133731 42240 133732 53409 40799 42241 67171 133733 42242 42243 133734 8409 67172 13013 100536 11559 42244 133735 83806 83807 64583 100537 83808 100538...

result:

ok answer = 292561

Test #40:

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

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 108095 38866 78550 66214 72581 50925 118116 72582 64469 148394 131152 7609 5537 131153 131154 50582 140182 56914 147614 78551 75484 12776 63178 25506 123323 26920 20668 45721 48625 146746 115447 18168 131155 103967 54671 112392 54672 126407 37718 118390 127027 101456 84425 31577 97244 7...

result:

ok answer = 299930

Test #41:

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

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:

41829 139866 9568 64506 90666 131776 53935 34220 137535 144684 34651 73988 95341 33103 3299 130943 144790 52979 97238 96310 17030 126668 11206 34652 110774 72229 63189 35776 96209 113462 149546 46140 123921 46389 48273 61139 33763 144759 147710 88285 123666 59747 119702 25625 16444 138865 64188 3540...

result:

ok answer = 300000

Test #42:

score: 0
Accepted
time: 94ms
memory: 10520kb

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 145921 128070 53244 128581 92855 43053 29486 27254 29560 77809 56007 104575 29027 18046 38519 32394 6884 72147 119563 41534 101597 133115 104735 33267 45810 47619 113047 98146 32283 77039 74024 139262 31521 54226 81886 56805 120259 55034 120799 35547 78469 62619 72080 139798 14686 35724 37743 ...

result:

ok answer = 300000

Test #43:

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

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 82404 630 140098 36986 28821 35942 93256 24505 31715 79957 138751 47688 77181 43926 80355 5099 52559 72633 20547 86862 19103 55780 12581 147800 59390 148127 17074 82933 74339 19581 70613 59019 114741 213 43798 72262 106361 75808 18421 15654 127057 63415 86452 53299 59098 101824 1487...

result:

ok answer = 300000

Test #44:

score: 0
Accepted
time: 95ms
memory: 10376kb

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 24842 19086 86743 42510 114546 124513 103312 24744 10732 82337 86294 59628 34493 67070 82513 21398 79494 80635 145598 134367 31462 91002 149919 4476 90701 2689 85365 124448 15027 25585 29841 148321 29552 17980 104447 41356 122792 90398...

result:

ok answer = 300000

Test #45:

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

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 98137 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: 93ms
memory: 10432kb

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: 100ms
memory: 10344kb

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: 57ms
memory: 12436kb

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: 66ms
memory: 10520kb

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:

1 62454 18741 62455 18742 62456 1 2 18741 62457 18742 62458 2 62459 62460 62461 18743 18744 18743 18744 62462 18745 18746 62463 18747 62464 18745 62465 62466 62467 3 62468 62469 18746 62470 62471 62472 62473 18747 18748 62474 18748 62475 4 62476 18749 18749 62477 18750 5 18751 18750 6 62478 18751 62...

result:

ok answer = 296054

Test #50:

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

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:

40988 67228 53689 67229 42559 100227 11492 1 133688 24212 3737 133689 100228 40989 31023 12722 83931 83932 67230 100227 67228 42560 53690 83933 8296 100228 100229 133690 42561 100229 2 100230 42562 24213 53691 67231 133691 100231 100230 67229 67232 100232 53692 100233 100231 133692 133693 100234 829...

result:

ok answer = 290604

Test #51:

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

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:

25874 8468 85297 92780 84523 106666 46405 101870 123529 40376 110820 6289 33694 31579 76276 47940 75194 38543 102065 98072 3601 38544 79206 88095 139748 81873 122432 82268 112834 52830 110821 114148 114269 74406 3440 22393 100279 148307 70573 116787 102236 135448 2107 98196 31032 80149 118336 13959 ...

result:

ok answer = 299989

Test #52:

score: 0
Accepted
time: 94ms
memory: 10444kb

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:

58129 132138 137956 83930 40946 98211 91657 48587 136844 130416 1631 44376 44970 130654 18424 144533 4774 135006 32751 101362 38132 75981 123928 10348 1546 136286 141849 75445 34751 110747 148586 118231 7971 33835 93390 39698 116439 41241 116066 91191 88985 79153 35649 117363 18320 107287 124783 209...

result:

ok answer = 299998

Test #53:

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

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 116120 74121 8885 82812 39878 63962 78726 41352 36975 124411 63655 33110 45487 110545 56403 68908 119779 49363 50823 67971 133410 12244 51829 135943 91511 112176 36966 77160 84471 15886 87333 20506 21820 102419 18212 136284 76564 136444 114912 247 70366 127175 72994 102190 96305 131641 5238 14...

result:

ok answer = 299999

Test #54:

score: 0
Accepted
time: 85ms
memory: 10436kb

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 141516 66624 107211 3886 9691 21778 79150 84566 122002 112879 36324 24610 104892 1767 9825 10602 45717 46308 58175 145317 92799 149150 121961 22754 35508 91852 117784 6584 148362 59376 39440 18048 7727 38567 117675 138837 144226 103649 13657 25204 124851 137912 149846 47982 48096 6045 1...

result:

ok answer = 300000

Test #55:

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

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 48787 117212 99027 111494 127954 99929 100083 1077 63872 25328 111707 49180 55815 51017 113357 98762 11348 31828 149955 120448 139831 956 4339 106864 85057 136082 26172 6727 106812 137530 27384 11165 26107 68426 45459 114005 19519 113022 40438 91800 940 141550 59490 84455 88552 45665 664...

result:

ok answer = 300000

Test #56:

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

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 621 147631 128887 62096 47700 100738 51...

result:

ok answer = 300000

Test #57:

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

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: 96ms
memory: 10368kb

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

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: 68ms
memory: 10452kb

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 18705 62548 18706 62549 18707 62550 1 18705 62551 62552 18708 62553 18709 62554 62555 62556 18706 62557 62558 2 62559 62560 3 62561 62562 62563 62564 18707 2 62565 18710 62566 18711 18712 18713 18714 4 18708 62567 18715 18716 62568 18717 18718 5 62569 18709 6 3 7 62570 62571 62572 18719 1872...

result:

ok answer = 148740

Test #61:

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

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:

53931 53932 100615 12672 65035 3758 24480 7820 42761 100616 41153 3759 67456 100615 100616 84165 65036 100617 100617 100618 7821 65037 24481 100618 67456 133778 84166 24482 84167 12673 31103 31104 100619 42762 100620 100621 100619 41154 100620 100622 133779 42763 42764 42765 67457 84168 100623 10062...

result:

ok answer = 275741

Test #62:

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

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 13095 148313 110487 115606 1111 143542 127714 87381 21539 73769 71396 75634 83882 106310 118303 103399 137212 135121 11049 134662 20906 14665 140039 63687 89487 94079 83711 110573 97031 74908 49235 131592 148336 6170 146248 131593 117218 93965 50551 1910 7570 141411 144321 141167 4665 7...

result:

ok answer = 299817

Test #63:

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

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:

107252 140294 57318 46984 6908 124243 43014 27320 54001 62002 28973 44962 105812 42927 136880 122786 95507 95124 102665 64109 68373 82061 144285 123280 137514 43680 142209 8193 86668 49731 53172 5001 118811 22626 99713 43915 26315 22525 59044 37585 14851 40165 56085 76431 62274 93784 120228 12400 81...

result:

ok answer = 299999

Test #64:

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

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:

54870 16962 56685 9719 101046 137972 81563 136925 123872 913 144314 62569 37762 127768 85594 55493 133551 69362 128850 16661 51790 97695 50663 30167 110714 2889 18575 62688 98530 115196 39216 114425 35020 57332 113627 113636 13772 101149 115669 12791 2966 100772 12783 95977 29061 127318 99655 142323...

result:

ok answer = 300000

Test #65:

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

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:

31526 57651 8100 109520 57959 129652 1212 94880 54166 37564 101650 42304 144051 77240 113261 50123 84947 65387 53671 130344 58507 19631 30054 92858 132940 58731 19814 113068 136058 84894 105477 58034 42107 23184 10172 137932 121420 76198 12347 62765 126060 125762 131089 8865 75398 71117 102787 84586...

result:

ok answer = 300000

Test #66:

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

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 25193 13931 77337 126095 111086 82796 13429 2659 116936 115485 66558 139767 117072 145420 5057 34236 46171 75890 142043 146585 106926 87963 18772 125761 2438 46154 74386 42554 92941 127825 123057 73492 54203 119577 115540 107829 116677 30621 108947 5...

result:

ok answer = 300000

Test #67:

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

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 112011 47569 11...

result:

ok answer = 300000

Test #68:

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

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: 96ms
memory: 10368kb

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

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

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 18746 62573 18747 62574 18748 62575 62576 18749 18747 62577 18748 1 62578 1 18749 18750 18751 62579 18752 62580 18753 62581 62582 62583 18754 18755 18750 62584 18751 18756 62585 62586 62587 62588 18757 62589 18758 18759 18752 18753 18760 18754 62590 2 18761 2 3 62591 18755 18762 18763 62592 4 ...

result:

ok answer = 297533

Test #72:

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

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 7938 7939 11444 42257 66905 100155 83619 42258 31282 66906 66905 66906 100155 83620 66907 31283 66908 1 42259 41077 100156 100157 66909 133576 3696 66910 100156 53281 1 66911 42260 42261 100158 42262 83621 83622 53282 100157 100158 66912 41078 64406 133577 100159 42263 66913 12239 31284 24146 ...

result:

ok answer = 278039

Test #73:

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

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:

103996 4053 95012 13560 143526 86236 14770 45809 22621 17010 42273 143807 97377 52108 107442 143225 39863 148335 18555 28 2706 89221 45810 134923 43764 120065 6315 106928 135089 30973 46158 83460 35830 95665 49679 72611 6230 111536 53818 819 52258 110587 72675 110009 118789 54617 75628 108213 133655...

result:

ok answer = 299938

Test #74:

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

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:

124850 46715 103131 138497 143710 114533 123835 88181 122569 133792 103021 77182 90939 67354 9695 107673 150 537 59196 9064 140955 127551 120705 54394 91571 112793 30263 22922 121877 145893 19847 132438 40684 24952 107242 70835 90230 48951 137533 51842 75085 10709 126745 29498 90369 102711 88798 295...

result:

ok answer = 299996

Test #75:

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

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:

24119 16016 42008 63120 91175 140906 25515 68343 37386 93345 25424 45558 58342 42002 149255 82914 107526 73375 147774 111744 17312 141373 9920 69931 131750 41517 40958 9278 1833 95300 74902 100525 69465 25319 113887 96399 46484 57113 21987 77675 132934 107008 65894 28547 92912 86461 25136 87736 1128...

result:

ok answer = 300000

Test #76:

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

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 35850 48557 142580 99591 24997 65808 40620 42872 98432 91108 68060 88686 105001 83636 85208 83788 95496 121351 66260 6678 53430 135483 65089 70900 73372 50509 16263 140267 41320 57829 124130 35856 16187 82611 128906 37473 1406 141872 129607 121065 8846...

result:

ok answer = 300000

Test #77:

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

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 96006 105709 5841 109599 73433 125565 63115 134401 124621 3286 32232 97780 102018 101373 127543 134422 103018 23989 34096 125079 119312 18874 80157 77326 65541 69430 35132 60297 45428 147494 6127 70151 22474 94191 121947 136532 114861 134758 94588 35597 106616 ...

result:

ok answer = 300000

Test #78:

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

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

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 40819 9965 18637 8262 75044 24468 109813 45229 ...

result:

ok answer = 300000

Test #80:

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

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

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: 63ms
memory: 9876kb

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:

18757 18758 18757 18759 0 0 0 18758 18760 0 18759 0 0 0 0 18761 18762 18760 18763 0 0 1 0 2 0 18761 0 0 18762 0 0 18763 0 18764 18764 1 0 0 18765 18765 18766 0 0 0 0 0 0 0 0 18766 18767 3 18767 18768 0 18768 18769 0 18770 18771 4 18769 5 0 18772 18773 6 0 0 0 18770 18771 7 18772 0 18773 18774 0 8 2 ...

result:

ok answer = 48024

Test #83:

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

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 12790 11509 11510 0 0 11511 53459 40693 1 100150 100151 100149 100152 100153 0 24231 2 0 7689 100154 64676 0 3 1 11512 100150 0 53460 24232 67288 100155 84132 40694 64677 100151 100152 24233 30835 64678 100153 67288 100156 100157 0 100154 24234 30836 67289 100158 0 67290 67291 67289 0 67292 1...

result:

ok answer = 209982

Test #84:

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

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 33955 20498 15306 0 10857 0 0 0 0 0 35154 14840 8283 0 0 14841 0 0 19434 0 0 0 0 0 0 0 0 0 0 0 0 22066 36049 0 26329 0 0 0 7568 0 0 0 10025 0 23261 39093 0 41814 0 6884 0 0 0 0 0 0 0 0 0 0 27823 26330 0 9996 0 0 0 44370 0 36050 12730 0 0 23425 2194 42867 0 0 0 0 0 12731 0 0 0 23426 0 39552 1...

result:

ok answer = 94122

Test #85:

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

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:

13444 22810 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 980 0 0 0 0 0 0 0 0 0 0 67 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 6243 0 0 0 0 0 0 0 8405 0 0 0 393 23024 0 19032 0 6996 0 23674 0 0 0 0 0 0 0 7830 0 0 0 0 0 0 0 0 21702 0 0 0 0 0 0 0 0 0 0 0 8961 0 0 0 0 0 0 0 0 2647 2132...

result:

ok answer = 48086

Test #86:

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

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:

20614 38436 0 29808 0 22801 0 0 0 30677 9081 0 20448 0 0 29798 0 13784 0 0 0 0 0 0 0 0 0 22324 0 29275 0 0 0 0 0 20337 0 0 0 0 38145 20222 0 11885 0 0 0 10570 0 0 0 0 0 35351 0 11378 0 38108 14872 19771 0 0 0 16979 0 29818 0 0 36075 0 0 12925 0 0 0 0 14919 0 0 25364 0 0 0 3852 0 12173 0 0 0 0 0 0 0 ...

result:

ok answer = 78394

Test #87:

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

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 6751 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: 76ms
memory: 9032kb

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 0 34693 0 50895 13753 0 0 0 25960 23850 0 0 0 36158 0 9865 0 25373 0 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 44631 0 29822 0 31998 0 0 0 0 0 33473 0 6047 0 41959 0 0 49037 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: 87ms
memory: 9368kb

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 56317 89579 59157 0 50385 0 76305 3386 17296 0 12092 10130 86989 79965 30784 84888 0 46878 79269 37057 45526 10226 8538 59203 44838 0 0 60723 0 47123 70446 11364 16380 60801 54694 57438 0 0 43063 77029 35829 72368 87892 0 35944 78604 84487 0 0 0 0 0 60120 62895 0 53370 31...

result:

ok answer = 184372

Test #90:

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

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: 79ms
memory: 9100kb

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 0 17237 0 0 0 0 0 0 24485 0 21189 0 0 0 40749 1966 0 0 0 5795 0 0 0 13375 0 0 0 27046 0 0 0 0 0 0 18575 0 0 0 0 0 15994 0 1...

result:

ok answer = 90686

Test #92:

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

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: 45ms
memory: 9960kb

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: 57ms
memory: 9872kb

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

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: 44ms
memory: 9928kb

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

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: 53ms
memory: 10020kb

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

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: 48ms
memory: 10284kb

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

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

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

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

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: 52ms
memory: 10644kb

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

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: 42ms
memory: 12092kb

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: 39ms
memory: 11968kb

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

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

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: 48ms
memory: 11968kb

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: 52ms
memory: 11972kb

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: 44ms
memory: 12112kb

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

input:

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

output:

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

result:

ok answer = 299999

Test #115:

score: 0
Accepted
time: 37ms
memory: 13480kb

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: 57ms
memory: 11984kb

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: 57ms
memory: 12088kb

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: 78ms
memory: 10844kb

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:

83559 100113 42042 83560 64205 133357 66832 100114 24030 100113 100115 100114 11500 66833 42043 66834 100115 24031 64206 24032 100116 11501 133358 3729 64207 66832 83561 66833 100117 24033 133359 11502 30956 30957 11503 3730 1 100118 100116 83562 64208 100119 30958 66834 66835 83563 42044 100120 309...

result:

ok answer = 285014

Test #119:

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

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:

84045 100575 84046 53587 64730 100575 1 11718 100576 133843 64731 64732 67323 53588 24425 31456 2 11719 1 42319 40973 100576 40974 42320 100577 100577 67324 24426 64733 100578 3730 42321 100579 133844 11720 133845 24427 100580 84047 3 2 40975 42322 53589 133846 67325 53590 12893 67326 84048 3731 647...

result:

ok answer = 294859

Test #120:

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

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 67324 133690 42328 67325 67325 67326 100396 42329 83922 11610 100397 100398 3735 11611 100399 42330 100400 13302 31047 100401 24142 67326 1 133691 133692 11612 100399 42331 100402 100400 24143 133693 67327 13303 40739 11613 24144 67327 67328 133694 133695 100403 3736 67329 11614 67328 ...

result:

ok answer = 290984

Test #121:

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

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:

31315 67318 1 42377 67319 67320 1 83869 133719 31316 100513 67321 100513 2 100514 83870 100514 64584 133720 2 11472 24243 133721 100515 100516 11473 100517 100518 100519 83871 100515 3641 42378 100520 133722 11474 67322 31317 31318 12820 7749 100521 100522 67318 3642 24244 133723 64585 133724 12821 ...

result:

ok answer = 286318