QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#282258#1173. Knowledge Is..._LAP_AC ✓231ms76040kbC++141.8kb2023-12-11 16:58:292023-12-11 16:58:30

Judging History

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

  • [2023-12-11 16:58:30]
  • 评测
  • 测评结果:AC
  • 用时:231ms
  • 内存:76040kb
  • [2023-12-11 16:58:29]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

const int N = 1e6 + 10;
int n, m, ans[N]; pair<int, int> A[N];
vector<int> vec[N], lsh;
vector<int> C[N];

int main() {
    ios::sync_with_stdio(false), cin.tie(0);

    cin >> n >> m;
    for(int i = 1; i <= n; i ++) {
        int l, r; cin >> l >> r;
        A[i] = {l, r};
        lsh.emplace_back(l), lsh.emplace_back(r);
    }
    sort(lsh.begin(), lsh.end()), lsh.erase(unique(lsh.begin(), lsh.end()), lsh.end());
    for(int i = 1; i <= n; i ++) {
        A[i].first = lower_bound(lsh.begin(), lsh.end(), A[i].first) - lsh.begin() + 1;
        A[i].second = lower_bound(lsh.begin(), lsh.end(), A[i].second) - lsh.begin() + 1;
        vec[A[i].first].emplace_back(i);
    }

    vector<int> single;
    int tot = 0; priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>> Q;
    for(int i = 1; i <= 2 * n; i ++) {
        for(auto id : vec[i]) {
            int r = A[id].second;
            if(!single.empty()) {
                int u = single.back(); single.pop_back();
                ans[u] = ++tot; ans[id] = ans[u];
                Q.push({r, id});
            } else if(!Q.empty() && Q.top().first < r) {
                int u = Q.top().second; Q.pop();
                swap(ans[u], ans[id]); Q.push({r, id});
                if(A[u].second < i) single.emplace_back(u);
                else C[A[u].second].emplace_back(u);
            } else C[r].emplace_back(id);
        }
        while(!C[i].empty()) single.emplace_back(C[i].back()), C[i].pop_back();
    }
    while(tot < m && !single.empty()) ans[single.back()] = ++tot, single.pop_back();
    for(int i = 1; i <= n; i ++)
        if(ans[i] <= m) cout << ans[i] << ' ';
        else cout << "0" << ' ';
    cout << '\n';

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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: 4ms
memory: 53756kb

input:

2 2
1 2
3 4

output:

1 1 

result:

ok answer = 2

Test #3:

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

input:

2 1
1 2
2 3

output:

0 1 

result:

ok answer = 1

Test #4:

score: 0
Accepted
time: 4ms
memory: 54152kb

input:

1 1
4 26

output:

1 

result:

ok answer = 1

Test #5:

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

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 0 2 39 40 248 1 3 156 157 41 42 43 71 249 250 251 44 45 72 46 4 5 119 252 158 120 6 0 47 73 8 9 48 74 121 122 75 76 0 11 0 40 2 123 49 77 0 41 50 51 52 42 13 53 14 124 3 4 15 16 54 0 18 78 159 0 160 19 79 125 55 0 0 43 56 0 126 57 58 253 5 6 7 59 21 0 0 60 161 0 0 61 25 0 0 127 0 62 28 8 0 0 16...

result:

ok answer = 376

Test #6:

score: 0
Accepted
time: 4ms
memory: 54092kb

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:

0 167 0 116 168 45 186 66 80 70 177 167 70 0 214 117 0 119 0 13 201 2 0 5 202 7 169 0 121 240 0 131 14 48 93 49 34 94 170 146 122 50 108 147 216 6 140 171 9 27 123 7 124 35 172 10 26 125 8 45 126 36 127 0 95 1 154 218 0 173 81 74 11 75 132 174 203 178 124 0 219 220 175 187 176 128 115 78 53 13 102 5...

result:

ok answer = 471

Test #7:

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

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 141 78 217 118 172 191 93 128 77 250 177 109 223 2 141 243 207 161 200 184 191 195 35 224 60 168 233 59 109 41 178 244 161 187 60 47 201 112 177 162 52 42 55 234 33 51 218 228 40 61 192 127 148 95 74 235 113 245 187 38 162 129 5 91 67 216 153 217 20 167 56 138 236 35 157 10 230 188 87 143 27 198 ...

result:

ok answer = 500

Test #8:

score: 0
Accepted
time: 4ms
memory: 53876kb

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 25 246 4 19 66 16 90 9 81 33 243 110 225 206 116 209 202 74 189 221 196 149 244 1 211 128 155 99 225 50 228 40 43 158 135 170 17 122 20 239 56 185 169 84 52 109 247 75 27 121 119 87 178 157 194 87 37 132 214 160 4 102 36 192 92 15 159 133 130 13 157 113 111 49 217 34 45 52 107 204 181 24 150...

result:

ok answer = 500

Test #9:

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

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 83 141 232 137 218 15 9 29 183 111 25 27 24 186 161 239 166 33 228 11 59 237 154 82 72 150 102 142 47 162 61 160 44 39 98 1 203 40 225 78 130 113 181 97 27 227 213 117 70 229 72 121 18 200 239 52 7 169 96 201 66 131 187 45 217 8 193 207 150 48 167 22 55 38 16 75 107 172 223 68 118 134 119...

result:

ok answer = 500

Test #10:

score: 0
Accepted
time: 4ms
memory: 54492kb

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 119 62 157 13 185 54 246 132 130 250 244 1 181 11 25 248 118 144 27 34 127 121 85 205 240 82 10 228 58 206 67 60 131 141 166 17 137 97 154 53 243 28 111 33 231 4 101 214 192 55 14 21 213 91 175 108 63 212 232 103 89 43 215 250 97 99 173 100 194 234 112 236 69 221 69 226 44 196 22 169 18...

result:

ok answer = 500

Test #11:

score: 0
Accepted
time: 4ms
memory: 52836kb

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:

127 150 80 140 187 204 141 59 86 88 37 24 44 124 143 98 242 4 8 76 167 51 58 177 198 213 173 193 248 87 44 146 109 156 93 13 30 56 172 107 238 82 172 206 110 188 94 212 112 215 105 181 106 62 122 208 238 135 131 54 175 57 179 79 48 50 151 83 229 167 113 111 95 114 174 136 133 26 177 10 77 83 158 18 ...

result:

ok answer = 500

Test #12:

score: 0
Accepted
time: 4ms
memory: 53224kb

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 113 73 119 93 53 108 140 221 220 90 82 151 198 222 38 13 118 33 130 51 174 172 18 242 160 20 17 152 183 43 200 116 208 157 175 128 211 131 136 246 229 30 247 173 83 220 143 223 163 156 120 133 129 77 107 60 212 49 47 6 156 51 97 21 249 173 184 70 153 96 227 103 2 169 29 146 201 61 86 167 115...

result:

ok answer = 500

Test #13:

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

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 118 84 206 137 194 154 200 27 149 35 153 203 101 47 69 76 82 116 69 119 243 67 57 248 172 91 156 195 219 7 70 191 233 145 13 55 50 59 239 81 168 170 68 227 88 183 8 102 112 117 111 12 155 144 130 193 21 38 203 103 150 2 108 39 121 229 90 39 246 196 232 147 87 29 172 179 8 85 40 24...

result:

ok answer = 500

Test #14:

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

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 244 39 91 38 220 59 21 234 155 104 177 68 248 232 46 176 221 212 69 4 61 61 141 13 99 204 88 49 153 125 51 18 249 72 246 73 52 190 13 136 84 78 149 93 116 145 169 185 129 245 42 200 173 109 104 137 122 107 239 236 232 165 170 217 5 223 62 187 162 123 1 218 75 97 240 119 97 122 37 126 237 1...

result:

ok answer = 500

Test #15:

score: 0
Accepted
time: 4ms
memory: 53260kb

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:

0 0 0 0 0 1 2 0 0 0 3 0 0 0 0 0 0 4 0 0 5 0 0 0 0 0 0 0 6 0 7 0 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 9 0 0 0 10 11 0 0 0 0 0 0 0 0 0 12 13 0 14 15 0 16 17 0 18 0 0 0 0 0 19 0 0 0 0 0 20 0 0 0 21 22 0 0 0 0 0 23 0 0 0 0 0 0 24 25 0 26 0 0 27 0 0 0 0 0 0 0 0 0 0 0 28 0 0 0 0 0 29 0 30 0 0 0 0 31 0 32 0 0 0...

result:

ok answer = 67

Test #16:

score: 0
Accepted
time: 6ms
memory: 53932kb

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:

137 304 33 34 35 267 138 36 37 38 105 39 1 2 3 33 106 4 1 40 41 42 346 43 44 45 6 7 34 305 2 46 62 107 139 140 35 268 47 3 8 48 36 108 109 9 49 348 50 51 11 351 306 52 269 37 270 53 271 54 272 55 56 57 63 4 353 38 354 141 39 357 110 64 58 59 111 142 65 60 66 16 17 61 67 62 358 112 63 143 40 5 6 41 6...

result:

ok answer = 483

Test #17:

score: 0
Accepted
time: 4ms
memory: 54252kb

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:

235 64 1 240 96 152 107 97 17 1 170 128 153 108 236 26 51 154 155 64 228 65 109 156 179 66 172 99 110 2 43 189 67 157 120 68 166 237 241 75 30 55 261 251 180 152 182 69 205 158 153 71 263 72 73 159 154 35 206 155 76 129 190 75 113 160 18 191 3 65 27 8 46 161 52 68 69 140 111 273 36 76 48 49 112 264 ...

result:

ok answer = 494

Test #18:

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

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:

53 171 116 98 61 18 36 40 136 223 65 122 75 63 208 243 234 134 249 66 186 207 131 157 94 97 16 229 246 231 178 74 139 216 137 81 124 192 26 113 240 118 146 22 42 80 85 52 81 172 245 38 48 86 172 200 233 32 123 89 140 224 237 111 221 82 75 142 193 72 202 89 177 222 178 169 27 87 188 126 220 203 108 1...

result:

ok answer = 500

Test #19:

score: 0
Accepted
time: 6ms
memory: 52684kb

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 78 115 32 65 98 144 194 229 44 21 20 122 59 106 4 203 235 121 226 65 81 91 250 225 221 66 125 195 187 27 72 222 83 129 58 36 24 49 137 73 7 132 157 82 20 114 140 6 185 116 207 48 97 126 199 244 76 129 62 208 248 111 171 214 218 172 62 239 69 192 16 12 237 41 100 15 38 1...

result:

ok answer = 500

Test #20:

score: 0
Accepted
time: 6ms
memory: 54624kb

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 139 197 160 92 47 43 203 69 154 108 229 12 46 174 227 136 173 42 125 45 238 230 48 186 130 91 25 175 227 22 206 44 60 155 15 36 53 245 32 228 246 203 5 119 190 81 176 136 129 216 178 11 85 142 127 97 51 201 83 73 66 223 27 150 32 240 198 195 104 99 182 93 133 60 241 85 75 190 167 96 ...

result:

ok answer = 500

Test #21:

score: 0
Accepted
time: 8ms
memory: 53804kb

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:

92 148 52 159 187 171 77 90 11 204 10 35 73 47 27 220 20 161 80 234 103 237 19 240 135 212 194 143 139 153 97 36 58 241 198 168 142 138 171 194 247 149 9 4 89 72 109 72 156 165 235 61 57 90 154 105 40 197 207 14 22 54 107 205 23 24 206 164 207 216 67 82 92 159 15 176 245 99 79 248 37 157 99 199 8 18...

result:

ok answer = 500

Test #22:

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

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 167 214 223 74 115 63 29 244 148 161 79 245 51 163 62 108 152 15 157 106 242 120 247 138 145 242 185 11 96 134 210 12 118 179 154 245 7 91 134 225 200 94 165 28 44 212 236 213 172 78 201 187 212 111 4 122 43 28 45 121 237 122 36 236 133 3 140 38 117 157 240 219 20 243 119 215 233 103 93 185 230 ...

result:

ok answer = 500

Test #23:

score: 0
Accepted
time: 8ms
memory: 53632kb

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:

223 79 152 80 181 202 20 105 88 82 93 244 199 118 108 249 245 64 9 183 28 149 58 165 231 117 32 104 8 170 191 14 9 227 117 190 80 2 30 31 156 196 142 167 133 48 126 99 178 63 115 173 180 248 176 55 123 86 25 250 219 180 36 200 60 145 186 222 81 13 82 35 51 144 16 226 217 236 124 71 220 55 21 160 154...

result:

ok answer = 500

Test #24:

score: 0
Accepted
time: 9ms
memory: 53904kb

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 65 43 52 74 85 179 167 188 35 215 38 40 220 38 102 192 56 94 10 211 204 236 22 170 185 55 73 44 97 68 219 213 145 224 96 1 65 81 114 17 136 22 168 116 140 132 71 111 206 212 15 72 98 97 174 160 116 231 205 16 229 87 137 7 82 63 180 138 125 18 140 238 78 15 32 235 26 217 48 168 205 39 141 ...

result:

ok answer = 500

Test #25:

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

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:

211 138 231 212 224 140 9 29 11 217 38 53 185 168 249 158 135 176 164 49 99 242 35 54 184 116 194 172 87 243 215 106 72 26 234 157 207 106 159 241 169 222 119 172 43 186 18 192 124 123 102 145 20 186 205 112 7 2 114 90 208 223 72 245 26 158 53 197 32 237 155 148 189 78 30 109 56 21 213 71 52 1 117 1...

result:

ok answer = 500

Test #26:

score: 0
Accepted
time: 6ms
memory: 53148kb

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 0 124 125 3 4 126 127 5 128 0 0 129 130 0 0 131 132 133 134 6 135 0 136 0 0 7 8 137 138 9 139 140 141 142 0 0 10 143 144 145 0 11 0 0 146 147 148 149 150 151 152 153 12 154 0 155 13 0 14 0 156 157 158 15 159 160 0 161 162 163 164 0 16 0 0 165 0 0 166 17 167 0 18 0 168 169 170 0 0 171 172 173 0 1...

result:

ok answer = 236

Test #27:

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

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 135 336 33 34 31 266 35 339 342 343 348 65 36 37 107 349 66 350 32 136 297 38 33 1 298 9 39 137 40 41 67 108 267 138 68 42 299 34 300 109 43 10 352 44 35 45 46 12 69 47 353 301 48 268 70 36 358 269 302 49 71 110 50 360 2 303 304 51 37 270 72 16 38 139 52 361 140 363 19 53 54 55 56 57 20 ...

result:

ok answer = 500

Test #28:

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

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:

36 76 83 22 130 24 114 161 162 176 203 195 55 253 271 121 255 238 150 150 239 26 273 196 256 107 151 28 204 61 180 105 276 275 108 39 177 109 257 222 152 277 205 258 72 279 97 122 153 181 178 33 74 261 155 262 14 3 154 155 198 156 75 36 34 243 46 84 98 157 110 85 182 158 223 35 72 159 111 160 224 11...

result:

ok answer = 500

Test #29:

score: 0
Accepted
time: 6ms
memory: 52964kb

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:

140 194 22 244 238 106 219 53 86 246 202 87 246 97 104 40 194 179 29 199 232 39 27 1 142 230 205 214 63 54 182 134 237 48 123 59 101 11 150 161 224 110 98 37 164 247 57 172 71 2 54 82 130 201 51 248 18 141 37 155 114 152 221 178 83 159 95 215 176 180 27 163 181 151 126 10 100 166 223 225 98 174 36 1...

result:

ok answer = 500

Test #30:

score: 0
Accepted
time: 6ms
memory: 54036kb

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 95 62 145 155 1 232 159 238 122 242 13 164 81 224 98 112 46 63 49 62 68 55 236 220 66 12 22 212 49 152 205 184 218 207 244 117 114 172 90 164 51 67 149 195 133 204 78 26 41 121 125 216 182 157 68 144 93 14 63 113 95 93 200 77 110 206 171 139 27 44 220 58 43 112 10 80 213 5 222 156 2...

result:

ok answer = 500

Test #31:

score: 0
Accepted
time: 6ms
memory: 52944kb

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 172 189 94 144 63 90 30 200 159 47 121 56 54 51 218 154 58 39 110 51 106 31 168 4 13 36 35 135 245 123 152 116 127 59 184 94 187 122 169 27 69 82 71 125 169 40 221 147 61 232 22 114 238 78 113 101 130 111 102 202 104 171 203 173 153 122 217 123 199 6 248 188 204 190 72 11 248 125 23 212 161 222 ...

result:

ok answer = 500

Test #32:

score: 0
Accepted
time: 6ms
memory: 54516kb

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 234 27 247 160 32 23 64 131 20 134 183 214 154 72 175 164 128 93 41 116 49 162 92 55 195 90 110 78 65 76 19 148 215 23 204 180 232 211 199 50 2 35 209 188 1 250 114 118 237 11 52 176 191 171 111 218 29 201 149 140 236 69 76 60 77 102 36 159 90 244 40 193 75 155 132 127 230 27 201 48 214 249 1...

result:

ok answer = 500

Test #33:

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

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:

147 93 199 190 231 14 185 214 37 200 221 106 239 230 200 2 244 23 103 107 108 73 168 190 142 75 88 119 42 224 33 95 227 194 65 106 52 118 91 132 202 145 84 198 1 232 224 21 38 22 111 28 150 220 169 133 213 181 80 99 89 188 178 138 171 62 159 238 96 191 134 50 197 24 7 81 246 87 55 210 43 58 85 81 24...

result:

ok answer = 500

Test #34:

score: 0
Accepted
time: 6ms
memory: 53980kb

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 169 132 126 145 12 57 1 233 132 224 69 52 47 50 17 192 107 48 94 24 176 195 177 180 80 161 194 64 221 34 40 197 217 71 246 177 190 83 140 114 71 57 172 207 246 218 81 228 158 96 41 249 77 91 130 38 26 110 165 129 54 216 51 223 36 28 26 44 120 247 103 155 137 181 63 138 64 27 102...

result:

ok answer = 500

Test #35:

score: 0
Accepted
time: 8ms
memory: 53112kb

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:

108 152 41 233 145 39 221 215 229 83 134 176 195 125 56 213 228 12 197 156 170 124 92 59 38 158 52 127 26 65 181 238 202 160 162 131 119 191 146 85 62 40 167 136 58 118 81 144 186 190 130 121 71 87 219 73 86 246 164 236 51 55 107 151 174 211 26 87 77 89 243 211 161 75 191 206 175 123 158 74 7 129 24...

result:

ok answer = 500

Test #36:

score: 0
Accepted
time: 4ms
memory: 54648kb

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 135 245 37 91 236 56 232 199 89 53 203 204 157 42 234 101 19 143 51 220 109 64 136 67 203 223 243 162 180 217 101 174 8 133 105 134 229 68 239 44 26 231 212 106 132 113 189 220 28 127 196 146 93 140 58 205 160 72 95 242 104 173 246 25 249 32 142 62 161 116 6 176 205 170 ...

result:

ok answer = 500

Test #37:

score: 0
Accepted
time: 8ms
memory: 54056kb

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:

121 369 122 123 370 371 124 1 125 126 127 128 129 130 131 132 133 372 2 3 134 135 136 373 374 137 375 376 377 138 139 140 141 4 5 6 7 378 142 143 144 379 145 146 147 148 149 150 380 381 151 152 153 382 154 383 155 156 384 385 386 387 388 157 8 158 159 389 160 161 162 163 390 9 164 10 165 391 392 166...

result:

ok answer = 500

Test #38:

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

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 37423 81184 0 2 18688 18689 81185 18690 18691 0 18692 2 18693 156417 0 81186 0 18694 18695 18689 18696 18697 81187 18698 37424 0 0 18690 81188 0 18699 81189 6 81190 37425 18700 18701 18702 0 0 0 18703 81191 3 0 0 37426 18691 81192 81193 0 18692 18704 0 18693 18705 0 18706 156418 0 1869...

result:

ok answer = 230231

Test #39:

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

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 124965 36680 131777 92165 146487 1 42240 112745 100265 85452 100266 67168 15277 131778 24189 24191 100267 158785 50060 92166 67169 112746 146488 60586 146489 42242 24193 60587 85453 133729 60588 54927 155430 3797 67168 11564 131779 15278 50063 158788 67170 67171 42244 112747 67172 124966...

result:

ok answer = 292561

Test #40:

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

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:

86722 114110 106152 101790 79100 64403 74802 50177 118116 73660 64404 148394 131152 7893 5619 131153 131154 50178 140220 57453 146746 81134 72581 13269 141809 24763 122207 26219 20665 47013 47906 146747 114464 18752 131155 104652 56845 112924 55980 125975 37954 118956 127027 101456 85089 30833 97790...

result:

ok answer = 299930

Test #41:

score: 0
Accepted
time: 121ms
memory: 64812kb

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:

44418 139866 9518 121515 90672 131671 97936 103293 137529 144684 34702 89486 134030 33219 3299 130943 144685 53029 97238 96310 134031 126515 11156 34704 110672 89007 118765 35732 132195 113331 149546 46139 123921 46362 48305 123666 33846 144686 147606 88342 123714 59822 119742 25584 16388 138863 932...

result:

ok answer = 300000

Test #42:

score: 0
Accepted
time: 127ms
memory: 65884kb

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:

72861 145908 128070 53227 128581 92865 43073 142446 142259 29565 77822 56209 136911 29035 18059 94437 32401 6899 72128 119567 41541 101574 133113 129806 33266 45824 91825 113047 98152 32283 77009 74019 139245 31521 104535 81902 56825 120259 55081 120792 35545 78456 62633 72054 139798 14682 35736 379...

result:

ok answer = 300000

Test #43:

score: 0
Accepted
time: 165ms
memory: 65876kb

input:

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

output:

4449 16977 95687 109436 631 140097 36989 28817 35939 93255 24492 31713 79954 138751 47690 77303 43925 80351 5099 52561 72630 20549 86871 19103 55775 12582 147800 59391 148127 17073 82935 74336 19581 70613 59014 114741 213 43803 72262 106360 75746 18427 15653 100359 63393 86451 53303 59100 127038 148...

result:

ok answer = 300000

Test #44:

score: 0
Accepted
time: 207ms
memory: 74204kb

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 61235 124793 112843 146998 133822 71366 96490 24842 19085 86742 42509 114546 124513 103312 24742 10732 82337 86293 59628 34492 112975 82506 21395 79491 80627 145598 134367 31466 91002 149919 4476 90701 2690 85364 124448 15027 25585 29841 148321 29551 17981 104447 41356 122792 9039...

result:

ok answer = 300000

Test #45:

score: 0
Accepted
time: 202ms
memory: 74980kb

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 11698 136860 109401 135431 122244 40563 15143 111433 46515 51670 91875 97680 22842 106414 38668 18469 95096 112221 98137 77799 136678 14448 18583 50566 13873 7768 46133 19471 142588 148807 140263 98858 142664 147752 48944 83568 59656 122274 115969 74055 7759 15540 38288 61346 87413 86028 8170...

result:

ok answer = 300000

Test #46:

score: 0
Accepted
time: 228ms
memory: 73340kb

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 103439 31096 67484 133259 143472 22292 98633 19283 77144 63777 70171 16761 55402 98127 146993 23414 60403 106047 37710 23040 112474 43258 49453 62063 26495 112798 91270 98293 42541 90887 126968 109144 11665 119762 16355 7071 23791 103057 81799 103062 79676 115654 68453 91105 106171 1190...

result:

ok answer = 300000

Test #47:

score: 0
Accepted
time: 220ms
memory: 73052kb

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 72503 115124 72463 129708 102110 65540 123604 26184 23729 82633 140854 97767 60585 147609 31108 72720 114906 52703 55752 34570 46440 77540 129036 52948 79306 115580 44722 80921 61234 11820 117175 60021 143043 120544 145357 129353 135229 123597 140382 103538 9248 93983 46445 120431 4357 39356 1...

result:

ok answer = 300000

Test #48:

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

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:

74990 224941 74991 1 2 3 74992 74993 224942 224943 74994 74995 224944 4 224945 224946 74996 224947 74997 74998 224948 74999 75000 5 224949 75001 75002 75003 224950 6 75004 75005 224951 224952 75006 75007 75008 7 75009 224953 75010 224954 8 75011 75012 75013 224955 75014 75015 75016 75017 224956 2249...

result:

ok answer = 259601

Test #49:

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

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 200007 18741 156255 37480 81228 1 3 18741 174994 18742 200008 2 62454 174995 156256 37481 37482 18743 18744 81229 37483 37484 81230 37485 81231 18745 174996 174997 200011 6 200015 174998 18746 200016 174999 200017 200018 18747 18748 62455 18742 175000 11 175001 18749 18743 81232 18750 12 18751 374...

result:

ok answer = 296054

Test #50:

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

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:

24212 85245 42559 91854 55028 107951 19482 1 150385 24212 3737 0 125003 24215 24216 11494 67228 67229 91856 100227 67230 46145 42560 67231 3738 100228 112694 155245 50326 100229 2 112695 46146 36979 42561 85247 0 112698 100230 67232 85248 131716 42563 131717 100231 0 137292 125005 3744 67233 67228 5...

result:

ok answer = 290604

Test #51:

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

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:

25208 9260 100124 92780 82231 107188 47314 101870 122503 41811 111241 6534 33059 31303 77815 136827 73398 38830 100125 126205 3417 39779 81033 89362 138539 79206 122432 84736 113640 52910 111716 112833 114269 129927 3418 22984 128076 148307 70942 117558 100126 135140 2463 131694 29710 133402 118336 ...

result:

ok answer = 299989

Test #52:

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

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:

57905 132138 137849 83930 40868 140800 91657 48714 136851 130416 1671 44529 44975 130669 18444 144533 4786 135006 32664 101175 38235 75732 123967 10305 1563 136286 141770 75620 122123 110747 148465 118177 7950 117446 93280 39767 116439 41355 115942 91261 88797 78980 42174 117269 18377 107201 124644 ...

result:

ok answer = 299998

Test #53:

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

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:

42878 116107 74114 8889 143905 39885 96963 78708 41369 36980 124411 63632 33123 98462 110528 122622 112343 119772 49373 51831 67933 133409 12248 51813 135943 91519 112176 36961 77136 126793 15890 99248 20506 21821 102423 18264 136284 95413 136434 114907 247 121033 127175 72996 102179 96305 131639 52...

result:

ok answer = 299999

Test #54:

score: 0
Accepted
time: 169ms
memory: 65784kb

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 62914 141516 66622 107208 3886 9692 124144 79150 84566 122001 112883 36331 24611 104892 1767 9827 10604 45717 120681 58175 145317 92799 149150 121961 22755 35506 91851 117784 6583 148360 59612 39441 18048 7727 38562 117675 138837 144226 103650 13656 25228 47558 137911 65375 47980 141974 6045 ...

result:

ok answer = 300000

Test #55:

score: 0
Accepted
time: 213ms
memory: 74024kb

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 45807 48787 117212 99027 111494 127954 99930 100087 1077 63871 25328 111707 49180 88011 51024 113357 98762 11348 31825 149955 120448 67540 956 4339 106867 85057 136082 26172 6727 106812 137530 27382 11176 26107 68426 45459 114005 19519 113022 40438 91800 940 141550 59485 84455 88552 45669 6643...

result:

ok answer = 300000

Test #56:

score: 0
Accepted
time: 216ms
memory: 76040kb

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 80900 102436 89259 2026 96656 1460 15163 8774 1678 139814 34218 82603 46299 117000 56950 42528 76072 86052 130856 3609 290 135015 16605 86801 98896 103235 132558 115222 43972 98958 29597 101409 107433 84785 40401 8643 24629 129966 5212 145945 90114 621 147631 128887 62101 47700 100738 51...

result:

ok answer = 300000

Test #57:

score: 0
Accepted
time: 218ms
memory: 75876kb

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 77733 138263 33778 63739 131319 88252 66392 139599 70324 61263 42717 130231 58503 70512 51458 149734 84525 57161 125565 102391 568 96792 17884 76598 19697 142739 126569 38954 25369 77323 40761 16223 55711 32381 28005 24594 142290 137148 107378 135040 98350 26231 97174 78248 90413 60916 115929...

result:

ok answer = 300000

Test #58:

score: 0
Accepted
time: 231ms
memory: 74252kb

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 43483 81861 35905 103725 74963 25980 140652 127735 30428 40860 133530 57307 138619 129541 111334 141486 23025 140096 60605 133514 74327 30789 76543 126728 2332 142179 57910 109133 ...

result:

ok answer = 300000

Test #59:

score: 0
Accepted
time: 47ms
memory: 64520kb

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:

74935 0 1 74936 74937 2 74938 74939 0 74940 0 3 74941 74942 4 0 74943 74944 74945 0 0 0 0 74946 5 0 74947 0 74948 0 74949 0 74950 0 74951 6 74952 74953 74954 0 7 74955 74956 8 0 0 74957 74958 74959 74960 74961 0 74962 74963 9 0 10 0 74964 74965 0 74966 11 0 0 74967 0 74968 0 12 74969 74970 74971 749...

result:

ok answer = 152784

Test #60:

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

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 0 18705 62547 18706 0 18707 0 2 37419 81318 0 18708 0 18709 0 81319 0 18705 0 0 6 62548 0 7 0 62549 0 0 37420 2 0 18710 0 18711 18712 18713 18714 11 18706 0 18715 18716 0 18717 18718 13 0 37421 15 3 16 0 0 0 18719 18720 18721 18722 37422 18707 0 0 4 0 18723 0 0 18708 18724 0 0 37423 18725 18726 5 ...

result:

ok answer = 148740

Test #61:

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

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:

42761 42762 100615 11680 42763 3758 32331 3758 46515 100616 24480 3759 67456 104336 118944 67457 42764 100617 132425 125750 3759 42766 28213 100618 67456 0 67458 32332 67459 11682 24482 24483 100619 42761 100620 100621 125752 24485 132427 100622 0 46516 42762 46517 85565 67460 100623 132428 24486 10...

result:

ok answer = 275741

Test #62:

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

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:

58791 140038 12666 148313 111239 114562 1155 143542 126109 87999 20710 135121 69880 77904 81567 106968 118303 101982 136857 135122 11746 133438 20711 143543 140039 62079 87381 92594 81568 145138 97031 72688 118526 131592 148336 6801 145139 131593 116577 92595 50151 1728 7551 140244 144321 140245 439...

result:

ok answer = 299817

Test #63:

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

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:

107183 140294 57496 46958 6900 124243 42928 27216 138728 62128 28877 44964 105736 42968 136791 122786 95346 95259 102561 133784 68461 82059 144285 123154 137443 120334 142209 8209 140193 49743 53321 4992 118847 22669 99713 44002 26392 22490 122020 37636 14849 40268 55904 76251 62484 93885 120141 124...

result:

ok answer = 299999

Test #64:

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

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:

107621 16965 90283 9720 125740 137972 110961 136921 123872 916 144309 62578 37773 127761 85611 57216 133547 73987 128850 16768 51765 97695 50687 30172 110697 2889 18575 62671 98537 115190 39236 114431 124772 146112 113628 113627 13778 101149 115658 12795 2965 100772 13155 95968 29072 127318 99640 14...

result:

ok answer = 300000

Test #65:

score: 0
Accepted
time: 166ms
memory: 66164kb

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:

31523 57648 8100 109522 57956 102227 1213 94881 54135 37569 101649 136138 144051 105477 113260 50124 116172 65388 119910 130344 58497 19631 30039 134589 132939 58729 19820 113071 136058 84896 105474 58034 42105 23184 10171 137932 121419 76202 12347 62763 126060 125761 131088 8864 132213 71149 102787...

result:

ok answer = 300000

Test #66:

score: 0
Accepted
time: 202ms
memory: 73944kb

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 40347 122294 104520 6909 126227 41385 25193 13930 77352 61839 111086 82795 13429 2659 116936 115485 66557 139767 117072 37423 5055 34235 46171 85034 142043 146585 106926 87964 18772 125762 2439 46151 74386 42554 107561 127826 123057 73482 54203 119578 115540 107829 116677 30621 108948 57...

result:

ok answer = 300000

Test #67:

score: 0
Accepted
time: 216ms
memory: 75920kb

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 48641 107721 112832 122344 91452 139567 5036 134522 30400 43617 10591 90157 131247 134458 80724 39082 73192 11210 16771 112729 132992 40559 10786 58542 130887 79151 38612 57856 30649 62690 133314 116625 97988 47478 107905 23767 13350 127858 106101 23881 49000 21496 92121 47569 115...

result:

ok answer = 300000

Test #68:

score: 0
Accepted
time: 217ms
memory: 73820kb

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:

86746 119105 42199 25345 87259 129950 112297 104474 16072 148473 57953 137895 123560 82354 104225 56871 18378 7094 141423 45905 33249 10393 89443 148384 140767 97242 122972 93872 34609 112549 106455 63796 144127 40364 23628 41019 117781 121148 104817 103262 87039 41626 106173 8382 25619 63273 145317...

result:

ok answer = 300000

Test #69:

score: 0
Accepted
time: 218ms
memory: 74636kb

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 70941 139637 71150 109842 78115 121255 126319 35028 73510 32863 100444 71742 112011 54012 4427 70141 77708 46872 90948 80464 73498 103216 113027 83933 97563 94047 107325 45655 1723 4111 135411 28019 35113 74098 82138 53164 80165 104051 65158 49894 119093 126560 121511 143624 48248 70955 80206...

result:

ok answer = 300000

Test #70:

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

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:

0 0 74995 1 74996 74997 74998 74999 0 2 75000 3 4 0 75001 75002 5 75003 6 7 0 8 0 0 0 9 10 11 0 75004 12 13 14 15 75005 75006 16 0 0 75007 75008 0 75009 17 75010 0 0 75011 75012 75013 75014 0 18 75015 0 75016 19 75017 0 20 0 21 75018 75019 75020 22 0 23 75021 75022 75023 0 75024 24 25 75025 0 75026 ...

result:

ok answer = 192988

Test #71:

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

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 199904 37504 174837 37505 199905 62573 37506 18747 199906 18748 1 156060 4 18749 18750 18751 174838 18752 62574 18753 156061 199907 174839 18754 18755 37507 199909 37508 18756 81335 174840 81336 174841 18757 81337 18758 18759 37509 18747 18760 18748 81338 7 18761 2 8 199911 37510 18762 1...

result:

ok answer = 297533

Test #72:

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

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:

19331 3696 3697 15106 42257 66905 124753 66906 60390 24147 66907 66905 79683 100155 66908 91691 24149 70553 1 45885 24150 100156 100157 74891 133576 7236 74892 112709 42257 4 85135 45886 54819 100158 54820 66909 66910 42258 103811 131640 91692 24152 42260 133577 131641 45887 91693 11445 24154 36907 ...

result:

ok answer = 278039

Test #73:

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

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:

101919 3822 96684 12828 143554 84610 138474 46437 143525 17031 41740 143807 98912 50036 106302 141876 39994 148335 18195 53 2447 87417 47673 133362 45621 118630 6230 106303 135181 122360 45809 81670 116674 140189 47835 69902 6510 110587 145136 644 54424 110774 75474 110009 118631 56970 78128 106304 ...

result:

ok answer = 299938

Test #74:

score: 0
Accepted
time: 113ms
memory: 64428kb

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:

124755 46715 129372 138427 143705 114491 123688 126873 122430 133677 102928 92324 91041 67514 9671 146161 154 523 59330 9055 140955 127433 120559 54435 91409 112728 30339 22840 121894 145893 19862 132305 40762 25033 107307 133832 90350 48963 137449 52042 75101 10664 126745 30601 90229 102717 88798 2...

result:

ok answer = 299996

Test #75:

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

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:

24118 16007 42016 63103 149837 140902 25542 85694 37394 93318 25430 45587 58354 48012 149242 82922 136055 73379 147774 111753 17522 141373 9925 114793 131750 41535 41173 9279 1831 95275 74882 45905 69446 25321 113892 96399 46462 57116 139350 77680 132930 107018 112429 28551 92945 86461 25139 87720 1...

result:

ok answer = 300000

Test #76:

score: 0
Accepted
time: 173ms
memory: 65620kb

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 145970 136448 119025 119252 25462 133756 110474 48550 142580 99591 25001 65786 112493 46442 59950 91106 68056 88685 52698 83633 85210 83788 95497 121351 66258 6679 86968 135482 65094 70898 20484 50507 16263 140267 41320 57820 95537 35856 145412 82610 128907 37472 1406 141872 129607 121066 884...

result:

ok answer = 300000

Test #77:

score: 0
Accepted
time: 194ms
memory: 72244kb

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 105710 5841 109599 73433 125564 63115 106955 124621 3286 32237 97779 102018 101379 127543 134422 90315 23989 34104 125079 119311 18874 80157 77335 65541 69414 35133 60298 45428 147494 6127 70134 22474 94191 121947 136532 114861 103565 94588 35597 106616 1...

result:

ok answer = 300000

Test #78:

score: 0
Accepted
time: 227ms
memory: 75000kb

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 14306 3880 44572 4674 74705 125348 19565 147596 133981 29712 149428 95248 22459 89810 65203 8594 146032 27186 133438 142665 137421 123759 55845 26448 123380 72512 44785 92597 91141 139717 50511 16019 115586 149970 13272 33157 77950 86271 52307 23337 8046 82997 110133 108891 ...

result:

ok answer = 300000

Test #79:

score: 0
Accepted
time: 208ms
memory: 73896kb

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 69338 34815 8739 29732 135564 148510 914 65688 19031 149195 115518 117817 55035 30448 94598 94200 101630 64829 119695 25319 116438 48950 119085 87808 5977 20783 135751 134764 46152 136299 23366 112943 141030 61494 128132 40818 9963 18637 8262 75044 24468 109813 45226 ...

result:

ok answer = 300000

Test #80:

score: 0
Accepted
time: 226ms
memory: 75896kb

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 93385 135010 13594 42757 138566 95326 69806 15202 142486 36721 129746 10225 121951 140170 73795 110078 126436 20233 66879 24377 60530 98925 87241 31072 13721 68410 30906 54259 98567 136056 95746 10954 50402 130197 51373 110911 20551 59638 102691 134493 56839 107242 93261 121626 24941 81787 968...

result:

ok answer = 300000

Test #81:

score: 0
Accepted
time: 49ms
memory: 67860kb

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 74964 74965 74966 74967 74968 74969 224943 74970 3 74971 74972 4 5 6 7 8 74973 74974 74975 74976 74977 74978 224944 74979 9 74980 74981 74982 10 74983 224945 11 74984 12 13 74985 74986 14 224946 74987 74988 74989 74990 15 74991 16 224947 74992 224948 224949 74993 17 18 224950 74994 74995 74996 7...

result:

ok answer = 233191

Test #82:

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

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 0 18760 0 0 0 0 0 0 18761 18762 0 18763 0 0 4 0 5 0 0 0 0 18758 0 0 18759 0 18760 18764 1 0 0 0 18765 18766 0 0 0 0 0 0 0 0 18761 0 9 18767 18762 0 18768 0 0 0 18763 10 18769 11 0 0 0 12 0 0 0 18770 18771 14 18772 0 18773 18774 0 15 2 18775 18776 16 0 17 0 18 0 0 3 0 19...

result:

ok answer = 48024

Test #83:

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

input:

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

output:

0 11509 15249 19437 0 0 19438 42312 24231 4 0 0 100149 0 103832 0 32125 6 0 3583 0 42315 0 8 1 19439 100150 0 42316 24231 67288 100149 67288 24233 42317 100151 100152 27902 24234 42318 100153 67289 0 0 0 100154 24232 24236 79841 0 0 92116 92119 67290 0 79842 11513 100155 67291 67292 100156 100157 10...

result:

ok answer = 209982

Test #84:

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

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 44784 32654 19434 14840 0 11096 0 0 0 0 0 34358 15385 8765 0 0 15308 0 0 20649 0 0 0 0 0 0 0 0 0 0 0 0 22545 36756 0 26404 0 0 0 7788 0 0 0 9996 0 22066 0 0 41692 0 7271 0 0 0 0 0 0 0 0 0 0 28534 27331 0 10602 0 0 0 43753 0 37328 12847 0 0 23464 2086 0 0 0 0 0 0 12937 0 0 0 23595 0 0 1107 0 0 0 0 ...

result:

ok answer = 94122

Test #85:

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

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:

13352 22805 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 978 0 0 0 0 0 0 0 0 0 0 64 0 0 0 0 0 0 0 0 0 0 0 2228 22857 0 0 0 0 0 0 0 0 0 0 0 0 6192 0 0 0 0 0 0 0 8330 0 0 0 410 22931 0 18935 0 6991 0 23729 0 0 0 0 0 0 0 7878 0 0 0 0 0 0 0 0 21597 0 0 0 0 0 0 0 0 0 0 0 8884 0 0 0 0 0 0 0 0 2642 2134...

result:

ok answer = 48086

Test #86:

score: 0
Accepted
time: 130ms
memory: 64868kb

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 38449 0 29873 0 22802 0 0 0 30694 9083 0 0 0 0 29790 0 13770 0 0 0 0 0 0 0 0 0 22323 0 29281 0 0 0 0 0 20340 0 0 0 0 38155 20224 0 11895 0 0 0 10566 0 0 0 0 0 35348 0 11377 0 38110 14954 19762 0 0 0 16987 0 29835 0 0 36068 0 0 12929 0 0 0 0 0 0 0 25379 0 0 0 3853 0 12172 0 0 0 0 0 0 0 0 31008 ...

result:

ok answer = 78394

Test #87:

score: 0
Accepted
time: 178ms
memory: 66756kb

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 1329 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 2216 0 0 0 0 0 0 0 ...

result:

ok answer = 24016

Test #88:

score: 0
Accepted
time: 204ms
memory: 72012kb

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 24785 0 0 0 0 29857 0 0 0 0 0 39469 34693 0 50886 13753 0 0 0 25960 23850 0 0 0 36158 0 9865 0 25372 28692 45914 0 0 0 0 0 0 0 0 0 19091 0 0 39037 0 0 7321 0 35580 0 0 19727 0 0 0 43242 0 0 14500 44630 0 0 0 31998 0 0 0 0 0 33473 0 6047 0 41956 0 0 0 0 0 0 0 0 0 0 0 5577 0 0 0 0 0 0 9358 6249 ...

result:

ok answer = 103886

Test #89:

score: 0
Accepted
time: 217ms
memory: 73068kb

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 42324 25995 9946 0 89574 0 0 50385 65461 76305 3386 17295 0 0 10131 86987 0 30784 84888 66577 46878 79262 37057 45526 10226 8538 59203 0 72410 0 60722 84883 0 70446 11364 16380 60801 54694 57439 0 87168 0 77029 35828 0 87885 0 0 78604 84487 0 0 0 0 0 60190 0 27122 53370 31650 0 9642 0 312...

result:

ok answer = 184372

Test #90:

score: 0
Accepted
time: 212ms
memory: 72932kb

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: 218ms
memory: 74944kb

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:

29541 0 6900 7975 0 0 0 0 3237 0 0 0 0 0 0 18537 27870 31365 27278 0 35939 0 0 0 40296 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 17229 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 18573 0 0 0 0 0 1...

result:

ok answer = 90686

Test #92:

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

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:

0 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 ...

result:

ok answer = 1

Test #93:

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

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: 62ms
memory: 65056kb

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: 83ms
memory: 67248kb

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

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

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

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

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: 62ms
memory: 66360kb

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

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

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: 61ms
memory: 63080kb

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

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

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

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

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: 41ms
memory: 66436kb

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: 40ms
memory: 65692kb

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

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

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

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: 70ms
memory: 69396kb

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

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

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

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

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

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:

66832 100113 42042 66833 42042 150125 66834 100114 31786 100113 100115 132214 19339 66835 60115 66836 100114 31787 42044 27776 100116 15205 142233 7389 42045 74771 66837 79484 100117 36507 137120 15206 24030 24031 19342 7390 1 100118 132215 66838 42047 100119 24032 66832 74772 66839 49878 100120 240...

result:

ok answer = 285014

Test #119:

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

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:

67323 132493 67324 42320 42321 100575 1 11718 100576 146419 42322 42323 67325 42324 24425 24425 2 15439 1 42319 24426 100575 24427 60578 132495 100577 67326 24426 42326 100578 3730 50156 100579 146420 19618 133843 36913 100580 67327 5 2 24428 60579 42327 142677 67328 42328 11720 67329 67330 3731 423...

result:

ok answer = 294859

Test #120:

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

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 75288 60674 67324 150483 55130 80029 67325 71069 100396 42327 67326 19468 100397 100398 7454 15332 100399 55132 100400 11611 24142 100401 36916 67327 4 142713 137387 15333 118802 55133 100402 118803 24142 142714 67324 11614 24143 19469 27982 67328 67329 133690 146357 100403 7455 67330 19470 80030 ...

result:

ok answer = 290984

Test #121:

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

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:

24243 92032 1 42377 79835 75201 2 67318 133719 24245 100513 92033 100513 2 118667 67319 100514 42377 0 3 19480 28056 146190 125384 125386 19481 100514 132256 118668 67320 100515 7354 55052 125387 133720 19482 79836 24250 24251 11475 3644 132257 118670 67321 7355 36832 133721 42380 137320 11477 46104...

result:

ok answer = 286318