QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#282149#1173. Knowledge Is...SoyTonyAC ✓102ms23560kbC++141.9kb2023-12-11 14:39:042023-12-11 14:39:05

Judging History

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

  • [2023-12-11 14:39:05]
  • 评测
  • 测评结果:AC
  • 用时:102ms
  • 内存:23560kb
  • [2023-12-11 14:39:04]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

typedef pair<int,int> pii;
#define fir first
#define sec second
const int maxn=3e5+10;
const int inf=0x3f3f3f3f;

inline int read(){
    int x=0,w=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')w=-1;c=getchar();}
    while(c<='9'&&c>='0'){x=(x<<3)+(x<<1)+c-'0';c=getchar();}
    return x*w;
}

int n,m;
struct Interval{
    int l,r,id;
    Interval()=default;
    Interval(int l_,int r_,int id_):l(l_),r(r_),id(id_){}
    bool operator<(const Interval &rhs)const{
        if(l==rhs.l) return r<rhs.r;
        else return l<rhs.l;
    }
}p[maxn];
struct Pair{
    Interval A,B;
    Pair()=default;
    Pair(Interval A_,Interval B_):A(A_),B(B_){}
    bool operator<(const Pair &rhs)const{
        return B.r>rhs.B.r;
    }
};
priority_queue<Pair> Q1,Q2;
int ans[maxn];

int main(){
    // freopen("interval.in","r",stdin);
    // freopen("interval.out","w",stdout);
    n=read(),m=read();
    for(int i=1;i<=n;++i){
        p[i].l=read(),p[i].r=read();
        p[i].id=i;
    }
    sort(p+1,p+n+1);
    for(int i=1;i<=n;++i){
        if(!Q1.empty()&&Q1.top().B.r<p[i].l){
            Pair now=Q1.top();
            Q1.pop();
            Q2.push(Pair(now.B,p[i]));
        }
        else{
            if(!Q2.empty()&&Q2.top().B.r<p[i].r){
                Pair now=Q2.top();
                Q2.pop();
                Q1.push(Pair(Interval(0,0,0),now.B));
                now.B=p[i];
                Q2.push(now);
            }
            else Q1.push(Pair(Interval(0,0,0),p[i]));
        }
    }
    for(int i=1,j=1;i<=m;++i){
        if(!Q2.empty()){
            Pair now=Q2.top();
            Q2.pop();
            ans[now.A.id]=i,ans[now.B.id]=i;
        }
        else{
            while(j<=n&&ans[j]) ++j;
            if(j<=n) ans[j]=i;
        }
    }
    for(int i=1;i<=n;++i) printf("%d ",ans[i]);
    printf("\n");
    return 0;
}

詳細信息

Test #1:

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

input:

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

output:

2 4 1 3 3 1 2 

result:

ok answer = 7

Test #2:

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

input:

2 2
1 2
3 4

output:

1 1 

result:

ok answer = 2

Test #3:

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

input:

2 1
1 2
2 3

output:

1 0 

result:

ok answer = 1

Test #4:

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

input:

1 1
4 26

output:

1 

result:

ok answer = 1

Test #5:

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

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:

78 92 119 2 6 60 120 95 117 121 122 57 56 54 31 123 124 125 53 52 38 63 98 110 126 127 128 129 107 130 43 49 115 104 49 41 131 132 34 30 133 93 134 84 118 135 76 15 136 83 77 73 71 13 101 68 113 137 115 114 88 105 78 138 118 27 139 140 141 112 67 142 143 144 145 71 146 147 148 149 150 151 108 1 97 1...

result:

ok answer = 376

Test #6:

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

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 104 231 87 171 172 201 142 224 223 186 131 190 21 143 71 67 83 232 179 113 233 234 155 128 115 129 4 102 235 236 196 7 177 30 168 21 24 207 166 196 99 40 91 171 47 203 134 64 150 8 51 217 226 176 58 148 11 152 118 198 57 2 237 212 164 92 165 238 100 157 123 50 147 52 143 73 239 102 240 129 202 2...

result:

ok answer = 471

Test #7:

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

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:

35 208 193 175 77 150 72 61 76 240 3 19 79 210 188 116 234 146 7 78 74 48 46 43 139 44 197 186 14 39 179 59 228 166 115 170 29 130 144 12 109 80 65 91 194 9 36 132 20 60 173 218 169 113 5 73 177 45 217 49 80 167 172 88 225 51 104 245 175 34 110 126 177 203 55 137 89 231 207 151 87 159 69 122 47 61 2...

result:

ok answer = 500

Test #8:

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

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:

174 131 187 239 118 34 217 195 157 69 88 8 193 149 200 51 123 66 19 119 12 130 48 82 193 172 116 4 243 137 200 24 203 189 224 101 114 223 97 26 117 180 29 161 140 46 96 168 246 50 94 135 121 20 191 43 25 100 70 16 151 178 118 177 8 163 219 92 84 73 36 134 245 95 221 176 90 57 110 96 5 107 22 187 103...

result:

ok answer = 500

Test #9:

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

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:

102 72 190 119 125 205 111 227 75 199 151 48 235 131 107 194 118 32 189 15 113 221 127 33 169 144 101 196 29 229 59 177 68 187 4 149 30 168 156 171 71 209 101 12 207 181 64 5 128 85 243 150 161 176 81 200 148 189 190 135 20 27 138 14 49 80 241 102 136 193 104 29 134 93 132 38 53 51 202 34 23 166 106...

result:

ok answer = 500

Test #10:

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

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:

207 8 141 215 26 122 180 83 226 173 219 49 149 241 198 231 36 80 225 239 92 115 211 136 134 206 16 235 210 2 191 148 237 235 227 96 49 125 94 35 118 88 86 23 229 31 159 55 119 215 185 153 57 107 43 111 228 132 32 7 50 203 194 42 21 209 200 241 204 82 214 9 52 161 102 151 169 250 144 106 28 164 90 87...

result:

ok answer = 500

Test #11:

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

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:

42 125 45 158 115 197 154 41 122 247 70 48 170 19 99 112 237 226 157 151 53 239 241 54 177 178 107 150 234 247 213 116 3 189 181 211 175 56 11 124 203 187 11 186 3 35 88 178 209 233 24 2 24 66 120 186 203 31 46 185 231 110 26 104 94 114 248 166 135 18 136 140 83 55 23 162 173 242 54 89 36 1 17 67 44...

result:

ok answer = 500

Test #12:

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

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:

