QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#446647#6413. Classical Graph Theory ProblemcqbzlyAC ✓133ms39456kbC++144.6kb2024-06-17 14:43:092024-06-17 14:43:09

Judging History

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

  • [2024-06-17 14:43:09]
  • 评测
  • 测评结果:AC
  • 用时:133ms
  • 内存:39456kb
  • [2024-06-17 14:43:09]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define fi first
#define se second
#define vi vector<int>
#define inf 0x3f3f3f3f
using namespace std;
const int N=5e5+5;
int T,n,m,du[N],cnt[N],vs[N],to[N],vs0[N];
bool o;
struct node{
    int u,v;
}q[N];
struct node0{
    int u,v,i;
};
mt19937 gen(114514);
vector<int>pos[N];
vector<int>v1,v2,v3,st;
vector<node0>vec;
int get(int u,int i=0){
    int j=0;
    while(vs[pos[u][j]]||pos[u][j]==i)j++;
    return pos[u][j];
}
bool check(int u,int i){
    if(du[u]==1)return 0;
    if(du[u]>2)return 1;
    int x=get(u,i);
    if(cnt[q[x].u^q[x].v^u]==2)return 0;
    return 1;
}
void del(int u){
    int x=get(u);
    to[u]=q[x].u^q[x].v^u;
    if(++cnt[to[u]]>2)o=0;
}
// void output(int x){
// 	for(auto e:pos[x]){
// 		if(!vs[e]){
// 			cerr<<"edge:"<<q[e].u<<" "<<q[e].v<<" "<<cnt[q[e].u]<<" "<<cnt[q[e].v]<<" "<<du[q[e].u]<<" "<<du[q[e].v]<<"\n";
// 		}
// 	}
// }
int main(){
    //freopen("data.in","r",stdin);
    //freopen("own.out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    cin>>T;
    while(T--){
        cin>>n>>m;
		//cerr<<n<<" "<<m<<"\n";
        for(int i=1;i<=n;i++)du[i]=cnt[i]=to[i]=0,pos[i].clear();
        for(int i=1;i<=m;i++){
            int u,v;cin>>u>>v;
            du[u]++,du[v]++,vs[i]=0;
            pos[u].pb(i),pos[v].pb(i);
            q[i]={u,v};
        }
        for(int i=1;i<=m;i++){
            int u=q[i].u,v=q[i].v;
            if(du[u]==1)cnt[v]++,to[u]=v;
            if(du[v]==1)cnt[u]++,to[v]=u;
        }
		// for(int i=1;i<=n;i++){
		// 	assert(cnt[i]<=2);
		// }
        for(int i=1;i<=m;i++){
            int u=q[i].u,v=q[i].v;
			if(du[u]==1||du[v]==1)continue;
			vs[i]=1,du[u]--,du[v]--;
			o=1;
			if(du[u]==1)del(u);
            if(du[v]==1)del(v);
            if(!o){
                if(du[u]==1)cnt[to[u]]--;
				if(du[v]==1)cnt[to[v]]--;
				vs[i]=0,du[u]++,du[v]++;
            }
            // else{
            //     cout<<u<<" "<<v<<"\n";
            // }
        }
        // for(int i=1;i<=m;i++){
        //     int u=q[i].u,v=q[i].v;
        //     // if(!vs[i]&&check(u,i)&&check(v,i)){
        //     //     assert(0);
        //     // }
        // }
        v1.clear(),v2.clear(),v3.clear(),vec.clear(),st.clear();
        for(int i=1;i<=n;i++){
            if(cnt[i]==2){
                v3.pb(i);
            }
            else if(cnt[i]==0&&du[i]>1){
                //assert(du[i]==2);
                //cout<<"find:"<<i<<"\n";
                int j=get(i),k=get(i,j),u=q[j].u^q[j].v^i,v=q[k].u^q[k].v^i;
                vec.pb({u,v,i});
            }
            // else if(cnt[i]==1){
            //     assert(du[i]==1);
            // }
            // else if(cnt[i]==0&&du[i]==1){
			// 	if(cnt[to[i]]!=2){
			// 		cerr<<"WA"<<"\n";
			// 		int x=to[i];
			// 		output(x);
			// 		return 0;
			// 	}
            //     assert(cnt[to[i]]==2);
            // }
        }
        for(int i=1;i<=(v3.size()+1)/2;i++)st.pb(0);
        for(int i=1;i<=v3.size()/2;i++)st.pb(1);
        // for(auto e:vec){
        //     cout<<e.u<<" "<<e.v<<" "<<e.i<<"\n";
        // }
        //for(auto e:v3)cout<<e<<" ";cout<<"\n";
        //cout<<st.size()<<"\n";
        while(1){
            shuffle(st.begin(),st.end(),gen);
            for(int i=0;i<st.size();i++)vs0[v3[i]]=st[i];
            int cnt1=0,cnt2=0;
            for(auto e:vec){
                if(vs0[e.u]!=vs0[e.v])cnt1++;
                else cnt2++;
            }
            if(cnt1>=cnt2){
                for(auto e:v3){
                    if(!vs0[e])v1.pb(e);
                    else v2.pb(e);
                }
                for(int i=1;i<=n;i++){
                    if(cnt[i]==0&&du[i]==1){
                        if(vs0[to[i]])v1.pb(i);
                        else v2.pb(i);
                    }
                }
                for(auto e:vec){
                    if(vs0[e.u]==vs0[e.v]){
                        if(vs0[e.u])v1.pb(e.i);
                        else v2.pb(e.i);
                    }
                }
                for(auto e:vec){
                    if(vs0[e.u]!=vs0[e.v]){
                        if(v1.size()<v2.size())v1.pb(e.i);
                        else v2.pb(e.i);
                    }
                }
                break;
            }
        }
        for(int i=1;i<=n;i++){
            if(cnt[i]==1){
                //assert(cnt[to[i]]==1);
                if(i<to[i])v1.pb(i);
                else v2.pb(i);
            }
        }
        for(auto e:v1)cout<<e<<" ";
        cout<<"\n";
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2
6 7
1 2
1 3
2 3
3 4
4 5
4 6
5 6
3 2
1 2
2 3

output:

3 4 5 
2 

result:

ok ok (2 test cases)

Test #2:

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

input:

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

output:

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

result:

ok ok (10000 test cases)

Test #3:

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

input:

1000
337 338
164 11
138 75
114 262
170 298
166 241
269 24
9 134
233 60
50 222
231 253
296 242
173 18
93 223
116 151
312 150
82 236
180 20
297 184
268 70
334 162
217 135
258 321
80 209
212 208
18 163
227 104
334 135
77 118
17 230
307 105
307 335
29 24
111 177
324 24
85 3
214 191
310 182
22 171
202 21...

output:

11 16 19 24 30 33 42 43 46 64 94 107 119 130 142 149 153 156 158 187 189 232 233 236 263 273 276 4 13 14 38 39 51 53 59 61 63 69 71 72 76 78 81 87 99 101 102 114 125 126 133 138 145 147 152 155 160 162 165 180 185 190 191 194 200 202 226 228 245 255 265 270 275 285 288 293 298 310 324 329 333 1 3 5 ...

result:

ok ok (1000 test cases)

Test #4:

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

input:

100
1038 1044
206 546
372 853
526 57
777 72
645 866
15 716
254 707
366 753
635 809
850 407
616 149
839 175
320 770
649 686
857 798
1027 40
988 566
315 500
187 615
100 523
867 708
51 381
858 9
177 55
310 54
355 215
78 26
740 570
523 797
828 693
930 981
208 185
663 957
298 523
235 496
622 174
285 247
...

output:

6 12 14 33 42 45 50 65 81 117 151 155 173 185 198 202 216 246 255 265 279 283 288 340 349 359 367 404 418 426 445 450 483 497 512 523 535 542 552 560 577 589 600 610 615 625 628 632 638 648 670 680 682 706 707 727 733 751 754 756 767 789 798 805 809 822 828 830 837 866 871 883 897 898 913 914 919 94...

result:

ok ok (100 test cases)

Test #5:

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

input:

10
1380 1393
960 647
1319 708
57 1128
751 148
1291 602
835 921
942 406
622 616
967 91
555 545
871 10
447 471
1140 306
149 121
587 165
1179 936
256 787
332 374
729 129
631 481
976 86
1128 1300
477 776
460 313
538 632
1210 275
355 470
1324 885
870 1325
389 979
468 532
41 416
1026 243
1153 152
948 323
...

output:

4 31 37 43 44 47 71 86 89 105 108 113 119 120 127 128 143 164 229 230 258 271 289 290 301 303 312 322 341 370 372 376 378 398 401 433 436 437 442 462 464 470 474 499 534 541 607 615 623 642 653 660 706 707 711 713 724 734 745 748 762 783 787 788 790 832 835 842 851 856 864 867 876 884 912 916 920 92...

result:

ok ok (10 test cases)

Test #6:

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

input:

1
200000 201978
69113 28513
94227 164392
56849 195513
22579 149089
195084 193248
121765 162768
135432 101508
107443 89723
12337 87598
173450 107835
13160 161882
18965 179808
53739 23609
114567 23456
195251 178048
61586 87664
179364 25594
90158 169714
30104 161354
143346 4279
177208 87389
122480 1269...

output:

1 3 14 23 24 41 43 58 68 99 112 115 137 139 159 161 166 167 175 196 209 215 218 219 227 237 240 253 289 293 300 318 321 336 349 362 389 417 421 427 429 445 456 464 470 472 487 491 503 504 513 544 552 553 555 565 571 576 581 585 603 622 651 652 665 695 714 723 751 757 759 769 776 778 792 793 808 828 ...

result:

ok ok (1 test case)

Test #7:

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

input:

10000
41 44
18 29
38 6
7 4
34 27
40 37
12 40
18 38
11 18
30 39
2 21
10 34
33 2
8 12
30 23
6 2
12 21
15 7
17 1
36 15
31 36
15 21
38 31
1 11
4 30
16 33
19 32
21 30
32 35
1 3
27 9
1 34
11 5
26 25
22 5
34 24
23 32
28 2
20 33
13 15
31 21
38 41
26 3
13 14
14 33
11 11
3 1
9 11
6 3
8 1
7 2
4 3
10 2
9 2
5 4
...

output:

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

result:

ok ok (10000 test cases)

Test #8:

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

input:

10000
11 13
6 3
9 4
10 4
9 6
10 7
1 5
2 11
2 8
10 6
2 9
6 7
2 5
5 11
3 2
2 1
2 3
2 1
2 1
12 14
12 11
10 7
5 6
2 5
5 8
8 3
8 1
3 12
12 7
2 10
10 11
6 4
11 2
9 3
4 4
1 2
1 3
4 3
2 3
11 13
3 7
1 5
1 6
8 5
9 7
1 2
1 11
2 4
10 9
10 1
7 2
8 3
8 6
2 1
1 2
15 18
3 11
2 10
7 14
14 4
7 3
6 11
15 12
5 11
2 7
7...

output:

2 6 1 11 4 
2 
1 
8 2 10 3 4 7 
1 3 
1 8 4 7 9 
1 
7 3 6 1 4 5 10 
1 3 4 21 47 58 18 20 23 25 28 37 38 45 54 61 8 5 6 7 9 11 12 16 17 19 24 27 30 32 36 48 52 
6 9 3 7 1 8 
6 7 8 2 
11 31 2 22 1 3 4 5 6 7 10 13 14 17 18 19 26 28 29 
50 52 57 58 62 64 68 1 5 14 25 34 41 46 49 51 70 79 80 2 3 6 8 9 11 ...

result:

ok ok (10000 test cases)

Test #9:

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

input:

10000
10 14
4 9
5 10
1 10
7 6
8 6
9 6
8 3
8 7
4 6
5 3
10 4
10 2
4 8
1 9
6 8
1 2
5 2
5 1
3 4
5 3
6 5
2 3
3 1
3 3
2 1
3 2
3 1
18 26
18 3
10 11
2 4
17 4
8 12
14 15
1 12
13 12
15 7
13 15
14 2
17 5
1 13
11 16
9 3
13 9
6 12
11 14
3 4
3 11
7 11
8 2
8 4
15 6
12 10
12 18
24 35
18 4
22 10
1 21
22 6
23 7
6 14
...

output:

1 2 3 4 7 
3 1 6 
3 
11 13 3 8 10 18 2 5 6 
4 8 11 12 23 24 1 2 5 9 10 19 
16 19 24 30 49 3 9 12 17 32 36 39 47 53 66 1 4 5 6 7 8 10 13 14 20 21 22 23 25 27 28 41 58 
5 12 2 4 7 8 
9 27 32 7 23 29 33 1 2 4 6 8 10 12 13 16 
3 8 4 7 
10 2 3 5 6 11 
16 23 30 32 34 56 60 80 7 13 18 21 22 26 36 42 43 45 ...

result:

ok ok (10000 test cases)

Test #10:

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

input:

10000
4 6
1 3
2 3
4 2
4 1
1 2
4 3
25 51
19 15
19 10
12 3
9 7
5 4
7 21
25 12
20 16
1 13
20 14
15 12
20 13
8 5
16 9
17 13
3 25
25 20
16 22
4 8
5 7
9 10
5 11
4 24
13 21
9 4
15 24
16 11
13 4
22 21
4 14
20 10
12 6
1 4
3 18
9 6
5 2
24 3
16 4
6 16
25 16
21 16
22 25
3 21
10 15
25 23
1 19
7 15
15 20
19 14
17...

output:

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

result:

ok ok (10000 test cases)

Test #11:

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

input:

10000
24 60
13 22
6 12
21 17
24 8
15 11
18 19
17 7
24 1
18 16
21 2
17 12
21 11
10 7
9 18
6 21
17 10
3 24
16 12
7 23
11 8
22 24
3 17
23 3
1 12
8 5
4 24
15 13
8 22
2 8
13 17
10 2
2 7
7 18
18 14
22 20
13 6
5 16
22 23
21 22
5 24
21 14
1 7
12 20
24 20
8 14
17 11
1 19
17 8
9 10
1 11
14 13
10 15
19 11
14 2...

output:

5 10 14 3 4 12 18 20 1 2 8 21 
3 2 
4 6 7 19 1 2 3 16 17 28 5 12 13 15 21 
6 14 22 1 2 3 4 7 9 10 17 
8 10 25 33 43 3 4 13 18 19 22 24 26 27 29 2 6 9 11 14 15 40 
4 17 7 9 16 22 1 2 3 5 13 14 
6 7 13 10 15 28 34 1 2 3 5 11 16 17 18 23 24 26 29 36 
4 11 28 10 25 26 29 3 5 7 8 13 14 16 
5 8 10 1 7 
15...

result:

ok ok (10000 test cases)

Test #12:

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

input:

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

output:

3 6 17 33 48 50 15 20 26 31 32 35 36 38 39 43 1 4 8 12 24 27 28 42 44 51 
16 26 35 44 59 9 19 20 23 27 32 37 47 3 4 5 6 7 8 10 12 14 17 21 24 25 29 33 39 
16 40 46 69 77 103 129 180 193 207 210 234 257 260 270 276 288 296 300 11 23 29 43 47 53 56 72 90 93 101 111 116 120 124 132 144 162 164 172 176 ...

result:

ok ok (1000 test cases)

Test #13:

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

input:

1000
137 178
124 131
53 109
99 21
107 122
79 28
80 88
126 9
16 1
29 55
126 54
13 39
135 16
63 56
123 121
27 74
81 95
34 38
49 85
127 135
87 106
91 68
57 124
122 113
87 1
52 104
135 93
132 12
98 83
85 26
66 76
41 82
108 90
88 59
29 15
75 58
36 14
116 65
83 64
21 105
132 13
7 70
97 127
92 112
126 55
1...

output:

4 12 23 44 49 53 55 77 108 7 24 28 42 50 61 63 76 78 81 97 104 107 113 124 127 1 2 3 5 6 9 11 13 14 15 16 17 20 21 22 26 30 32 34 35 37 38 39 40 41 45 46 47 64 65 67 69 70 72 74 75 84 86 94 98 99 114 121 
7 24 26 34 48 1 3 9 15 16 28 31 32 40 44 5 6 8 10 11 12 29 30 39 42 
15 21 26 33 38 6 10 18 24 ...

result:

ok ok (1000 test cases)

Test #14:

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

input:

1000
148 221
51 9
45 80
86 44
133 98
100 25
130 4
99 17
28 44
131 87
103 87
102 53
115 49
9 5
105 130
11 69
56 23
148 106
106 85
57 102
15 147
100 52
22 10
138 60
38 12
126 119
12 125
86 62
108 123
15 63
90 93
35 116
1 75
63 126
23 127
143 127
114 24
12 133
144 82
12 29
6 51
67 26
129 79
115 16
53 6...

output:

20 22 23 42 46 62 72 73 97 105 133 134 1 3 6 7 11 24 31 33 34 40 48 60 71 76 77 91 96 106 111 113 122 131 137 148 5 9 10 12 13 15 16 17 26 27 30 32 36 38 41 43 45 49 51 52 53 54 58 63 65 79 80 81 83 84 85 93 94 103 107 109 126 130 
5 10 35 39 11 12 18 22 34 47 2 3 4 8 9 13 14 15 16 17 23 25 26 28 37...

result:

ok ok (1000 test cases)

Test #15:

score: 0
Accepted
time: 38ms
memory: 15512kb

input:

1000
527 1061
464 254
106 364
251 82
282 81
152 454
399 114
527 289
430 519
202 320
177 302
398 55
358 181
495 240
86 426
113 171
201 262
82 336
403 77
266 21
176 132
14 97
139 137
479 397
153 403
156 308
105 28
109 272
294 170
336 508
439 105
259 101
429 441
118 200
189 56
297 184
457 385
248 334
4...

output:

17 31 41 49 62 64 81 113 120 152 168 169 178 187 231 279 303 326 346 355 359 364 367 376 387 397 404 411 418 426 444 453 454 455 457 462 469 474 492 496 514 515 3 33 39 42 50 53 56 66 79 80 91 101 102 104 117 125 131 132 134 138 143 163 167 177 182 184 189 191 200 205 206 208 213 219 221 226 229 233...

result:

ok ok (1000 test cases)

Test #16:

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

input:

1000
24 59
14 16
17 22
19 4
3 21
15 11
4 15
24 6
12 18
15 19
6 17
6 3
19 6
17 18
24 12
3 8
13 8
3 19
22 19
20 18
2 14
16 9
22 15
19 8
22 4
10 7
11 3
22 3
8 12
11 17
24 13
8 21
22 9
13 18
9 12
19 5
10 22
23 3
21 20
4 24
1 15
21 23
18 7
5 22
1 11
22 16
16 24
1 20
20 4
5 23
10 3
7 8
20 9
9 6
23 24
14 9...

output:

9 23 11 13 22 24 1 2 3 4 7 17 
10 28 38 41 52 78 87 90 93 108 111 126 6 8 21 23 33 35 37 42 44 51 62 64 65 69 72 74 76 84 92 101 106 117 120 124 4 7 9 14 18 24 29 31 32 36 39 40 43 46 47 48 49 53 54 57 59 73 75 79 83 100 114 
24 25 46 89 100 106 117 126 153 155 167 172 190 213 214 216 227 229 242 25...

result:

ok ok (1000 test cases)

Test #17:

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

input:

100
1400 1550
949 973
216 1089
101 284
568 543
878 648
1125 1117
1052 486
1260 1161
1397 54
1005 922
483 168
202 152
899 685
978 388
1223 1178
1109 239
932 415
105 28
596 251
357 865
842 224
887 1053
304 484
697 780
1164 193
411 798
1267 1395
40 166
21 1027
814 742
905 354
1332 1346
86 1274
726 73
4...

output:

41 77 107 116 121 123 133 157 160 171 190 204 228 232 248 252 265 297 326 331 343 353 355 385 386 398 418 419 445 465 473 488 515 525 551 566 593 611 632 634 635 657 691 692 694 696 701 708 724 747 751 754 759 773 799 809 811 813 818 830 842 847 849 854 867 882 905 908 931 950 951 966 971 977 985 99...

result:

ok ok (100 test cases)

Test #18:

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

input:

100
15151 19865
9599 11515
2453 4807
12417 12980
8787 12984
2666 3990
7030 3605
13780 1990
6564 14035
12745 5300
9179 9047
1105 8795
13193 2009
2347 3783
4282 2640
8744 2083
12968 1734
111 1688
14899 11212
11013 15151
4326 6532
9261 10694
8013 10608
8980 9408
379 3570
5827 13496
273 14106
1090 12649...

output:

6 12 13 26 27 65 67 72 107 129 170 186 204 226 230 260 267 270 276 287 289 305 362 364 369 387 391 405 411 419 459 460 462 473 475 480 535 552 556 558 595 611 624 625 635 643 648 651 664 678 692 694 700 704 708 715 724 746 777 821 832 841 843 848 865 871 879 884 900 931 945 947 952 973 982 991 993 9...

result:

ok ok (100 test cases)

Test #19:

score: 0
Accepted
time: 38ms
memory: 16376kb

input:

100
1387 2091
632 868
379 1372
1247 788
72 562
1014 374
677 436
478 1033
997 896
1016 925
291 450
458 392
91 65
380 135
318 757
471 281
390 874
752 953
401 688
978 284
1276 639
565 1356
368 1259
673 639
283 551
647 94
125 1097
1055 672
538 1183
998 813
391 27
1066 766
782 1323
1220 164
427 819
274 5...

output:

11 15 17 28 40 41 42 43 45 66 69 84 92 94 99 100 116 152 153 167 168 176 180 198 222 229 234 235 251 267 271 288 312 317 319 359 361 366 375 388 393 407 409 429 446 450 467 472 475 485 491 497 525 535 538 539 550 554 559 565 568 569 604 606 618 630 640 649 679 687 707 738 761 763 776 783 802 806 813...

result:

ok ok (100 test cases)

Test #20:

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

input:

100
515 1036
358 355
124 512
414 420
214 74
423 447
344 263
431 482
364 446
314 200
299 244
389 507
191 58
85 405
130 57
288 370
231 324
442 405
324 42
453 137
312 167
33 67
443 27
497 101
447 442
211 438
200 210
472 219
462 227
210 19
416 76
483 374
48 374
259 264
331 214
486 213
146 254
264 350
36...

output:

3 15 17 18 29 57 75 80 86 90 94 98 143 158 165 169 170 187 202 211 227 235 241 243 250 251 274 280 298 303 304 305 311 331 369 377 395 398 400 427 443 493 506 1 10 28 30 37 41 45 49 53 54 60 66 67 74 77 84 88 89 91 100 105 108 112 114 117 118 129 130 137 141 149 160 172 190 195 219 223 234 238 249 2...

result:

ok ok (100 test cases)

Test #21:

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

input:

100
985 2463
916 513
388 126
199 847
456 244
218 236
243 961
588 899
242 137
98 45
273 505
332 492
828 494
368 889
551 617
662 87
651 450
645 884
49 487
731 934
328 482
224 101
590 687
80 972
143 154
420 155
113 886
413 716
841 402
334 374
549 893
62 743
964 386
608 294
124 692
213 980
857 886
228 6...

output:

4 5 13 18 21 22 36 45 81 92 96 98 108 130 139 140 144 164 172 186 199 236 254 269 330 335 358 369 398 401 403 430 431 432 441 450 455 458 470 479 485 515 517 524 525 531 554 569 599 603 613 614 621 624 640 643 652 688 698 723 739 760 765 774 857 877 879 888 895 918 934 939 965 972 978 7 10 11 17 20 ...

result:

ok ok (100 test cases)

Test #22:

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

input:

10
6620 7333
1646 5207
3808 6296
3890 1170
841 4461
3269 5613
3427 743
4429 351
6077 6488
1639 2661
704 600
1959 6216
4631 689
62 659
1849 1253
2888 6071
823 3326
4491 1670
4620 1541
2403 1275
5905 998
6515 5675
5204 2518
2 6397
5388 5626
1712 3996
6069 3525
962 4452
5528 5749
5292 1334
4864 4469
21...

output:

84 98 100 110 112 116 164 175 193 195 228 231 236 245 256 267 269 275 278 304 307 312 320 346 362 368 393 469 477 498 514 516 523 538 574 583 588 593 642 668 675 676 689 702 708 717 725 746 751 766 773 787 803 812 819 826 839 841 843 866 867 899 901 904 907 920 928 930 979 981 986 993 1002 1010 1021...

result:

ok ok (10 test cases)

Test #23:

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

input:

10
31631 41405
12464 26816
7161 23441
26603 26999
3101 17725
19057 12144
25877 18100
27212 15122
23942 15607
10953 6392
8135 30928
10824 21016
16740 16082
31166 11527
30093 3178
18953 11904
16873 18594
31034 21707
18284 11028
10289 6972
4229 16452
6726 8826
15758 31430
30272 23869
31004 31424
15626 ...

output:

10 16 20 29 63 64 65 67 96 107 123 124 125 126 145 173 220 238 255 265 300 336 349 352 370 371 379 383 410 411 421 452 472 475 544 550 551 556 564 570 605 610 611 612 614 627 639 663 678 679 688 704 710 724 760 763 782 783 793 805 825 837 840 850 857 872 877 882 885 912 928 943 951 957 958 962 990 9...

result:

ok ok (10 test cases)

Test #24:

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

input:

10
28538 43099
13200 13914
26716 18327
28186 28518
1215 11877
11167 9447
24145 13428
13894 1222
12303 4558
7451 3511
24131 6746
3501 5306
13827 16899
19501 15623
18276 4006
16371 3015
3638 27140
3419 28191
649 11619
7330 19380
3215 17183
13519 12575
3643 1100
23996 5666
7650 3931
11863 18905
11099 2...

output:

3 26 82 83 86 99 111 117 124 130 132 134 137 149 154 155 157 180 191 194 202 204 216 230 239 248 270 271 283 315 319 332 335 344 345 359 370 411 416 425 456 467 498 501 504 520 524 525 532 538 539 554 557 561 566 575 582 593 603 617 656 659 663 668 679 680 681 692 709 728 730 747 772 788 800 801 831...

result:

ok ok (10 test cases)

Test #25:

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

input:

10
87788 176493
85411 2449
75677 87148
41863 8856
26947 41851
69142 52475
19624 254
68187 45850
1914 1328
60252 34269
74977 29820
84340 25888
15811 3705
1188 51146
923 7500
4632 78262
79717 73522
51839 29805
50741 81652
34291 1102
47663 68963
8687 86118
17441 86354
11708 6564
87269 85939
81969 15769...

output:

15 23 40 52 66 83 95 115 136 137 157 168 186 203 225 227 228 229 236 253 255 265 270 297 319 321 346 355 360 362 372 381 386 390 416 421 426 428 448 451 462 477 489 495 512 513 568 588 589 599 613 618 626 629 636 661 678 708 723 724 731 743 779 790 791 823 839 844 852 854 869 892 927 936 986 993 997...

result:

ok ok (10 test cases)

Test #26:

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

input:

10
8816 22043
7419 5025
5365 4666
3322 7417
5863 5973
2641 1448
6401 2157
1667 7379
6833 7402
5527 5022
2651 4669
4676 5212
3876 2581
5037 6774
2606 6661
5930 519
3836 8394
1159 3510
2789 2327
5496 4249
5240 4702
4006 7011
5102 1260
2708 1364
8618 888
3465 3208
5175 3282
5081 6716
5593 1814
2896 663...

output:

32 38 41 45 62 69 76 93 122 123 128 129 138 152 162 169 174 184 194 196 210 236 239 240 260 273 274 278 284 288 294 295 314 317 321 329 333 339 344 352 363 367 369 380 396 412 415 419 422 447 456 462 493 496 506 514 520 539 544 594 595 597 617 667 668 677 679 692 698 702 710 714 719 723 732 740 743 ...

result:

ok ok (10 test cases)

Test #27:

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

input:

1
200000 222059
53595 110970
173632 131224
18782 129709
79934 195396
42423 87939
191850 58500
75657 76504
130760 155268
40793 74463
110561 181427
166061 166730
169476 19173
54038 80930
98140 20017
131017 7357
135665 51329
20673 95904
15527 156410
147735 107963
185611 9516
181066 181938
6507 122388
3...

output:

4 23 29 30 45 49 56 65 81 95 104 109 113 115 118 136 155 187 202 213 214 225 267 289 307 321 333 343 367 368 405 410 419 479 493 560 574 579 582 585 590 608 633 638 661 664 671 685 691 692 708 724 726 733 737 767 773 782 800 802 828 835 845 865 875 877 879 893 901 915 921 927 949 953 954 964 967 973...

result:

ok ok (1 test case)

Test #28:

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

input:

1
200000 262063
72841 66604
94581 51837
191542 123743
149876 10516
128822 123410
139111 103089
158541 56483
183570 157423
128256 118508
92821 129228
163748 28520
2448 160970
37107 90515
139799 163596
184374 16626
78012 98010
144666 155211
146459 60321
62391 172660
124463 39432
99102 80299
22916 1273...

output:

19 34 65 73 80 106 109 127 134 138 171 177 193 197 209 217 219 228 240 248 283 287 293 318 351 352 360 361 413 417 425 430 447 454 481 516 531 541 592 597 610 614 627 640 643 656 660 663 704 713 719 734 749 753 765 771 776 785 810 815 824 829 835 870 881 891 902 904 924 940 1029 1030 1039 1063 1071 ...

result:

ok ok (1 test case)

Test #29:

score: 0
Accepted
time: 81ms
memory: 34424kb

input:

1
200000 301952
21951 38377
145264 141899
20286 189141
49248 10797
131312 186634
193391 7330
90758 178447
133654 28458
197098 132935
142271 123768
182413 51079
106749 37339
80111 160519
130329 80747
134297 17746
89135 104031
76611 66916
13891 148818
166668 148476
177606 78551
133202 121415
17109 114...

output:

9 15 17 74 85 89 96 106 142 145 149 151 153 168 173 178 203 205 238 239 253 271 276 294 339 345 352 363 382 390 402 407 417 456 459 466 478 504 510 522 529 558 586 636 641 643 651 663 683 692 714 717 737 757 764 788 795 802 833 852 855 860 871 872 881 886 887 888 894 895 902 906 913 919 920 927 948 ...

result:

ok ok (1 test case)

Test #30:

score: 0
Accepted
time: 106ms
memory: 36464kb

input:

1
200000 402105
169412 28307
39235 94949
120109 190352
59500 104359
75817 175560
50253 41771
83195 186648
20091 175725
106263 65825
156850 28786
72265 77440
104707 152961
108429 140785
176083 164531
173958 160585
89283 97448
72968 178690
182706 163213
64471 47768
59578 23108
25972 130392
101827 1729...

output:

3 6 14 15 19 22 23 26 47 66 84 118 125 143 146 158 161 173 176 178 218 222 231 234 242 247 251 254 268 271 272 275 301 306 311 317 344 345 351 361 367 380 381 391 405 406 424 426 442 445 474 479 505 510 533 536 552 579 586 590 601 606 608 621 634 649 650 660 669 684 685 692 706 746 747 748 753 778 8...

result:

ok ok (1 test case)

Test #31:

score: 0
Accepted
time: 133ms
memory: 36116kb

input:

1
200000 499981
80537 142045
166196 27324
188484 59794
73011 62848
54982 32788
146891 120397
145977 112297
30732 34355
198025 193511
46734 37750
74321 75081
38173 123072
90782 51316
3345 153541
108762 97369
16828 137609
157439 191613
162866 51112
72589 170889
126524 133464
82570 115809
128563 112379...

output:

13 38 41 62 65 69 72 77 86 108 146 151 163 165 169 172 183 211 212 215 216 220 256 274 302 304 314 336 342 362 368 393 399 459 474 517 526 534 550 555 556 572 587 615 628 631 653 659 667 671 673 683 686 691 722 735 737 754 761 764 786 801 803 813 826 830 834 841 864 878 899 917 931 938 953 965 971 1...

result:

ok ok (1 test case)

Test #32:

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

input:

10000
9 14
7 9
6 7
6 3
3 2
3 5
3 4
3 8
7 8
2 7
4 7
3 1
7 1
7 5
9 3
5 4
2 3
4 5
4 1
2 1
65 120
48 33
48 27
65 28
21 48
48 4
3 28
39 48
48 10
48 50
32 13
19 48
52 24
48 24
48 15
48 31
65 48
52 19
60 48
49 41
22 28
48 20
18 48
2 28
25 48
1 48
2 48
28 23
52 20
28 51
28 11
52 63
59 28
28 36
48 44
31 28
2...

output:

3 2 5 4 
2 4 
48 52 21 32 33 36 41 2 4 6 7 11 12 14 15 16 18 22 23 25 26 29 31 34 37 39 43 45 50 57 60 13 
22 27 29 2 4 6 8 10 12 14 16 19 21 24 28 31 33 
4 1 5 
1 11 3 4 5 12 
3 17 2 4 13 19 9 14 6 
10 16 4 11 1 7 9 14 17 19 21 23 
2 6 8 11 4 7 
1 2 5 6 7 
3 
8 13 1 3 4 11 6 
6 1 5 
7 11 3 6 8 13 
...

result:

ok ok (10000 test cases)

Test #33:

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

input:

1000
65 124
10 5
5 16
64 33
3 59
4 59
50 5
60 33
5 39
55 59
33 61
5 8
5 49
31 33
5 41
37 59
5 48
23 59
34 33
59 17
22 5
33 47
11 5
59 38
5 45
5 13
63 5
5 14
5 2
33 16
40 5
27 33
5 64
59 49
41 33
25 59
28 33
65 59
59 11
33 62
15 33
59 35
59 14
53 59
33 29
30 5
44 33
62 5
33 32
50 59
59 30
59 45
42 59...

output:

5 33 10 50 2 4 11 12 13 14 17 18 21 22 23 24 25 26 30 35 36 37 38 39 42 43 45 49 52 53 55 58 
54 79 244 63 84 131 158 166 291 6 8 12 13 18 21 22 23 25 33 40 45 52 60 61 69 71 76 78 86 88 90 95 100 107 118 121 122 126 130 134 138 146 148 156 162 164 173 175 176 177 179 181 185 186 190 195 198 199 200...

result:

ok ok (1000 test cases)

Test #34:

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

input:

100
2720 5430
15 549
864 1152
549 492
1152 2121
366 1608
2226 1574
2096 1152
951 1152
279 1278
1574 232
2537 1152
806 1278
1988 1152
1574 2203
1239 1278
414 549
434 549
549 2020
1608 1319
2464 1574
1232 1152
1608 728
1453 1152
992 1608
1608 1637
1242 1152
1190 1574
1278 1587
2105 1278
2577 549
1178 ...

output:

549 1278 1608 15 279 366 492 1 3 5 7 9 11 13 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 1...

result:

ok ok (100 test cases)

Test #35:

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

input:

10
11424 22838
10124 2930
2930 8210
6044 2930
9338 5243
2930 1990
8267 335
11369 2930
3640 2930
2930 8394
2930 4490
10225 5027
2930 7034
336 10225
6591 10225
2723 8267
3141 8267
9338 8308
8267 7647
2930 1471
9338 742
10225 2977
8267 4214
10232 6130
5050 6130
3536 9338
9338 810
8267 6841
8267 4313
59...

output:

2930 6130 8267 335 3141 3640 8394 1 3 4 6 8 9 10 11 12 13 14 15 19 21 23 25 26 27 31 32 33 34 35 37 38 40 41 42 43 44 45 46 49 50 51 52 53 55 56 57 58 59 60 62 64 65 66 69 71 72 74 75 76 80 81 82 84 85 87 88 89 91 92 93 95 97 98 99 100 102 104 105 106 107 109 110 112 113 115 116 118 124 126 127 130 ...

result:

ok ok (10 test cases)

Test #36:

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

input:

1
200000 399988
171813 28023
127391 157678
139161 157678
157678 158661
157678 6685
120596 157678
189440 28023
72845 28023
28023 155435
178088 157678
54821 157678
199920 7797
7797 23002
132615 7797
7797 114612
28023 98270
157678 29354
29544 28023
28023 6304
28023 86497
20726 7797
198021 7797
4578 157...

output:

7797 12097 157678 75904 98404 104269 106102 120596 178088 2 3 4 5 6 8 9 10 11 14 15 16 17 19 20 21 23 24 25 26 27 28 29 30 32 34 35 36 37 38 41 44 45 46 49 50 51 52 53 54 56 58 59 60 62 63 65 66 67 69 70 72 74 75 76 77 78 79 81 82 83 84 86 88 89 90 91 92 93 94 97 98 100 101 102 103 104 105 106 107 1...

result:

ok ok (1 test case)

Test #37:

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

input:

1
200000 399994
17358 78776
138799 189702
78776 115828
78776 76870
189702 82466
80014 189702
78776 129553
14969 78776
161279 120022
103978 161279
189702 90678
65648 78776
164898 189702
78776 4880
189702 17932
189702 29494
71164 78776
55663 78776
78776 25638
78776 51965
78776 73585
189702 190545
1173...

output:

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

result:

ok ok (1 test case)

Test #38:

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

input:

1
200000 399996
43234 184957
104384 184957
184957 104551
48901 184957
130388 184957
184957 191112
93746 184957
51488 83793
46496 184957
184957 149525
48305 51488
16545 51488
155037 184957
51488 99541
5545 184957
184957 50631
147758 184957
141234 51488
33945 184957
119044 51488
99610 51488
162526 514...

output:

51488 48305 83793 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168...

result:

ok ok (1 test case)

Test #39:

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

input:

1
200000 399994
187117 14028
171699 93144
87566 171699
48194 171699
123842 171699
86963 78638
171699 77033
187117 79890
123219 171699
171699 63678
68921 187117
187117 91518
12750 187117
11203 171699
166545 171699
187117 75563
4708 187117
86963 26711
115930 86963
187117 102050
187117 66412
187117 962...

output:

86963 187117 14028 79890 1 3 5 7 8 10 12 13 15 17 19 21 24 25 27 28 30 31 32 34 36 39 43 44 45 46 48 50 51 52 55 58 61 62 63 64 65 66 67 69 70 72 74 76 77 78 79 80 81 82 83 86 88 90 91 93 95 96 97 98 99 100 101 102 103 104 106 107 109 111 113 114 122 125 127 128 130 131 132 133 134 138 139 143 144 1...

result:

ok ok (1 test case)

Test #40:

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

input:

1
200000 399996
158442 44824
102533 158442
144188 158442
180888 177991
158442 60658
130921 158442
11093 158442
158442 91269
177991 66366
45320 177991
852 158442
158345 177991
177991 101419
177991 60694
77523 177991
158442 64839
177991 97717
158442 15688
101326 177991
57416 158442
105648 158442
15844...

output:

158442 44824 102533 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 102 104 106 108 110 112 114 116 118 120 122 124 126 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 1...

result:

ok ok (1 test case)

Test #41:

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

input:

1
200000 399984
132326 109212
15458 104058
141635 150556
42757 160742
104058 183026
140555 176509
105281 104058
98409 123058
115963 132326
110622 160742
124231 104058
9948 132326
149792 132326
186350 132326
114248 132326
117808 104058
149757 178717
20007 132326
103768 104058
160742 132129
181418 132...

output:

132326 150556 160742 178717 10394 18852 30716 109212 110622 132129 140555 199914 63 84 96 125 155 156 214 216 233 286 342 397 435 437 461 467 495 500 512 520 550 630 637 650 730 760 772 780 786 813 819 850 860 870 876 954 955 962 975 989 1028 1029 1069 1086 1089 1128 1225 1295 1303 1306 1312 1356 13...

result:

ok ok (1 test case)

Test #42:

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

input:

1
200000 399938
118765 169368
80877 55756
183643 55120
179690 39975
52846 39431
183643 142616
40237 9287
169765 51704
169765 196513
180903 78049
2468 127986
103196 92043
171000 183643
51970 16065
33387 150171
54791 100228
96040 51970
183643 73275
194778 116171
119619 51970
78820 25947
121977 74719
1...

output:

2468 31939 51970 53625 54140 78820 92043 93482 122060 132150 150171 164710 165658 169765 180903 183643 8503 15286 19400 24162 27538 33387 48225 52846 55120 55378 55725 57263 60379 71853 78171 103196 113270 119619 129444 145687 150547 150737 154575 163801 171000 171989 175506 179690 186012 190374 6 1...

result:

ok ok (1 test case)

Test #43:

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

input:

1
200000 399918
4808 186087
3193 20269
53579 193832
181866 119189
96009 51067
26071 110895
180290 198389
75156 67809
146896 88504
26232 199270
41761 194173
163583 73217
11161 69425
127108 172920
26071 136318
4808 20765
58003 13956
56475 127108
124690 96369
98349 88504
88504 129805
1116 75156
193832 ...

output:

6059 20269 40175 50734 51052 52024 58003 69425 72942 75156 88504 96369 106665 115350 132431 145391 180290 181866 191827 194173 199093 3193 5842 7048 11196 13956 15428 16348 26232 38011 39563 43696 47260 52153 55349 59848 67809 68899 68911 70918 80279 80940 89352 98349 102554 108260 119189 124690 127...

result:

ok ok (1 test case)

Test #44:

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

input:

1
200000 394970
67823 148797
176646 48645
130521 57454
24214 159679
58899 105974
31385 9900
98402 172520
136909 143412
104381 107770
158622 39611
181123 4031
93760 67853
87239 94179
102524 50092
53452 91220
161571 173978
140608 6827
8215 91048
101935 80437
20495 175157
85578 193822
117607 100231
195...

output:

167 355 367 445 547 711 1034 1491 1562 1565 1588 1883 1996 2255 2276 2330 2388 2433 2438 2576 2642 2739 2781 3132 3262 3483 3680 3888 3920 3922 3995 4179 4300 4313 4484 4648 4778 4796 5077 5532 5714 5823 6272 6381 6666 6745 7085 7129 7236 7417 7512 7514 7552 7599 7800 8008 8018 8137 8479 8732 8947 9...

result:

ok ok (1 test case)

Test #45:

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

input:

1
200000 324098
195943 81674
197522 192121
73692 10625
137597 30541
116880 163679
19609 78824
65138 65608
122246 18120
69217 48636
96269 102482
152468 42380
70492 187039
106990 158537
130005 170494
6227 16267
17532 42444
156564 89378
116737 22782
3890 98135
93103 18506
14764 134508
107699 107653
151...

output:

8 18 19 52 62 80 87 153 159 161 164 173 174 183 193 202 214 217 225 227 251 261 269 270 276 282 287 312 336 338 345 353 364 376 377 380 386 404 422 425 448 449 455 469 477 491 503 525 526 538 549 572 578 579 592 619 623 629 649 659 667 696 697 711 713 717 719 761 762 782 783 789 807 833 835 845 888 ...

result:

ok ok (1 test case)

Test #46:

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

input:

1
200000 200000
10712 34133
109916 81898
148586 4152
6534 159576
7955 53276
15698 110638
182088 163751
60650 31286
73846 141810
54346 154107
123853 122076
157857 161032
36509 82064
151785 146929
124102 184007
26103 42788
135406 130776
30940 184626
184648 4748
54625 68760
4035 142644
13678 114822
386...

output:

24 28 51 58 77 78 79 80 130 163 172 209 221 228 234 243 254 255 257 272 289 291 305 341 351 363 370 399 402 428 437 453 457 458 481 508 574 608 629 642 743 748 757 770 774 811 844 845 851 874 877 883 902 904 916 925 943 961 967 974 1006 1025 1029 1043 1050 1052 1066 1071 1083 1084 1088 1111 1158 118...

result:

ok ok (1 test case)