69 225 111 84 34 78 190 96 120 147 162 117 113 92 40 172 175 118 204 165 91 29 133 200 63 214 148 178 127 136 105 11 238 94 135 20 125 55 70 67 12 221 192 10 233 133 71 162 123 146 180 166 121 4 46 47 212 222 197 77 199 142 166 190 18 63 248 209 8 47 176 86 161 45 224 163 115 87 54 38 98 242 205 48 ...

result:

ok answer = 500

Test #13:

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

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:

52 127 219 250 181 45 124 87 234 36 154 113 134 103 12 144 132 197 69 151 185 180 44 173 170 205 17 77 240 148 104 23 169 126 175 61 26 149 139 227 214 48 38 199 11 95 224 38 155 33 135 177 101 16 125 179 192 160 49 62 36 239 94 132 15 245 186 5 39 18 232 41 8 218 230 237 163 33 99 89 138 177 124 21...

result:

ok answer = 500

Test #14:

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

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:

214 154 228 247 191 94 228 107 224 173 160 182 149 200 125 231 226 43 134 167 98 125 89 78 88 1 202 175 176 27 6 83 19 45 161 233 85 225 13 180 194 202 144 84 62 116 138 26 33 59 74 19 247 39 109 23 71 8 5 46 81 216 170 226 63 189 118 86 211 139 192 217 36 174 151 113 219 216 237 212 96 82 80 232 15...

result:

ok answer = 500

Test #15:

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

input:

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

output:

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

result:

ok answer = 67

Test #16:

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

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 76 67 77 107 108 42 45 46 109 6 83 110 111 68 112 113 88 61 63 65 114 62 55 53 115 116 72 117 82 48 29 118 119 120 75 121 41 81 91 40 77 122 123 80 74 124 75 72 125 126 127 69 128 12 129 130 131 132 133 134 135 136 18 93 137 56 138 139 60 140 141 52 142 143 144 145 33 146 43 98 82 147 38 148...

result:

ok answer = 483

Test #17:

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

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 218 156 223 48 172 83 216 128 116 195 153 213 30 224 61 181 201 127 32 225 54 28 176 226 216 147 47 29 144 16 105 193 202 33 36 73 227 228 211 106 206 42 229 75 202 176 207 187 178 143 43 230 49 189 129 204 65 96 213 1 133 231 152 18 125 68 185 130 152 120 148 25 117 134 190 221 162 157 6 131 52...

result:

ok answer = 494

Test #18:

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

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:

27 50 63 45 150 58 13 10 1 139 173 4 2 132 241 227 225 217 244 105 239 73 176 70 14 36 107 148 231 134 153 26 236 133 4 15 53 174 102 220 195 222 17 187 22 21 247 224 72 8 211 249 67 14 71 190 134 86 46 125 85 98 183 155 229 9 156 238 137 62 35 77 57 233 178 227 113 61 170 197 99 82 5 47 142 32 153 ...

result:

ok answer = 500

Test #19:

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

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:

152 195 146 186 70 95 98 167 180 69 27 126 176 123 201 230 198 22 213 108 166 234 72 141 197 152 209 116 127 153 249 106 75 48 108 38 35 29 47 129 43 244 208 98 49 101 151 57 177 220 179 250 115 74 66 173 103 132 142 86 3 89 94 247 144 55 113 67 242 136 83 185 159 218 126 222 170 189 63 85 182 17 77...

result:

ok answer = 500

Test #20:

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

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:

103 51 236 12 213 79 181 234 78 192 133 246 101 1 221 171 53 147 151 141 5 122 139 190 218 195 52 148 8 61 45 179 151 129 120 42 172 191 73 50 119 226 68 131 245 133 39 124 48 117 99 56 229 238 5 19 137 64 105 134 96 204 135 167 246 88 196 74 68 209 25 28 111 62 44 127 24 241 183 21 216 48 208 27 15...

result:

ok answer = 500

Test #21:

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

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:

10 48 8 177 162 5 20 76 171 179 108 27 29 117 141 90 236 131 85 214 36 208 43 172 204 66 83 178 243 74 44 190 174 192 60 239 182 4 5 83 231 70 147 149 195 47 118 47 168 165 166 80 113 195 168 36 232 60 59 12 216 200 176 179 134 130 55 2 104 151 242 89 163 177 23 198 210 88 146 220 38 13 44 152 246 1...

result:

ok answer = 500

Test #22:

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

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:

248 200 159 96 147 58 219 62 221 19 43 241 208 40 85 145 20 150 56 121 87 203 103 224 165 187 203 2 195 126 151 223 63 185 163 187 208 167 116 53 133 36 73 150 32 114 144 180 196 22 193 171 169 144 97 127 199 59 32 50 17 231 93 119 217 228 236 71 218 5 71 186 140 246 220 58 100 194 204 225 3 139 55 ...

result:

ok answer = 500

Test #23:

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

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:

176 80 242 85 173 29 13 153 121 66 199 246 122 28 166 240 248 24 32 67 39 169 105 43 183 33 53 131 142 158 54 92 32 224 198 98 66 154 20 249 45 57 102 200 135 94 18 191 180 50 60 222 143 217 232 162 14 166 127 250 192 143 128 87 225 160 130 109 237 11 150 188 209 88 75 159 70 157 5 204 163 162 100 2...

result:

ok answer = 500

Test #24:

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

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:

156 162 109 9 73 180 157 163 76 193 26 179 190 176 14 218 176 18 196 244 211 111 232 47 219 168 250 12 191 237 149 60 242 146 133 198 155 166 243 33 215 19 187 236 168 67 158 128 20 144 25 59 117 197 89 56 60 2 52 53 224 104 51 113 101 72 233 122 30 216 214 161 119 182 225 135 197 174 183 172 99 148...

result:

ok answer = 500

Test #25:

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

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:

103 159 135 92 110 145 185 144 107 81 105 235 42 53 247 31 27 61 170 60 104 242 188 184 70 228 174 200 231 226 211 207 18 67 191 123 75 207 102 245 37 127 49 61 12 19 94 128 216 4 11 109 137 19 181 201 64 62 21 45 93 131 22 224 67 159 178 236 16 190 145 241 164 237 158 171 238 83 103 169 180 219 155...

result:

ok answer = 500

Test #26:

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

input:

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

output:

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

result:

ok answer = 236

Test #27:

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

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 26 25 1 107 108 24 23 60 109 22 110 111 112 113 28 21 20 114 115 30 116 59 117 118 19 69 95 119 103 18 120 17 16 40 121 122 123 44 15 124 80 125 126 14 127 128 13 12 27 11 129 39 10 130 131 9 132 75 57 133 134 135 8 78 136 7 137 89 138 139 140 32 141 8 87 51 142 143 144 145 146 147 148 149 150 1...

result:

ok answer = 500

Test #28:

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

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:

151 135 35 165 149 126 20 147 68 123 80 117 197 204 21 79 205 206 196 62 207 195 13 154 208 174 109 51 209 182 109 66 127 38 4 2 107 55 210 211 95 212 213 214 173 215 46 22 164 180 124 140 27 51 216 48 90 217 143 127 194 124 168 202 159 218 83 43 116 60 73 30 160 61 219 86 40 194 220 160 221 56 72 2...

result:

ok answer = 500

Test #29:

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

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:

32 100 228 230 155 26 189 67 38 234 220 99 243 3 125 179 100 43 71 21 164 166 54 120 186 160 220 131 162 135 13 132 245 72 197 189 7 222 244 192 130 225 35 39 91 210 82 15 16 232 200 31 57 138 28 233 145 240 152 194 65 139 182 181 16 241 87 111 227 236 209 185 15 240 191 44 4 91 96 134 98 158 248 19...

result:

ok answer = 500

Test #30:

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

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:

162 76 73 190 154 77 234 177 159 230 216 167 197 143 205 129 204 164 144 39 53 109 67 93 164 192 60 249 168 146 129 112 86 93 159 59 105 158 115 224 90 183 176 165 11 8 36 25 120 221 73 181 207 99 140 247 131 80 250 136 23 45 14 43 31 77 118 100 41 203 170 61 128 97 194 139 199 194 70 68 98 108 151 ...

result:

ok answer = 500

Test #31:

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

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:

193 10 58 37 33 127 8 130 161 154 70 135 219 220 144 215 208 247 146 218 144 212 236 184 180 65 42 156 82 222 51 46 51 145 74 224 47 24 141 64 27 12 62 242 88 46 9 194 114 30 175 173 14 196 168 86 98 57 177 166 67 18 113 67 38 152 135 81 117 164 180 221 92 126 45 73 206 221 172 20 93 33 232 119 129 ...

result:

ok answer = 500

Test #32:

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

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:

48 247 237 136 235 129 133 166 191 212 250 243 138 209 58 22 123 242 18 32 27 240 226 41 54 180 236 221 75 66 99 2 84 58 177 166 114 102 172 106 85 36 248 8 69 153 163 247 105 16 215 7 160 62 115 109 178 89 74 100 207 179 164 59 45 167 66 19 80 31 55 238 38 64 2 31 143 3 175 136 100 36 177 239 163 7...

result:

ok answer = 500

Test #33:

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

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:

12 217 107 184 127 132 238 160 161 206 158 8 155 122 206 190 218 74 50 210 114 20 192 6 72 180 14 89 70 106 40 22 124 113 69 67 172 119 150 162 211 175 13 25 92 134 106 159 130 74 23 29 245 147 125 85 95 75 32 62 194 165 243 222 153 45 141 250 197 77 237 214 163 188 83 57 240 96 45 41 35 10 244 84 2...

result:

ok answer = 500

Test #34:

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

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:

97 161 167 218 82 230 35 189 74 81 106 68 149 232 58 99 42 92 18 133 165 67 84 126 195 129 2 37 148 177 80 170 226 49 206 196 32 79 147 25 247 148 5 24 62 7 42 68 13 20 247 101 154 113 192 116 190 231 204 34 189 39 21 146 90 58 63 88 92 150 38 203 21 36 155 215 104 130 109 83 161 109 49 3 137 205 35...

result:

ok answer = 500

Test #35:

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

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:

132 164 18 194 244 75 171 125 167 225 94 8 76 238 35 210 121 199 57 129 246 160 21 73 75 129 200 61 44 5 112 197 45 80 141 61 105 151 9 58 99 122 11 104 219 134 223 147 25 63 38 177 29 68 181 189 30 241 180 196 15 73 120 12 41 136 44 228 43 153 239 136 84 189 110 139 140 177 127 3 27 33 216 147 224 ...

result:

ok answer = 500

Test #36:

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

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:

127 56 61 205 199 236 150 70 192 208 179 19 156 195 250 30 7 47 187 37 134 216 203 51 22 143 193 242 68 160 26 197 187 89 207 53 25 120 4 38 1 45 147 64 141 197 228 235 78 206 169 130 45 60 44 242 170 48 33 128 204 185 110 86 59 210 119 196 140 217 238 240 244 181 143 18 224 218 142 38 86 217 218 12...

result:

ok answer = 500

Test #37:

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

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: 38ms
memory: 15456kb

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 39359 48381 32160 62463 62464 55353 39568 39550 62465 39633 39643 62466 39600 62467 39451 62468 62469 62470 62471 39459 39470 4093 39475 39428 62472 39447 33062 62473 62474 3645 62475 62476 39518 62477 62478 62479 32525 39496 39500 39812 62480 62481 62482 39835 62483 55064 62484 62485 30139 40...

result:

ok answer = 230231

Test #39:

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

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:

63218 36580 54530 12161 129044 33568 133729 133730 18616 133731 93415 47839 53086 95289 33397 105939 109277 94366 123661 36502 8345 26525 39339 118930 133732 68509 133733 19293 4281 83545 47294 133734 83773 13633 133735 76462 49921 74684 126781 33354 9547 25053 56754 56852 133374 101792 56858 105960...

result:

ok answer = 292561

Test #40:

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

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:

114833 48314 129121 86448 34033 24290 44069 147616 121976 40098 91676 142741 82813 42211 27629 113009 79376 90104 89891 2194 137548 126082 144797 85293 104045 12480 69152 16701 64554 33219 147451 132299 39972 9652 74220 116905 103339 26218 11261 41461 44072 20303 57726 83672 71451 41378 22318 64717 ...

result:

ok answer = 299930

Test #41:

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

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:

129938 138622 61619 130552 117996 84506 51796 77071 68169 105667 116411 40647 113745 8885 78568 104234 132874 108124 31499 65054 139057 126819 30989 95088 35897 117960 72094 48897 104227 71349 147230 23230 137094 43635 38261 48736 35668 123998 143714 120960 21918 27124 11268 5619 134751 74313 37235 ...

result:

ok answer = 300000

Test #42:

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

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:

143154 149369 31829 14954 79141 5510 90821 132550 112428 105578 116258 93333 122100 83783 102035 107700 86632 110748 26591 20265 16204 69398 56993 61336 29880 11052 40547 55952 98164 13658 91753 82598 141121 32218 39117 62887 59321 10315 78477 33375 54904 69697 73700 39477 83641 26937 60473 21693 83...

result:

ok answer = 300000

Test #43:

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

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:

147032 34278 61398 102015 109738 124127 45545 67716 47650 50963 18848 107193 45161 74471 47792 25609 114921 91803 73062 85065 63405 73961 72311 132782 70234 10017 135021 142986 144787 71099 33986 11768 81426 107335 11609 62454 116609 21982 102399 79719 68493 116197 31194 78250 66542 5563 50984 12242...

result:

ok answer = 300000

Test #44:

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

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:

70100 125783 55123 17698 48083 12820 126201 66659 28067 50545 20397 38802 22481 20419 2672 20828 49372 48385 8794 126676 84606 15311 44195 26357 42753 73283 75674 102388 125892 83893 129884 89065 148873 48901 87993 48126 36175 29228 23336 39708 88111 147455 130406 58264 41399 19370 55297 4373 64709 ...

result:

ok answer = 300000

Test #45:

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

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:

139605 31136 91243 83315 131646 54614 15913 92656 16961 58629 7244 2999 134586 17648 27765 5665 63532 71440 46301 79045 125701 89893 110769 29183 87531 11276 110080 37206 126961 116970 138598 104815 64688 142112 127640 80529 99151 77041 109489 23084 72753 82537 22232 62891 88675 30441 69801 24893 12...

result:

ok answer = 300000

Test #46:

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

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:

143282 52208 56849 111239 18854 92700 105331 94866 63606 110504 4468 27828 40357 15539 22159 66550 146139 53108 53672 51541 25939 31351 21766 11034 148132 17363 142917 59927 12805 36930 18029 15456 141512 68378 44029 50156 98814 25318 94199 89741 98441 91344 43790 87247 33961 68607 57674 45522 69819...

result:

ok answer = 300000

Test #47:

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

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:

110849 97484 98552 36131 113012 26441 58588 79275 34866 4229 131533 144691 2711 66095 147170 145779 71614 31261 14051 58725 58289 146000 92851 43723 102770 113558 4908 74051 17358 142227 38951 44085 125313 149278 57164 143070 83367 101732 27791 99911 96008 27414 97028 21566 11866 24807 7096 16486 38...

result:

ok answer = 300000

Test #48:

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

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

input:

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

output:

62454 62455 2069 62456 13575 62457 50125 62458 35120 62459 35121 62460 50064 62461 62462 62463 13576 13584 35128 35099 62464 13586 13590 62465 13592 62466 35109 62467 62468 62469 62470 62471 62472 35152 62473 62474 62475 62476 35154 35158 62477 2064 62478 62479 62480 35164 2107 62481 35156 62482 351...

result:

ok answer = 296054

Test #50:

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

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:

29033 47088 20140 29157 14572 99249 86283 50744 133688 109188 112094 36348 72841 21703 117336 117276 94988 56277 29098 53121 44693 14164 20164 94997 90555 131182 68061 133689 10390 93412 73271 129911 14392 11305 20287 40973 36284 72710 53095 44666 95941 79320 20301 76650 113552 36242 133690 125281 1...

result:

ok answer = 290604

Test #51:

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

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:

8091 59934 78304 72732 72510 22130 71445 114958 62854 140797 144043 86095 53677 6422 120843 82485 24432 46324 86232 77925 61892 127798 121825 33937 131613 107621 48425 130143 16477 87291 146479 60669 71719 65893 37552 23246 54336 144895 99386 6881 112914 74386 82216 77987 111752 106476 86268 112539 ...

result:

ok answer = 299989

Test #52:

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

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:

62706 129328 111692 126761 75684 121848 5004 34534 70547 100799 149686 7175 125474 47242 136761 113520 127922 110906 44702 61375 121443 62375 28255 10743 140637 91724 112382 80665 144011 87472 144306 23537 35878 140371 4173 125060 78498 24359 69120 9804 24703 29157 95043 47324 82410 10552 97100 6541...

result:

ok answer = 299998

Test #53:

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

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:

87011 64701 121245 29597 138149 93337 107559 30447 139983 28781 41605 138211 66141 87036 75476 32789 89796 22887 8279 97699 130298 54632 22125 15927 72406 38097 72817 81618 47955 94375 137640 93890 144582 128165 107677 88749 61076 32306 107555 21875 95905 32464 142562 86171 1430 91983 48959 29925 14...

result:

ok answer = 299999

Test #54:

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

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:

141456 2 116471 105517 82262 100418 128634 89969 128897 141189 50887 96246 98984 109344 31057 91983 72146 124949 71843 74529 129607 117132 137071 142648 49921 38510 16738 21844 122950 79443 141155 28077 45100 50342 46519 138531 45196 121021 142094 27969 62597 83778 130595 140613 149721 35657 111660 ...

result:

ok answer = 300000

Test #55:

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

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:

124205 55914 534 17941 133581 98300 66384 130009 53042 74066 20835 64745 73415 3618 45681 131128 38751 11884 140467 54012 149390 28608 101538 78254 69704 112108 28976 102946 94181 138373 94625 129537 410 49778 140118 30023 25348 129986 29250 60594 108576 144436 80696 86848 97455 136709 22901 24738 3...

result:

ok answer = 300000

Test #56:

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

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:

137566 41222 45934 3608 116318 119038 39613 110863 49720 57289 77534 145934 26476 11327 123164 3976 36098 29216 96608 58440 114705 126203 133957 100180 102053 136041 145329 132560 68586 63894 119767 1119 123725 119518 17157 93097 126262 131926 123704 84166 18918 136285 89468 136416 142771 80190 7237...

result:

ok answer = 300000

Test #57:

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

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:

63520 39721 112227 40750 58935 116067 131077 22831 133376 81659 79978 45499 88391 10551 80891 146956 149172 24678 57497 111932 51618 143003 57302 22585 78968 3023 106181 108072 141055 120912 97373 86570 12173 19002 11644 75399 24596 131896 78687 63101 75304 96003 102478 48510 43957 31519 126164 7338...

result:

ok answer = 300000

Test #58:

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

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:

101528 3760 105988 69108 53788 69295 78689 65329 136795 137424 45471 68572 95632 7645 33497 68327 122190 22909 29983 63164 26481 112775 86489 96214 116241 108412 29639 18203 30466 148523 63352 116932 40199 19334 98950 64888 101414 120971 114271 15410 131985 79475 108688 79882 94161 36757 20854 10217...

result:

ok answer = 300000

Test #59:

score: 0
Accepted
time: 25ms
memory: 20332kb

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

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:

58097 62547 40067 62548 40109 62549 40078 62550 62551 35640 62552 62553 40085 62554 39969 62555 62556 62557 2801 62558 62559 62560 62561 62562 62563 62564 62565 62566 62567 33025 55287 62568 40021 62569 39980 39987 39992 39998 62570 2376 62571 40281 40283 62572 40289 40163 62573 62574 35944 62575 55...

result:

ok answer = 148740

Test #61:

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

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:

20924 20958 113933 70263 120832 46052 56652 71855 107689 54459 28775 47393 29564 78378 117542 63477 82118 54595 98790 54361 72057 82058 97929 53931 25850 133778 124992 56824 63423 100329 99061 64300 131296 66749 113834 128791 51356 27874 78795 131303 133779 132970 116942 127243 46044 89227 54233 111...

result:

ok answer = 275741

Test #62:

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

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:

96578 118218 50073 141801 3300 40174 88640 109504 115307 33918 18816 106949 10412 144482 72403 3729 98974 40059 82386 66165 138935 121299 130434 148973 101349 6528 64700 23247 58675 140021 44494 52914 68933 112570 139750 92778 146295 94339 26282 18339 81653 140293 20268 122638 126675 115996 40846 81...

result:

ok answer = 299817

Test #63:

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

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:

5512 89960 37936 63912 8570 92640 138890 35669 120718 11103 24710 26542 4662 9602 95921 23030 29792 107664 9943 76317 31086 6578 140835 74391 90622 96996 113664 73952 129295 8226 6394 41788 19994 46769 13663 131299 23192 103356 53216 52316 27403 7019 16203 23411 76876 147228 40186 144473 14548 22212...

result:

ok answer = 299999

Test #64:

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

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:

138193 91711 104117 66937 132014 124749 18789 82362 79224 81543 127122 85372 34019 64888 113 111458 54343 88819 102794 72167 38629 106501 27232 20909 140850 72891 20429 15814 93395 32844 129032 11869 33173 119346 21599 39876 29179 17117 104649 111039 130636 64426 116939 5842 104583 28994 3977 133302...

result:

ok answer = 300000

Test #65:

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

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:

124613 130612 96064 87862 118302 85226 94840 98260 19907 148162 62624 66331 117263 107182 85454 106162 56919 93268 46406 92106 116269 1809 52675 130509 80416 4988 60891 94933 77576 148700 83752 101489 33519 7987 30521 92426 40509 77696 47382 34577 68108 45242 62893 108611 72748 140135 41709 26257 12...

result:

ok answer = 300000

Test #66:

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

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:

43469 81669 136288 100003 24812 22193 41210 20215 7029 4703 63867 127683 12048 48022 76620 123720 58382 13654 29391 85164 92590 138210 123408 58464 146852 61897 115570 138731 55921 133522 95436 54186 43511 91896 116898 45648 113216 104625 18391 84863 9937 38062 24934 143120 28742 61583 97374 97878 1...

result:

ok answer = 300000

Test #67:

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

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:

140286 145208 143991 59224 20923 124745 15552 53224 101529 71503 116050 46672 5277 100340 126777 121719 81117 12328 141450 126590 24271 16635 23669 108836 16276 136926 30738 69210 131607 111249 16477 80869 45856 54011 39659 52383 64791 142494 12481 128298 51446 89521 120087 8294 88075 92679 149569 4...

result:

ok answer = 300000

Test #68:

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

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:

84596 41461 61558 36017 133232 79285 20059 60526 36531 140412 23413 83469 104408 94415 38540 10646 40174 105710 113190 88806 111181 17788 108825 135126 106192 117515 102873 92977 146485 129348 73289 8445 135213 56949 45972 107112 59344 15362 37685 86647 116452 56043 60470 102480 78347 28917 137229 1...

result:

ok answer = 300000

Test #69:

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

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:

7069 118086 108037 123270 48694 18956 98322 123894 14752 76018 102790 145317 63940 1358 121501 97296 136924 61415 68158 63750 83943 32188 11959 58052 76110 27783 49326 57092 2663 58705 30506 63951 87148 102352 65807 66207 134794 13597 1864 48230 118886 92285 62679 134927 116339 19174 1435 78976 9541...

result:

ok answer = 300000

Test #70:

score: 0
Accepted
time: 31ms
memory: 19064kb

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: 23ms
memory: 16024kb

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:

39667 8885 62573 34043 62574 34042 62575 62576 34048 8886 62577 8887 59052 62578 62579 8888 8889 8890 62580 8891 62581 8892 62582 62583 62584 8893 8894 34063 62585 34064 8895 62586 62587 62588 62589 8896 62590 8897 8913 34024 18412 8899 18392 62591 62592 8900 55415 62593 62594 34012 8901 8902 62595 ...

result:

ok answer = 297533

Test #72:

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

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:

81137 89461 89669 37751 67158 44991 65954 56469 121282 98813 45781 96375 131161 93384 114309 36264 116146 131191 100423 120791 12040 93394 93395 110731 133576 56256 66179 72216 20649 133577 40562 120816 12567 53179 12577 56497 95050 20758 53305 652 28259 11652 67268 133578 1119 120815 36774 117385 9...

result:

ok answer = 278039

Test #73:

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

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:

133484 137686 113792 88891 102280 23206 109832 127596 141466 29550 72036 110785 17390 21924 26786 146623 72387 149173 81321 137094 129538 39175 38856 139417 110476 92637 94748 7581 66779 78196 57022 33945 85267 100101 12536 113288 149395 26470 134335 112379 77732 21187 34630 42903 15311 129562 11272...

result:

ok answer = 299938

Test #74:

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

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:

60349 36575 58130 101065 100810 9275 103505 45346 98148 117344 7565 62826 12226 100784 105050 124547 133287 128520 15764 28305 94831 86042 86705 22297 17581 10681 124689 8559 18707 121627 30427 120627 114773 142252 32952 94393 142395 33573 96394 74628 93311 51988 62485 116008 9008 50818 66788 98153 ...

result:

ok answer = 299996

Test #75:

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

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:

38579 38338 4605 33974 147891 107084 40373 95633 74615 127660 72390 133666 106334 42126 148055 117181 70831 120131 137621 5635 145353 98766 65568 49582 44957 38525 52886 3816 67745 94883 42864 88589 10918 7145 108451 40794 60503 73758 91416 67196 61643 105439 90141 25406 127065 3356 86305 60927 1305...

result:

ok answer = 300000

Test #76:

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

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:

111479 140177 85891 87324 47485 147423 116140 38070 64969 117409 149680 25924 10656 128563 133233 139056 117070 87740 91 109906 12277 97954 1645 122540 25823 23171 75492 13003 82749 53176 14969 147680 61370 14878 85827 16641 94381 50230 95888 133549 78555 131610 104807 82489 127423 105505 118697 128...

result:

ok answer = 300000

Test #77:

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

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:

148778 103173 141534 24198 45486 140904 72139 8125 62944 24480 98587 44237 56562 73971 20503 45231 118210 10420 18106 126118 112415 56018 119586 85375 5937 70307 25895 81770 115564 47673 13409 63233 37345 48720 59344 131254 16285 140228 85118 114461 44301 64214 86156 86580 88848 3049 53923 85706 896...

result:

ok answer = 300000

Test #78:

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

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:

108573 45100 8910 140177 109651 119317 14425 50415 147280 64086 2094 141734 149349 142166 143261 130181 101160 128012 2988 63875 128950 31883 97169 107339 99219 145176 11560 101456 113466 82399 40230 92799 81170 81065 83502 95737 44219 149900 18124 82326 80354 4337 60886 141953 103910 34005 20614 12...

result:

ok answer = 300000

Test #79:

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

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:

22662 17999 70141 125355 126444 125124 2914 122936 35047 89850 143748 82229 62897 444 141456 1335 60423 111330 79637 5617 141528 5530 60390 77331 69182 101297 20327 34962 79763 33781 96492 81241 80289 64228 110108 69590 23927 84757 100844 108848 26707 82603 11464 20494 33661 116895 10622 64180 14296...

result:

ok answer = 300000

Test #80:

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

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:

143495 88092 86944 149261 55156 106326 69283 96699 14690 99265 16957 38641 30949 143893 149701 141001 44715 55102 7835 12651 68180 101731 111193 117940 50505 82188 45011 83730 137395 343 69491 38772 85290 121242 43487 9360 267 60622 137311 19686 95701 146449 135400 121980 90176 11318 92730 15331 147...

result:

ok answer = 300000

Test #81:

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

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: 29ms
memory: 15224kb

input:

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

output:

0 8981 942 8982 0 0 0 0 8983 0 0 0 0 0 0 8984 8985 0 8986 0 0 0 0 0 0 0 0 0 959 0 0 964 0 968 8987 0 0 0 0 8988 8989 0 0 0 0 0 0 0 0 876 0 0 8990 1134 0 8991 0 0 0 1110 0 8992 0 0 0 0 0 0 0 0 8993 9009 0 8995 0 8996 8997 0 0 0 8998 8999 0 0 0 0 0 0 0 0 0 0 0 0 1066 9000 0 0 9001 0 0 0 9002 0 9003 90...

result:

ok answer = 48024

Test #83:

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

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:

99230 71393 101764 23672 0 0 84891 17225 18740 82791 69096 91317 53691 79566 0 0 29486 75959 0 75087 49313 88249 0 51976 88063 23791 0 0 17294 18477 25628 0 60479 17900 0 0 53823 95859 0 0 93623 30279 0 0 0 53945 18357 0 54705 101503 0 36722 27895 30337 0 54441 0 83144 62819 30151 93802 0 0 53867 0 ...

result:

ok answer = 209982

Test #84:

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

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 0 0 39792 0 0 38809 39694 0 0 0 42714 0 0 9788 0 0 0 0 0 0 3041 0 0 35471 17545 45906 0 7834 0 0 36767 0 0 0 0 0 0 9411 41420 24770 35584 0 4473 0 13855 0 0 0 28700 0 0 0 10814 0 17110 0 0 0 0 0 0 42871 0 4336 0 16026 31536 0 0 0 0 0 13389 0 0 0 28621 26017 37358 0 0 20877 0 0 22483 0 0 6441 972 0...

result:

ok answer = 94122

Test #85:

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

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:

0 0 0 0 0 0 15806 0 14297 0 0 0 8330 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 18498 14057 0 0 4103 0 0 13359 0 0 0 0 10971 0 1405 0 0 0 0 0 22438 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 14390 0 0 2808 0 0 0 0 0 0 0 0 0 0 0 19759 6734 0 0 0 4610 0 0 0 0 0 ...

result:

ok answer = 48086

Test #86:

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

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:

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1281 0 0 8791 0 0 0 0 0 35519 0 0 0 0 0 0 24575 0 0 0 26415 32111 0 16491 0 0 0 0 34377 0 0 0 38275 0 0 0 0 31023 12623 0 20569 8608 8963 9189 15985 0 0 0 0 0 0 0 37291 25065 0 5789 0 0 31704 0 0 0 0 0 0 14423 8959 4442 0 0 20904 31869 0 0 21082 ...

result:

ok answer = 78394

Test #87:

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

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 7365 0 0 0 8228 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3393 0 0 0 0 0 0 0 0 0 0 0 8254 669 0 0 0 0 0 0 0 0 1988 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11272 0 0 0 0 0 0 0 0 10166 0 0 0 0 0 0 11161 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8699 0 0 0 0 0 11414 0 9372 0 0 0 0...

result:

ok answer = 24016

Test #88:

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

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 16510 17452 0 0 0 0 0 0 27378 46430 0 0 0 0 0 24179 0 20331 47703 17857 29508 18832 32299 0 0 39958 0 0 0 37113 0 27010 0 0 0 42944 41807 0 0 0 0 0 0 44199 0 0 4399 0 0 27024 0 39329 27720 0 0 0 22150 0 0 0 4741 0 25151 45660 31597 0 0 0 0 4821 43654 47915 15240 0 17339 0 0 12298 0 40266 0 0 0 1...

result:

ok answer = 103886

Test #89:

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

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:

69979 0 19464 78110 29589 0 0 0 0 27333 0 0 38268 6264 0 86203 16702 8159 12391 0 0 8068 86222 0 13816 5599 63641 6704 20704 0 0 0 0 37208 83338 0 78547 78702 58041 31499 0 6710 46561 0 86171 0 38104 17393 0 0 73937 17553 0 0 0 33800 0 38709 21782 0 72811 25678 0 41184 0 82659 0 24392 16439 0 1585 3...

result:

ok answer = 184372

Test #90:

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

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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3747 0 0 0 0 0 2901 0 0 0 0 0 0 0 0 4960 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 362 0 0 0 0 0 0 0 0 0 0 0 0...

result:

ok answer = 10202

Test #91:

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

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:

0 0 0 34821 0 0 0 0 0 20340 0 0 0 32330 0 17402 0 0 41845 1017 0 0 9961 0 0 0 5483 39414 11272 42822 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 33432 0 0 0 0 2908 0 0 36898 0 0 0 0 0 0 0 34621 39894 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1895 0 0 0 0 0 0 18993 25467 0 0 22479 476 28267 0 0 0 0 23587 0 0 0 0 0 0 0 24510...

result:

ok answer = 90686

Test #92:

score: 0
Accepted
time: 28ms
memory: 20484kb

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

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:

67701 63667 54508 55759 55147 55140 55292 55337 55727 55319 55302 55308 67773 67366 67755 67749 54528 67308 67294 67709 67695 67689 67678 67667 60835 60463 60443 60895 60807 60374 61509 57469 30673 79331 79319 79281 105375 53653 53280 53607 51832 51465 51805 51430 51788 51404 51394 30695 54686 54938...

result:

ok answer = 300000

Test #94:

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

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:

57026 50465 26749 26473 26468 26465 26457 26454 29156 29155 29153 29152 23772 23767 23756 23751 24226 21829 24351 24071 24065 24062 24056 24053 24164 25351 25346 25343 25953 25951 24643 24633 22145 20560 20554 20547 21157 21151 20875 20860 20245 20239 20234 20231 20360 20357 20355 20068 20567 22138 ...

result:

ok answer = 300000

Test #95:

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

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:

63276 45498 22114 22159 22158 22157 22156 22800 22758 22797 22796 22718 20878 20796 20276 20244 20560 23596 21518 21517 21516 21439 19506 18996 18965 18963 18962 20240 20239 20237 20236 20146 24716 27285 27557 25959 25958 25925 25998 25997 26640 26639 26638 26637 26636 24720 24675 24717 27918 24565 ...

result:

ok answer = 300000

Test #96:

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

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:

76441 94274 78170 78178 78186 78193 76409 78215 78163 78224 78151 76426 76430 76435 73084 76428 78284 78277 76451 72801 77992 78003 78013 76330 76336 72756 72770 78051 76347 72678 76356 76361 72849 78105 72870 78119 78126 76383 78148 78237 76539 76542 78504 76547 78521 73464 78534 78546 78551 78482 ...

result:

ok answer = 300000

Test #97:

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

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:

108620 100205 67392 67778 67395 67785 67399 67401 67404 67405 67387 67787 67790 67410 67794 67416 67789 67418 67799 67368 67351 67757 67756 67357 67358 67760 67362 67764 67367 67753 67369 67767 67372 67374 67377 67771 67381 67775 67774 67407 67812 67461 67822 67465 67468 67470 69334 69691 69336 6745...

result:

ok answer = 300000

Test #98:

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

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:

116087 91083 64064 64066 64067 64385 64400 64383 64377 64381 64096 63768 63774 63727 63775 63779 63731 63769 63734 63478 63265 63296 63589 63565 63573 63575 63572 63548 63524 63263 63426 63477 63481 63430 63482 63434 63475 63484 63438 64278 63888 63872 63887 63877 63841 63842 63860 63893 63861 63835...

result:

ok answer = 300000

Test #99:

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

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:

20573 145360 111986 115100 118832 111968 119318 111993 111991 115103 116319 115102 119316 115105 111996 111992 112001 115107 115106 112554 119321 118846 119322 112004 111921 111946 115083 119312 111953 111960 113878 111964 111961 111956 115085 111944 115143 115080 115089 115090 119314 111978 111976 ...

result:

ok answer = 300000

Test #100:

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

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:

17337 1525 117768 117042 117213 117457 117017 117669 117897 117896 117895 116480 117779 116485 116488 116489 116487 116490 116491 116238 116043 116021 116494 116492 117778 117775 117588 117386 117590 117585 117583 117384 117776 117777 117354 117389 117593 117774 117387 117824 117591 117595 117547 11...

result:

ok answer = 300000

Test #101:

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

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:

16737 175 116535 116501 116530 116509 116547 116533 116529 116531 116585 116583 116545 116591 116584 116537 116567 116561 116565 116448 116453 116484 116426 116422 116521 117130 117103 117165 117199 117119 117113 117112 117099 117043 117024 117035 116543 117129 116525 116524 116503 116511 116544 116...

result:

ok answer = 300000

Test #102:

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

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:

38850 135833 9429 9428 9427 9426 9425 9424 9423 9422 9421 9420 9419 9405 9417 9416 9415 9414 9413 9412 9411 9410 9409 9408 9407 9406 9418 9453 9452 9451 9450 9449 9448 9447 9446 9445 9444 9443 9430 9441 9440 9439 9438 9437 9436 9435 9434 9433 9432 9431 9393 9380 9379 9378 9377 9376 9375 9374 9373 93...

result:

ok answer = 300000

Test #103:

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

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:

18850 9975 126430 126450 126454 126459 126448 126455 120057 126435 126441 120068 121329 127605 127604 127421 126458 120088 126453 126464 126468 126471 126465 126469 127606 126461 126400 126403 120035 126460 126421 126423 126426 126417 120045 126413 126429 127599 126437 120044 126433 126422 127596 12...

result:

ok answer = 300000

Test #104:

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

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:

16315 975 117284 117964 117277 117281 117289 117965 117561 117278 117264 117530 117573 117522 117563 117967 117570 117286 117575 117830 117191 117519 117305 117968 117304 117282 117039 117700 117824 117043 117186 117238 117961 117739 117727 117550 117822 117268 117526 117084 117962 117260 117255 117...

result:

ok answer = 300000

Test #105:

score: 0
Accepted
time: 33ms
memory: 16960kb

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:

16615 75 116720 116790 116771 116715 116706 116784 116716 116717 116725 116798 116604 116676 116637 116678 116700 116605 116645 116688 116689 116690 116642 116681 116647 116747 116744 116769 116789 116768 116704 116779 116712 116740 116745 116702 116754 116770 116795 116728 116713 116743 116701 1167...

result:

ok answer = 300000

Test #106:

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

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:

104745 74991 31041 31043 31044 31050 31051 31053 31054 31057 31040 31060 31061 31065 31066 31068 31069 31072 31073 31022 31005 31006 31009 31010 31012 31013 31018 31019 31021 31003 31025 31026 31028 31029 31033 31034 31036 31037 31058 31150 31154 31157 31162 31165 31169 31172 31178 31147 31185 31188...

result:

ok answer = 300000

Test #107:

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

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:

92776 74993 42750 42751 42752 42753 42754 42755 42756 42757 42749 42759 42760 42761 42762 42763 42764 42765 42766 42740 42731 42732 42733 42734 42735 42736 42737 42738 42739 42730 42741 42742 42743 42744 42745 42746 42747 42748 42758 42786 42787 42788 42789 42790 42791 42792 42793 42785 42795 42796 ...

result:

ok answer = 300000

Test #108:

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

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:

109546 74977 59983 59984 59985 59986 59987 59988 59989 59990 59982 59992 59993 59994 59995 59996 59997 59998 59999 59973 59964 59965 59966 59967 59968 59969 59970 59971 59972 59963 59974 59975 59976 59977 59978 59979 59980 59981 59991 40019 40020 40021 40022 40023 40024 40025 40026 40018 40028 40029...

result:

ok answer = 300000

Test #109:

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

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:

100998 75998 50983 50984 50985 50986 50987 50988 50989 50990 50982 50992 50993 50994 50995 50996 50997 50998 50999 50973 50964 50965 50966 50967 50968 50969 50970 50971 50972 50963 50974 50975 50976 50977 50978 50979 50980 50981 50991 49019 49020 49021 49022 49023 49024 49025 49026 49018 49028 49029...

result:

ok answer = 300000

Test #110:

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

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:

100100 75098 50083 50084 50085 50086 50087 50088 50089 50090 50082 50092 50093 50094 50095 50096 50097 50098 50099 50073 50064 50065 50066 50067 50068 50069 50070 50071 50072 50063 50074 50075 50076 50077 50078 50079 50080 50081 50091 49919 49920 49921 49922 49923 49924 49925 49926 49918 49928 49929...

result:

ok answer = 300000

Test #111:

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

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:

100004 75030 50013 50014 50015 50016 50017 50018 50019 50020 50012 50002 50003 50004 50005 50006 50007 50008 50009 50023 50034 50035 50036 50037 50038 50039 50040 50021 50022 50033 50024 50025 50026 50027 50028 50029 50030 50011 50001 49989 49990 49971 49972 49973 49974 49975 49976 49988 49978 49979...

result:

ok answer = 300000

Test #112:

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

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:

100007 50017 50018 50015 50016 50013 50014 50011 50012 50020 50010 50007 50008 50005 50006 50003 50004 50001 50027 50038 50035 50036 50033 50034 50031 50032 50029 50030 50037 50028 50025 50026 50023 50024 50021 50022 50019 50009 49981 49982 49979 49980 49977 49978 49975 49976 49984 49974 49971 49972...

result:

ok answer = 300000

Test #113:

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

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:

100008 50018 50017 50016 50015 50014 50013 50012 50011 50019 50009 50008 50007 50006 50005 50004 50003 50002 50028 50037 50036 50035 50034 50033 50032 50031 50030 50029 50038 50027 50026 50025 50024 50023 50022 50021 50020 50010 49982 49981 49980 49979 49978 49977 49976 49975 49983 49973 49972 49971...

result:

ok answer = 300000

Test #114:

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

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:

99998 74991 99999 100000 100001 100002 100003 100004 99996 100006 100007 100008 100009 100010 100011 100012 100013 99987 99978 99979 99980 99981 99982 99983 99984 99985 99986 99977 99988 99989 99990 99991 99992 99993 99994 99995 100005 100033 100034 100035 100036 100037 100038 100039 100040 100032 1...

result:

ok answer = 299999

Test #115:

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

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

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 149998 1 2 149998 149999 2 149997 149999 149995 149997 3 149995 149996 3 149994 149996 149993 149994 149992 149993 149991 149992 149990 149991 149988 149990 4 149988 149989 4 149987 149989 149986 149987 149985 149986 149984 149985 149983 149984 149982 149983 149981 149982 149980 149981 1499...

result:

ok answer = 299999

Test #117:

score: 0
Accepted
time: 44ms
memory: 20512kb

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 149999 149999 2 2 150000 150000 149998 149998 149996 149996 3 3 149997 149997 149995 149995 149994 149994 149993 149993 149992 149992 149991 149991 149989 149989 4 4 149990 149990 149988 149988 149987 149987 149986 149986 149985 149985 149984 149984 149983 149983 149982 149982 149981 149981 1499...

result:

ok answer = 300000

Test #118:

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

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:

94716 54610 1579 56750 127761 133357 33705 113678 52943 129127 123528 2329 86146 33997 82881 34008 112116 57553 130561 9644 113685 102297 133358 110683 111005 65818 95067 58366 54618 97662 133359 61444 93886 131323 109549 53353 84020 54620 482 130975 122165 54587 92958 49593 131145 114224 6241 93975...

result:

ok answer = 285014

Test #119:

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

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:

49595 76855 49643 13410 122383 51532 69554 73564 123567 133843 122435 111013 47525 13457 109227 65033 101425 100816 61779 66685 22123 126728 21556 84543 132132 128714 47676 84564 88453 123574 81264 6291 81617 133844 22415 133845 8494 51601 91596 73906 84690 21658 109178 13432 133846 47745 13414 1175...

result:

ok answer = 294859

Test #120:

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

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:

101190 60271 111043 44766 133690 12940 123912 44764 133099 113774 2579 128770 81411 128719 53913 77655 8328 53867 12908 93892 103032 93531 53987 4399 44785 63554 133691 133692 70301 71758 12944 93737 118540 84015 133693 58849 72763 21534 23435 59632 44751 44758 133694 133695 53861 77319 44761 23639 ...

result:

ok answer = 290984

Test #121:

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

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:

55227 34035 77638 68765 96433 131443 133719 57052 133720 55213 133721 96687 54534 100454 73551 132535 54666 127668 38080 56167 24771 17885 133722 2928 2959 23740 133723 762 103064 58014 54656 59831 15657 2911 133724 22251 33147 94472 55214 102069 53119 756 52198 27392 41014 3470 133725 133349 133726...

result:

ok answer = 286318