QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#831102#8903. Тайное посланиеXY_Eleven100 ✓102ms12376kbC++205.8kb2024-12-25 10:41:272024-12-25 10:41:27

Judging History

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

  • [2024-12-25 10:41:27]
  • 评测
  • 测评结果:100
  • 用时:102ms
  • 内存:12376kb
  • [2024-12-25 10:41:27]
  • 提交

answer

#include <bits/stdc++.h>
// #include <windows.h>
// #include <bits/extc++.h>
// using namespace __gnu_pbds;
using namespace std;
//#pragma GCC optimize(3)
#define DB double
#define LL long long
#define ULL unsigned long long
#define in128 __int128
#define cint const int
#define cLL const LL
#define For(z,e1,e2) for(int z=(e1);z<=(e2);z++)
#define Rof(z,e1,e2) for(int z=(e2);z>=(e1);z--)
#define For_(z,e1,e2) for(int z=(e1);z<(e2);z++)
#define Rof_(z,e1,e2) for(int z=(e2);z>(e1);z--)
#define inint(e) scanf("%d",&e)
#define inll(e) scanf("%lld",&e)
#define inpr(e1,e2) scanf("%d%d",&e1,&e2)
#define in3(e1,e2,e3) scanf("%d%d%d",&e1,&e2,&e3)
#define outint(e) printf("%d\n",e)
#define outint_(e) printf("%d%c",e," \n"[i==n])
#define outint2_(e,e1,e2) printf("%d%c",e," \n"[(e1)==(e2)])
#define outll(e) printf("%lld\n",e)
#define outll_(e) printf("%lld%c",e," \n"[i==n])
#define outll2_(e,e1,e2) printf("%lld%c",e," \n"[(e1)==(e2)])
#define exc(e) if(e) continue
#define stop(e) if(e) break
#define ret(e) if(e) return
#define ll(e) (1ll*(e))
#define pb push_back
#define ft first
#define sc second
#define pii pair<int,int> 
#define pli pair<long long,int> 
#define vct vector 
#define clean(e) while(!e.empty()) e.pop()
#define all(ev) ev.begin(),ev.end()
#define sz(ev) ((int)ev.size())
#define debug(x) printf("%s=%d\n",#x,x)
#define x0 __xx00__
#define y1 __yy11__
#define ffo fflush(stdout)
// cLL mod=998244353,G=404;
LL mod;
// cLL mod[2]={1686688681ll,1666888681ll},base[2]={166686661ll,188868881ll};
template <typename Type> void get_min(Type &w1,const Type w2) { if(w2<w1) w1=w2; } template <typename Type> void get_max(Type &w1,const Type w2) { if(w2>w1) w1=w2; }
template <typename Type> Type up_div(Type w1,Type w2) { return (w1/w2+(w1%w2?1:0)); }
template <typename Type> Type gcd(Type X_,Type Y_) { Type R_=X_%Y_; while(R_) { X_=Y_; Y_=R_; R_=X_%Y_; } return Y_; } template <typename Type> Type lcm(Type X_,Type Y_) { return (X_/gcd(X_,Y_)*Y_); }
template <typename Type> Type md(Type w1,const Type w2=mod) { w1%=w2; if(w1<0) w1+=w2; return w1; } template <typename Type> Type md_(Type w1,const Type w2=mod) { w1%=w2; if(w1<=0) w1+=w2; return w1; }
void ex_gcd(LL &X_,LL &Y_,LL A_,LL B_) { if(!B_) { X_=1ll; Y_=0ll; return ; } ex_gcd(Y_,X_,B_,A_%B_); X_=md(X_,B_); Y_=(1ll-X_*A_)/B_; } LL inv(LL A_,LL B_=mod) { LL X_=0ll,Y_=0ll; ex_gcd(X_,Y_,A_,B_); return X_; }
template <typename Type> void add(Type &w1,const Type w2,const Type M_=mod) { w1=md(w1+w2,M_); } void mul(LL &w1,cLL w2,cLL M_=mod) { w1=md(w1*md(w2,M_),M_); } template <typename Type> Type pw(Type X_,Type Y_,Type M_=mod) { Type S_=1; while(Y_) { if(Y_&1) mul(S_,X_,M_); Y_>>=1; mul(X_,X_,M_); } return S_; }
template <typename Type> Type bk(vector <Type> &V_) { auto T_=V_.back(); V_.pop_back(); return T_; } template <typename Type> Type tp(stack <Type> &V_) { auto T_=V_.top(); V_.pop(); return T_; } template <typename Type> Type frt(queue <Type> &V_) { auto T_=V_.front(); V_.pop(); return T_; }
template <typename Type> Type bg(set <Type> &V_) { auto T_=*V_.begin(); V_.erase(V_.begin()); return T_; } template <typename Type> Type bk(set <Type> &V_) { auto T_=*prev(V_.end()); V_.erase(*prev(V_.end())); return T_; }
mt19937 gen(time(NULL)); int rd() { return abs((int)gen()); }
int rnd(int l,int r) { return rd()%(r-l+1)+l; }

void main_init()
{

}
cint M=3.01e5;
int n,m;
int a[M];
void solve1()
{
    inpr(n,m);
    For(i,1,m) inint(a[i]);
    int x=n+1,cnt=0,i=m+1,tot=0;
    vct <int> ans;
    while(tot<m)
    {
        while(i>1&&a[i-1]>=x) i--,cnt++;
        if(!cnt) x=a[--i],cnt++;
        if(x==a[i]) { x--; continue; }
        if(x<=0)
        {
            auto t=ans;
            For(j,1,m) t.pb(a[j]);
            sort(all(t));
            // for(auto w:t) printf("%d ",w); printf("\n");
            int len=sz(t);
            x=n,i=len;
            while(cnt--)
            {
                while(true)
                {
                    while(i>0&&t[i-1]>=x) i--;
                    // printf("t[i]=%d,x=%d\n",t[i],x);
                    stop(i==len||x!=t[i]);
                    x--;
                }
                // printf("x=%d\n",x);
                ans.pb(x--);
            }
            break;
        }
        ans.pb(x),tot++; x--,cnt--;
    }
    sort(all(ans));
    For_(i,0,m) outint2_(ans[i],i,m-1);
    ffo;
}
void solve2()
{
    inpr(n,m);
    For(i,1,m) inint(a[i]);
    int x=0,cnt=0,i=0,tot=0;
    vct <int> ans;
    while(tot<m)
    {
        while(i<m&&a[i+1]<=x) i++,cnt++;
        if(!cnt) x=a[++i],cnt++;
        if(x==a[i]) { x++; continue; }
        // printf("x=%d,i=%d\n",x,i);
        // assert(i<=m);
        if(x>n)
        {
            auto t=ans;
            For(j,1,m) t.pb(a[j]);
            sort(all(t));
            // for(auto w:t) printf("%d ",w); printf("\n");
            int len=sz(t);
            x=1,i=-1;
            while(cnt--)
            {
                while(true)
                {
                    while(i+1<len&&t[i+1]<=x) i++;
                    // printf("t[i]=%d,x=%d\n",t[i],x);
                    stop(i<0||x!=t[i]);
                    x++;
                }
                // printf("x=%d\n",x);
                ans.pb(x++);
            }
            break;
        }
        ans.pb(x),tot++; x++,cnt--;
    }
    sort(all(ans));
    For_(i,0,m) outint2_(ans[i],i,m-1);
    ffo;
}
void main_solve()
{
    int opt,T; inpr(opt,T);
    while(T--)
    {
        if(opt==1) solve1();
        else solve2();
    }
}
int main()
{
    // ios::sync_with_stdio(0); cin.tie(0);
    // freopen("in.txt","r",stdin);
    // freopen("out.txt","w",stdout);
    // srand(time(NULL));
    main_init();
    // int _; inint(_); For(__,1,_) // T>1 ?
        // printf("\n------------\n\n"),
        main_solve();
    return 0;
}
/*

*/

详细

Subtask #1:

score: 9
Accepted

Test #1:

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

input:

1
1
5000 1
1666

output:

1665

input:

2
1
5000 1
1665

output:

1666

result:

ok correct! (1 test case)

Test #2:

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

input:

1
1
5000 1
4081

output:

4080

input:

2
1
5000 1
4080

output:

4081

result:

ok correct! (1 test case)

Test #3:

score: 9
Accepted
time: 1ms
memory: 4148kb

input:

1
500
8 1
1
9 1
6
7 1
5
7 1
2
8 1
6
5 1
5
8 1
7
5 1
3
6 1
2
9 1
2
8 1
6
10 1
5
5 1
2
10 1
2
9 1
3
4 1
2
10 1
3
7 1
4
10 1
2
4 1
3
6 1
1
6 1
2
5 1
1
6 1
2
8 1
1
8 1
8
10 1
3
6 1
1
8 1
1
9 1
5
10 1
1
4 1
3
10 1
8
5 1
5
10 1
9
6 1
1
10 1
1
9 1
5
7 1
5
9 1
3
7 1
1
7 1
5
5 1
4
6 1
1
6 1
3
8 1
1
4 1
1
9 1...

output:

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

input:

2
500
10 1
2
7 1
5
9 1
6
6 1
3
8 1
8
10 1
8
8 1
3
4 1
1
4 1
4
5 1
4
8 1
5
8 1
3
8 1
7
5 1
2
10 1
4
9 1
4
7 1
7
9 1
2
10 1
1
10 1
9
4 1
4
4 1
2
6 1
2
9 1
4
6 1
1
5 1
5
9 1
6
6 1
5
7 1
3
5 1
1
9 1
1
10 1
5
9 1
5
10 1
8
6 1
5
6 1
2
6 1
5
6 1
1
9 1
2
9 1
7
8 1
7
7 1
4
8 1
5
10 1
5
7 1
2
4 1
3
5 1
5
6 1
...

output:

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

result:

ok correct! (500 test cases)

Test #4:

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

input:

1
100
5 1
1
38 1
31
6 1
3
32 1
12
49 1
7
21 1
8
15 1
5
10 1
7
11 1
3
31 1
1
19 1
8
9 1
3
27 1
27
36 1
18
13 1
12
17 1
6
18 1
16
46 1
21
36 1
1
13 1
3
44 1
34
29 1
5
19 1
1
43 1
7
22 1
19
39 1
36
19 1
2
4 1
3
36 1
26
44 1
4
6 1
5
47 1
29
23 1
8
7 1
7
45 1
35
37 1
9
18 1
11
2 1
1
44 1
3
22 1
22
43 1
9...

output:

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

input:

2
100
24 1
16
6 1
1
44 1
25
47 1
47
36 1
28
38 1
36
9 1
2
15 1
1
13 1
2
4 1
4
43 1
3
25 1
22
13 1
5
38 1
35
41 1
24
22 1
21
21 1
20
7 1
6
29 1
4
9 1
2
24 1
24
36 1
36
28 1
22
13 1
11
37 1
8
21 1
1
44 1
33
23 1
7
20 1
4
21 1
7
14 1
10
37 1
33
30 1
5
43 1
8
22 1
18
48 1
20
14 1
1
19 1
1
3 1
2
17 1
5
4...

output:

17
2
26
1
29
37
3
2
3
1
4
23
6
36
25
22
21
7
5
3
1
1
23
12
9
2
34
8
5
8
11
34
6
9
19
21
2
2
3
6
7
27
18
5
29
3
16
3
11
12
9
1
1
2
5
4
5
14
1
2
3
31
13
10
6
2
2
8
1
12
4
27
1
13
4
1
5
26
2
35
3
7
36
8
8
8
16
9
5
2
3
21
3
34
3
2
25
7
33
2

result:

ok correct! (100 test cases)

Subtask #2:

score: 11
Accepted

Test #5:

score: 11
Accepted
time: 0ms
memory: 4188kb

input:

1
1
5000 2
90 2207

output:

89 2206

input:

2
1
5000 2
89 2206

output:

90 2207

result:

ok correct! (1 test case)

Test #6:

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

input:

1
1
5000 2
2142 3937

output:

2141 3936

input:

2
1
5000 2
2141 3936

output:

2142 3937

result:

ok correct! (1 test case)

Test #7:

score: 11
Accepted
time: 2ms
memory: 3888kb

input:

1
833
4 2
1 3
6 2
2 4
4 2
1 2
5 2
3 4
6 2
3 5
5 2
2 4
5 2
2 3
6 2
1 6
4 2
1 4
5 2
4 5
6 2
2 3
5 2
1 3
4 2
1 2
4 2
2 3
5 2
2 4
5 2
2 5
4 2
1 3
5 2
2 4
4 2
2 3
5 2
1 5
4 2
2 3
6 2
3 5
6 2
1 2
4 2
2 4
4 2
1 3
5 2
1 3
5 2
2 3
4 2
2 4
6 2
3 6
6 2
1 6
6 2
3 6
5 2
4 5
4 2
1 4
5 2
1 2
4 2
3 4
4 2
1 4
6 2
4 ...

output:

2 4
1 3
3 4
1 2
2 4
1 3
1 5
4 5
2 3
2 3
1 6
2 5
3 4
1 4
1 3
1 4
2 4
1 3
1 4
3 4
1 4
2 4
5 6
1 3
2 4
2 5
1 5
1 3
2 5
4 5
2 5
2 3
2 3
4 5
1 2
2 3
3 5
1 2
1 2
1 4
4 5
3 4
3 5
1 2
1 3
2 3
2 4
2 3
3 4
2 4
1 4
5 6
4 5
3 4
1 5
1 2
1 2
1 2
4 5
2 3
3 4
1 4
2 4
2 3
1 6
1 4
4 6
1 3
2 5
3 5
1 4
1 4
1 4
2 3
1 2
...

input:

2
833
4 2
1 2
4 2
2 3
6 2
2 4
5 2
2 3
6 2
1 2
4 2
1 3
6 2
1 3
4 2
1 2
5 2
2 3
4 2
1 3
5 2
1 4
6 2
3 5
6 2
3 5
6 2
2 3
5 2
4 5
4 2
1 3
4 2
2 4
5 2
3 5
6 2
2 6
6 2
1 6
5 2
3 5
4 2
1 2
4 2
1 2
6 2
2 5
5 2
2 4
4 2
2 4
5 2
2 3
4 2
3 4
4 2
2 3
4 2
2 3
5 2
2 5
4 2
1 4
4 2
3 4
6 2
1 4
6 2
2 4
5 2
4 5
5 2
1 ...

output:

3 4
1 4
3 5
4 5
3 4
2 4
2 4
3 4
4 5
2 4
2 5
4 6
4 6
4 5
1 2
2 4
1 3
1 4
1 3
2 3
1 4
3 4
3 4
3 6
3 5
1 3
4 5
1 2
1 4
1 4
1 3
2 3
1 2
2 5
3 5
1 2
3 4
1 5
1 2
1 4
1 5
2 3
1 2
2 4
1 4
1 2
1 4
1 6
1 4
1 5
2 5
1 6
1 2
1 4
4 5
2 5
1 5
2 3
3 5
2 3
2 4
3 5
1 5
4 5
3 4
2 3
1 2
3 4
3 6
3 4
1 4
2 3
1 3
1 2
1 2
...

result:

ok correct! (833 test cases)

Test #8:

score: 11
Accepted
time: 1ms
memory: 4180kb

input:

1
500
7 2
1 7
7 2
2 5
8 2
1 3
8 2
3 7
7 2
1 7
9 2
4 8
7 2
2 7
10 2
2 3
8 2
3 5
9 2
6 9
7 2
1 2
10 2
1 5
7 2
4 6
9 2
5 7
8 2
5 6
8 2
2 6
8 2
1 8
7 2
2 6
8 2
6 8
8 2
6 7
10 2
6 9
9 2
1 2
9 2
1 2
10 2
4 5
9 2
6 9
8 2
4 8
7 2
1 6
9 2
8 9
8 2
1 7
10 2
3 7
8 2
4 8
9 2
1 6
7 2
2 6
8 2
1 7
10 2
9 10
8 2
3 4...

output:

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

input:

2
500
8 2
2 7
7 2
5 7
9 2
3 9
8 2
5 8
9 2
4 9
8 2
1 5
9 2
2 5
9 2
8 9
8 2
1 5
10 2
5 6
9 2
4 5
9 2
3 6
10 2
4 8
7 2
2 4
7 2
2 3
8 2
2 4
8 2
1 2
8 2
3 5
10 2
2 9
8 2
1 7
7 2
3 4
7 2
6 7
10 2
5 10
10 2
1 6
8 2
1 5
8 2
1 3
10 2
3 4
9 2
2 8
9 2
4 7
7 2
1 7
7 2
1 6
9 2
1 8
7 2
5 6
9 2
4 9
10 2
4 10
10 2
...

output:

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

result:

ok correct! (500 test cases)

Test #9:

score: 11
Accepted
time: 1ms
memory: 4188kb

input:

1
100
48 2
2 12
47 2
13 16
50 2
28 41
37 2
15 25
44 2
4 9
41 2
18 24
45 2
27 39
40 2
11 24
37 2
16 18
30 2
15 18
45 2
11 17
40 2
4 20
47 2
19 39
33 2
22 30
47 2
2 45
47 2
19 47
35 2
8 11
33 2
6 13
42 2
6 41
33 2
32 33
48 2
5 35
43 2
1 12
34 2
14 20
36 2
14 25
42 2
18 24
36 2
6 30
31 2
19 27
46 2
2 3...

output:

1 11
12 15
27 40
14 24
3 8
17 23
26 38
10 23
15 17
14 17
10 16
3 19
18 38
21 29
1 44
18 46
7 10
5 12
5 40
30 31
4 34
11 43
13 19
13 24
17 23
5 29
18 26
1 35
20 27
2 36
23 28
10 18
7 31
21 22
17 18
12 43
5 45
38 40
3 20
32 35
10 22
15 19
30 31
14 32
32 44
27 28
5 10
14 49
21 27
5 39
17 26
26 41
18 27...

input:

2
100
48 2
1 11
41 2
6 18
39 2
30 31
30 2
10 22
34 2
9 25
33 2
30 32
42 2
3 35
37 2
18 27
39 2
10 35
48 2
14 32
33 2
30 31
40 2
24 34
31 2
17 18
41 2
5 27
43 2
11 43
47 2
1 44
31 2
27 29
47 2
12 15
30 2
20 27
45 2
27 31
40 2
18 34
33 2
11 33
32 2
5 9
34 2
13 19
43 2
5 39
48 2
12 43
40 2
22 40
34 2
5...

output:

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

result:

ok correct! (100 test cases)

Subtask #3:

score: 9
Accepted

Test #10:

score: 9
Accepted
time: 48ms
memory: 7820kb

input:

1
1
300000 150000
4 6 7 8 9 10 17 19 20 23 25 28 32 33 36 41 45 46 51 53 56 58 60 61 62 64 65 66 67 68 69 71 72 73 75 77 88 90 92 93 97 99 100 101 107 108 110 111 112 113 117 118 121 122 123 124 126 130 131 138 139 140 142 144 149 150 151 153 155 158 159 160 161 165 168 172 173 174 177 183 184 185 1...

output:

1 2 3 5 11 12 13 14 15 16 18 21 22 24 26 27 29 30 31 34 35 37 38 39 40 42 43 44 47 48 49 50 52 54 55 57 59 63 70 74 76 78 79 80 81 82 83 84 85 86 87 89 91 94 95 96 98 102 103 104 105 106 109 114 115 116 119 120 125 127 128 129 132 133 134 135 136 137 141 143 145 146 147 148 152 154 156 157 162 163 1...

input:

2
1
300000 150000
1 2 3 5 11 12 13 14 15 16 18 21 22 24 26 27 29 30 31 34 35 37 38 39 40 42 43 44 47 48 49 50 52 54 55 57 59 63 70 74 76 78 79 80 81 82 83 84 85 86 87 89 91 94 95 96 98 102 103 104 105 106 109 114 115 116 119 120 125 127 128 129 132 133 134 135 136 137 141 143 145 146 147 148 152 154...

output:

4 6 7 8 9 10 17 19 20 23 25 28 32 33 36 41 45 46 51 53 56 58 60 61 62 64 65 66 67 68 69 71 72 73 75 77 88 90 92 93 97 99 100 101 107 108 110 111 112 113 117 118 121 122 123 124 126 130 131 138 139 140 142 144 149 150 151 153 155 158 159 160 161 165 168 172 173 174 177 183 184 185 187 191 192 195 196...

result:

ok correct! (1 test case)

Test #11:

score: 9
Accepted
time: 44ms
memory: 6368kb

input:

1
1
300000 150000
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 21 22 25 26 28 29 30 34 35 36 37 39 40 41 42 43 44 45 47 48 49 51 53 54 55 56 57 59 60 61 62 63 64 65 66 69 70 72 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 91 92 93 94 95 96 97 98 99 100 101 102 103 106 107 108 109 110 111 112 113 115...

output:

18 20 23 24 27 31 32 33 38 46 50 52 58 67 68 71 73 88 90 104 105 114 120 121 128 129 145 156 158 159 165 168 174 178 182 187 195 198 201 206 207 211 214 223 224 227 231 238 239 241 250 252 253 256 257 266 268 277 278 282 284 296 298 302 306 311 314 316 320 321 322 324 326 327 328 339 348 349 353 357...

input:

2
1
300000 150000
18 20 23 24 27 31 32 33 38 46 50 52 58 67 68 71 73 88 90 104 105 114 120 121 128 129 145 156 158 159 165 168 174 178 182 187 195 198 201 206 207 211 214 223 224 227 231 238 239 241 250 252 253 256 257 266 268 277 278 282 284 296 298 302 306 311 314 316 320 321 322 324 326 327 328 3...

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 21 22 25 26 28 29 30 34 35 36 37 39 40 41 42 43 44 45 47 48 49 51 53 54 55 56 57 59 60 61 62 63 64 65 66 69 70 72 74 75 76 77 78 79 80 81 82 83 84 85 86 87 89 91 92 93 94 95 96 97 98 99 100 101 102 103 106 107 108 109 110 111 112 113 115 116 117 118 119 1...

result:

ok correct! (1 test case)

Test #12:

score: 9
Accepted
time: 37ms
memory: 6408kb

input:

1
1
300000 150000
1 3 4 6 7 8 11 12 14 15 17 18 19 21 23 25 26 28 32 33 35 37 38 40 41 42 43 46 49 50 52 54 55 56 57 58 60 61 63 67 68 69 70 71 72 74 76 78 79 84 85 86 87 88 89 90 91 93 95 97 98 99 100 101 102 104 105 106 107 109 110 111 112 113 114 117 118 119 124 125 129 131 132 134 136 137 138 13...

output:

2 5 9 10 13 16 20 22 24 27 29 30 31 34 36 39 44 45 47 48 51 53 59 62 64 65 66 73 75 77 80 81 82 83 92 94 96 103 108 115 116 120 121 122 123 126 127 128 130 133 135 142 144 146 153 157 160 163 166 168 180 183 185 186 187 190 192 194 195 197 198 205 207 208 212 218 219 220 224 226 228 234 236 237 238 ...

input:

2
1
300000 150000
2 5 9 10 13 16 20 22 24 27 29 30 31 34 36 39 44 45 47 48 51 53 59 62 64 65 66 73 75 77 80 81 82 83 92 94 96 103 108 115 116 120 121 122 123 126 127 128 130 133 135 142 144 146 153 157 160 163 166 168 180 183 185 186 187 190 192 194 195 197 198 205 207 208 212 218 219 220 224 226 22...

output:

1 3 4 6 7 8 11 12 14 15 17 18 19 21 23 25 26 28 32 33 35 37 38 40 41 42 43 46 49 50 52 54 55 56 57 58 60 61 63 67 68 69 70 71 72 74 76 78 79 84 85 86 87 88 89 90 91 93 95 97 98 99 100 101 102 104 105 106 107 109 110 111 112 113 114 117 118 119 124 125 129 131 132 134 136 137 138 139 140 141 143 145 ...

result:

ok correct! (1 test case)

Test #13:

score: 9
Accepted
time: 15ms
memory: 4176kb

input:

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

output:

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

input:

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

output:

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

result:

ok correct! (10000 test cases)

Test #14:

score: 9
Accepted
time: 22ms
memory: 3932kb

input:

1
1000
298 149
1 5 6 7 9 12 14 16 17 22 23 24 27 28 32 33 35 36 37 38 39 40 42 43 44 45 49 51 52 54 55 61 62 63 65 66 67 68 69 72 73 74 75 76 79 81 83 84 87 91 92 93 98 101 107 108 110 113 114 115 116 117 120 124 126 128 131 134 135 137 138 140 141 144 145 147 148 149 150 151 152 156 160 166 167 168...

output:

2 3 4 8 10 11 13 15 18 19 20 21 25 26 29 30 31 34 41 46 47 48 50 53 56 57 58 59 60 64 70 71 77 78 80 82 85 86 88 89 90 94 95 96 97 99 100 102 103 104 105 106 109 111 112 118 119 121 122 123 125 127 129 130 132 133 136 139 142 143 146 153 154 155 157 158 159 161 162 163 164 165 174 178 179 181 188 18...

input:

2
1000
280 140
1 2 6 8 12 13 15 16 18 19 20 21 23 25 26 27 29 30 31 32 34 35 36 39 42 46 50 56 57 58 60 64 67 70 71 72 74 75 76 78 79 81 82 85 87 90 91 92 93 99 101 104 106 109 110 111 112 114 116 117 119 122 124 126 128 129 130 131 132 134 136 137 140 143 147 148 151 152 157 160 163 165 167 168 169...

output:

3 4 5 7 9 10 11 14 17 22 24 28 33 37 38 40 41 43 44 45 47 48 49 51 52 53 54 55 59 61 62 63 65 66 68 69 73 77 80 83 84 86 88 89 94 95 96 97 98 100 102 103 105 107 108 113 115 118 120 121 123 125 127 133 135 138 139 141 142 144 145 146 149 150 153 154 155 156 158 159 161 162 164 166 170 171 173 174 17...

result:

ok correct! (1000 test cases)

Test #15:

score: 9
Accepted
time: 25ms
memory: 4192kb

input:

1
100
2202 1101
1 6 7 8 11 12 13 16 17 19 22 24 25 29 32 33 38 40 41 43 44 45 46 52 60 61 62 64 66 68 69 70 73 74 77 78 80 81 84 88 89 91 95 96 98 99 100 101 102 103 105 106 108 109 110 116 117 118 119 121 124 125 126 127 129 132 134 136 138 139 140 141 142 143 145 146 147 148 149 150 151 152 154 15...

output:

2 3 4 5 9 10 14 15 18 20 21 23 26 27 28 30 31 34 35 36 37 39 42 47 48 49 50 51 53 54 55 56 57 58 59 63 65 67 71 72 75 76 79 82 83 85 86 87 90 92 93 94 97 104 107 111 112 113 114 115 120 122 123 128 130 131 133 135 137 144 153 157 161 162 163 165 167 168 169 170 172 173 174 175 176 178 182 183 185 18...

input:

2
100
2562 1281
1 2 8 9 11 13 14 15 16 18 20 23 24 26 28 29 31 32 33 34 38 39 42 44 45 47 48 51 53 54 57 58 59 60 63 66 67 68 69 71 74 75 82 84 89 91 95 96 97 102 104 105 107 108 110 112 114 117 120 121 124 125 127 128 133 137 139 143 145 146 148 151 155 157 160 161 169 172 173 175 178 179 180 183 1...

output:

3 4 5 6 7 10 12 17 19 21 22 25 27 30 35 36 37 40 41 43 46 49 50 52 55 56 61 62 64 65 70 72 73 76 77 78 79 80 81 83 85 86 87 88 90 92 93 94 98 99 100 101 103 106 109 111 113 115 116 118 119 122 123 126 129 130 131 132 134 135 136 138 140 141 142 144 147 149 150 152 153 154 156 158 159 162 163 164 165...

result:

ok correct! (100 test cases)

Subtask #4:

score: 7
Accepted

Test #16:

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

input:

1
714
4 1
4
5 2
2 5
4 2
1 2
4 2
3 4
3 1
3
7 2
2 4
4 1
4
4 2
1 4
2 1
2
6 2
2 3
6 1
4
3 1
1
6 1
4
2 1
2
7 2
4 5
3 1
2
3 1
3
4 2
1 4
7 3
2 4 7
7 3
3 5 7
6 2
2 5
6 2
3 4
7 1
5
3 1
1
7 1
7
6 3
1 2 3
2 1
1
4 1
4
4 1
1
4 2
1 2
5 1
4
6 2
1 2
4 1
3
6 2
3 4
7 1
7
7 2
4 7
6 1
4
7 2
3 5
7 3
3 4 6
4 1
4
6 3
2 4 ...

output:

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

input:

2
714
7 3
4 5 7
5 1
2
4 2
3 4
7 1
7
3 1
2
2 1
1
7 3
1 4 6
7 3
2 6 7
2 1
1
3 1
3
4 1
4
5 1
5
7 3
2 3 4
7 2
3 4
3 1
3
7 1
7
3 1
2
2 1
2
2 1
1
5 1
5
2 1
1
3 1
2
5 1
3
4 2
2 3
2 1
1
7 3
1 4 7
5 1
2
6 3
2 3 4
6 2
2 4
7 2
3 7
3 1
1
4 2
1 2
4 2
2 3
7 3
2 3 4
2 1
1
6 1
1
7 2
1 6
6 1
3
2 1
2
4 1
2
2 1
2
2 1
...

output:

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

result:

ok correct! (714 test cases)

Subtask #5:

score: 9
Accepted

Test #17:

score: 9
Accepted
time: 42ms
memory: 6484kb

input:

1
1
1000000000 300000
884 1150 3663 8801 12244 12286 12380 12406 15958 18962 23631 23706 26157 30339 30374 34575 37125 48953 50417 51665 54114 54300 55776 58495 63402 63487 67516 69176 70683 72867 73468 74810 80999 87487 93187 97368 97544 97891 101280 105464 110296 122351 124949 131540 136869 136936...

output:

883 1149 3662 8800 12243 12285 12379 12405 15957 18961 23630 23705 26156 30338 30373 34574 37124 48952 50416 51664 54113 54299 55775 58494 63401 63486 67515 69175 70682 72866 73467 74809 80998 87486 93186 97367 97543 97890 101279 105463 110295 122350 124948 131539 136868 136935 141502 143254 146415 ...

input:

2
1
1000000000 300000
883 1149 3662 8800 12243 12285 12379 12405 15957 18961 23630 23705 26156 30338 30373 34574 37124 48952 50416 51664 54113 54299 55775 58494 63401 63486 67515 69175 70682 72866 73467 74809 80998 87486 93186 97367 97543 97890 101279 105463 110295 122350 124948 131539 136868 136935...

output:

884 1150 3663 8801 12244 12286 12380 12406 15958 18962 23631 23706 26157 30339 30374 34575 37125 48953 50417 51665 54114 54300 55776 58495 63402 63487 67516 69176 70683 72867 73468 74810 80999 87487 93187 97368 97544 97891 101280 105464 110296 122351 124949 131540 136869 136936 141503 143255 146416 ...

result:

ok correct! (1 test case)

Test #18:

score: 9
Accepted
time: 38ms
memory: 6576kb

input:

1
1
10000000 300000
74 127 244 248 276 299 312 325 492 501 527 534 552 559 615 631 690 733 783 786 828 843 874 959 1100 1106 1109 1175 1209 1215 1233 1236 1300 1315 1376 1391 1458 1493 1548 1631 1660 1664 1671 1701 1710 1731 1767 1812 1815 1835 1867 1888 1903 1918 1923 1963 1986 2007 2033 2049 2054 ...

output:

73 126 243 247 275 298 311 324 491 500 526 533 551 558 614 630 689 732 782 785 827 842 873 958 1099 1105 1108 1174 1208 1214 1232 1235 1299 1314 1375 1390 1457 1492 1547 1630 1659 1663 1670 1700 1709 1730 1766 1811 1814 1834 1866 1887 1902 1917 1922 1962 1985 2006 2032 2048 2053 2114 2129 2132 2134 ...

input:

2
1
10000000 300000
73 126 243 247 275 298 311 324 491 500 526 533 551 558 614 630 689 732 782 785 827 842 873 958 1099 1105 1108 1174 1208 1214 1232 1235 1299 1314 1375 1390 1457 1492 1547 1630 1659 1663 1670 1700 1709 1730 1766 1811 1814 1834 1866 1887 1902 1917 1922 1962 1985 2006 2032 2048 2053 ...

output:

74 127 244 248 276 299 312 325 492 501 527 534 552 559 615 631 690 733 783 786 828 843 874 959 1100 1106 1109 1175 1209 1215 1233 1236 1300 1315 1376 1391 1458 1493 1548 1631 1660 1664 1671 1701 1710 1731 1767 1812 1815 1835 1867 1888 1903 1918 1923 1963 1986 2007 2033 2049 2054 2115 2130 2133 2135 ...

result:

ok correct! (1 test case)

Test #19:

score: 9
Accepted
time: 40ms
memory: 6580kb

input:

1
1
1000000 300000
2 7 14 16 19 21 25 27 30 34 37 40 42 44 46 48 50 54 59 64 66 70 73 76 78 82 84 87 89 91 94 96 99 101 106 109 111 115 118 121 128 132 136 138 143 145 148 150 152 154 158 160 162 164 166 171 173 176 178 180 182 185 189 192 194 197 200 203 206 208 212 214 218 221 223 228 235 238 240 ...

output:

1 6 13 15 18 20 24 26 29 33 36 39 41 43 45 47 49 53 58 63 65 69 72 75 77 81 83 86 88 90 93 95 98 100 105 108 110 114 117 120 127 131 135 137 142 144 147 149 151 153 157 159 161 163 165 170 172 175 177 179 181 184 188 191 193 196 199 202 205 207 211 213 217 220 222 227 234 237 239 241 243 249 251 253...

input:

2
1
1000000 300000
1 6 13 15 18 20 24 26 29 33 36 39 41 43 45 47 49 53 58 63 65 69 72 75 77 81 83 86 88 90 93 95 98 100 105 108 110 114 117 120 127 131 135 137 142 144 147 149 151 153 157 159 161 163 165 170 172 175 177 179 181 184 188 191 193 196 199 202 205 207 211 213 217 220 222 227 234 237 239 ...

output:

2 7 14 16 19 21 25 27 30 34 37 40 42 44 46 48 50 54 59 64 66 70 73 76 78 82 84 87 89 91 94 96 99 101 106 109 111 115 118 121 128 132 136 138 143 145 148 150 152 154 158 160 162 164 166 171 173 176 178 180 182 185 189 192 194 197 200 203 206 208 212 214 218 221 223 228 235 238 240 242 244 250 252 254...

result:

ok correct! (1 test case)

Test #20:

score: 9
Accepted
time: 102ms
memory: 12140kb

input:

1
1
1000000000 300000
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 1...

output:

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 170 172 174 176 1...

input:

2
1
1000000000 300000
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...

output:

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177...

result:

ok correct! (1 test case)

Test #21:

score: 9
Accepted
time: 100ms
memory: 12236kb

input:

1
1
1000000000 300000
1 3 6 8 10 12 16 18 20 22 24 26 28 30 32 35 38 41 46 48 54 57 63 67 69 72 74 77 79 84 86 90 92 94 97 99 102 108 110 113 115 121 123 130 133 135 138 141 144 146 150 153 155 160 165 167 172 176 178 180 183 189 191 193 196 198 201 203 205 207 211 213 216 221 228 230 233 236 238 24...

output:

2 5 7 9 11 15 17 19 21 23 25 27 29 31 34 37 40 45 47 53 56 62 66 68 71 73 76 78 83 85 89 91 93 96 98 101 107 109 112 114 120 122 129 132 134 137 140 143 145 149 152 154 159 164 166 171 175 177 179 182 188 190 192 195 197 200 202 204 206 210 212 215 220 227 229 232 235 237 239 245 247 249 253 257 261...

input:

2
1
1000000000 300000
2 5 7 9 11 15 17 19 21 23 25 27 29 31 34 37 40 45 47 53 56 62 66 68 71 73 76 78 83 85 89 91 93 96 98 101 107 109 112 114 120 122 129 132 134 137 140 143 145 149 152 154 159 164 166 171 175 177 179 182 188 190 192 195 197 200 202 204 206 210 212 215 220 227 229 232 235 237 239 2...

output:

1 3 6 8 10 12 16 18 20 22 24 26 28 30 32 35 38 41 46 48 54 57 63 67 69 72 74 77 79 84 86 90 92 94 97 99 102 108 110 113 115 121 123 130 133 135 138 141 144 146 150 153 155 160 165 167 172 176 178 180 183 189 191 193 196 198 201 203 205 207 211 213 216 221 228 230 233 236 238 240 246 248 250 254 258 ...

result:

ok correct! (1 test case)

Test #22:

score: 9
Accepted
time: 43ms
memory: 6784kb

input:

1
1
1000000000 300000
999000001 999000004 999000012 999000017 999000020 999000022 999000024 999000026 999000028 999000030 999000033 999000035 999000037 999000040 999000044 999000046 999000048 999000053 999000062 999000069 999000072 999000074 999000076 999000078 999000080 999000082 999000084 99900008...

output:

999000000 999000003 999000011 999000016 999000019 999000021 999000023 999000025 999000027 999000029 999000032 999000034 999000036 999000039 999000043 999000045 999000047 999000052 999000061 999000068 999000071 999000073 999000075 999000077 999000079 999000081 999000083 999000085 999000088 999000090 ...

input:

2
1
1000000000 300000
999000000 999000003 999000011 999000016 999000019 999000021 999000023 999000025 999000027 999000029 999000032 999000034 999000036 999000039 999000043 999000045 999000047 999000052 999000061 999000068 999000071 999000073 999000075 999000077 999000079 999000081 999000083 99900008...

output:

999000001 999000004 999000012 999000017 999000020 999000022 999000024 999000026 999000028 999000030 999000033 999000035 999000037 999000040 999000044 999000046 999000048 999000053 999000062 999000069 999000072 999000074 999000076 999000078 999000080 999000082 999000084 999000086 999000089 999000091 ...

result:

ok correct! (1 test case)

Test #23:

score: 9
Accepted
time: 99ms
memory: 10980kb

input:

1
1
600000 300000
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 1...

output:

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 170 172 174 176 1...

input:

2
1
600000 300000
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...

output:

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 155 157 159 161 163 165 167 169 171 173 175 177...

result:

ok correct! (1 test case)

Test #24:

score: 9
Accepted
time: 15ms
memory: 4172kb

input:

1
30000
6 1
5
4 2
1 3
2 1
1
2 1
1
8 1
4
2 1
1
4 2
1 3
5 1
2
3 1
1
6 2
2 4
10 5
1 3 5 7 9
5 2
1 4
9 1
8
8 1
4
3 1
1
8 4
1 3 5 7
8 3
1 4 7
8 3
1 4 6
3 1
1
2 1
1
3 1
2
2 1
1
3 1
1
10 3
2 5 7
10 3
2 6 9
9 4
1 4 6 8
10 4
1 3 6 8
7 3
1 4 6
9 3
2 4 8
5 2
1 4
2 1
1
3 1
2
9 1
8
8 4
1 3 5 7
3 1
2
9 4
1 4 6 8
...

output:

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

input:

2
30000
3 1
3
7 1
5
4 2
2 4
5 2
1 3
9 4
2 5 7 9
10 5
2 4 6 8 10
4 2
2 4
3 1
3
9 4
2 5 7 9
8 4
2 4 6 8
6 2
3 6
10 3
2 5 10
7 1
1
6 2
4 6
5 2
3 5
3 1
1
4 2
2 4
3 1
1
2 1
2
5 1
1
5 1
2
4 2
2 4
3 1
1
4 2
2 4
3 1
1
6 2
2 6
3 1
1
8 1
3
9 3
4 6 9
8 2
1 6
5 1
1
4 1
1
4 1
2
5 2
1 3
7 3
2 5 7
3 1
3
10 4
3 5 8...

output:

1
6
1 3
2 4
1 3 6 8
1 3 5 7 9
1 3
1
1 3 6 8
1 3 5 7
1 4
1 3 6
2
1 5
1 4
2
1 3
2
1
2
3
1 3
2
1 3
2
1 3
2
4
1 5 7
2 7
2
2
3
2 4
1 3 6
1
1 4 6 9
1 8
2 4 6
1 3 5 7
1
1 3
1 4 7
2 7
1
3 5
2 7
1 4
1 3 6 8
2 4
1
3
1 3 5
1 4
6
2
2
4
1 4
1 3 5
3 5
1
4
2 4 6
1 4
2
2 6
1
5
2 6
1 4 6
1
1 3
1
1
9
1 3
5
1
1
1 4
3
...

result:

ok correct! (30000 test cases)

Test #25:

score: 9
Accepted
time: 11ms
memory: 3976kb

input:

1
1000
248 98
1 4 6 9 12 14 18 20 23 25 27 29 31 34 36 38 41 43 46 48 50 52 55 57 60 62 65 68 71 73 76 79 81 84 87 89 92 96 100 102 105 108 111 113 116 118 121 123 125 128 130 132 134 138 140 142 145 147 149 151 155 158 160 162 165 168 170 172 174 177 180 184 186 189 191 194 196 199 201 203 206 208 ...

output:

3 5 8 11 13 17 19 22 24 26 28 30 33 35 37 40 42 45 47 49 51 54 56 59 61 64 67 70 72 75 78 80 83 86 88 91 95 99 101 104 107 110 112 115 117 120 122 124 127 129 131 133 137 139 141 144 146 148 150 154 157 159 161 164 167 169 171 173 176 179 183 185 188 190 193 195 198 200 202 205 207 210 212 215 217 2...

input:

2
1000
268 87
1 3 8 10 14 17 20 25 27 30 33 37 39 42 47 49 54 56 59 61 65 67 69 75 78 82 85 89 93 95 98 100 102 105 108 114 118 121 124 127 133 135 138 141 143 146 149 151 154 158 160 163 167 170 173 176 180 182 185 188 191 195 197 200 202 205 208 210 212 214 217 219 221 227 229 232 237 240 242 244 ...

output:

2 4 9 11 15 18 21 26 28 31 34 38 40 43 48 50 55 57 60 62 66 68 70 76 79 83 86 90 94 96 99 101 103 106 109 115 119 122 125 128 134 136 139 142 144 147 150 152 155 159 161 164 168 171 174 177 181 183 186 189 192 196 198 201 203 206 209 211 213 215 218 220 222 228 230 233 238 241 243 245 249 251 256 25...

result:

ok correct! (1000 test cases)

Test #26:

score: 9
Accepted
time: 12ms
memory: 3944kb

input:

1
100
2709 278
8 16 18 36 40 46 51 55 65 68 97 115 117 128 131 157 161 163 167 171 174 184 197 236 262 265 269 301 304 307 311 317 338 340 354 361 368 385 389 391 415 431 446 450 455 462 469 515 518 530 532 543 549 552 558 578 588 592 610 620 625 630 636 665 682 706 709 723 739 748 751 761 765 770 7...

output:

7 15 17 35 39 45 50 54 64 67 96 114 116 127 130 156 160 162 166 170 173 183 196 235 261 264 268 300 303 306 310 316 337 339 353 360 367 384 388 390 414 430 445 449 454 461 468 514 517 529 531 542 548 551 557 577 587 591 609 619 624 629 635 664 681 705 708 722 738 747 750 760 764 769 787 796 817 823 ...

input:

2
100
2554 313
4 12 14 18 20 27 53 68 79 85 89 93 96 99 104 111 119 132 137 143 145 153 157 161 170 194 203 224 234 254 256 259 265 268 274 278 284 298 306 316 319 322 326 329 332 338 342 346 350 355 358 368 374 385 400 409 415 421 424 437 440 451 467 474 488 496 508 518 539 543 561 566 568 571 575 ...

output:

5 13 15 19 21 28 54 69 80 86 90 94 97 100 105 112 120 133 138 144 146 154 158 162 171 195 204 225 235 255 257 260 266 269 275 279 285 299 307 317 320 323 327 330 333 339 343 347 351 356 359 369 375 386 401 410 416 422 425 438 441 452 468 475 489 497 509 519 540 544 562 567 569 572 576 586 591 596 60...

result:

ok correct! (100 test cases)

Test #27:

score: 9
Accepted
time: 36ms
memory: 3932kb

input:

1
10000
684778493 25
35243363 58546853 102083056 125854247 134425699 162497412 163249035 246325159 246412329 249954620 254425090 277960843 319175235 321220843 380361372 381977208 396040413 408016409 449388147 459444481 464094718 512615935 514577714 547930406 601513819
540828616 22
312191 57504628 60...

output:

35243362 58546852 102083055 125854246 134425698 162497411 163249034 246325158 246412328 249954619 254425089 277960842 319175234 321220842 380361371 381977207 396040412 408016408 449388146 459444480 464094717 512615934 514577713 547930405 601513818
312190 57504627 60978752 101195260 110073234 1137721...

input:

2
10000
503458243 21
18568034 64259545 78115551 112150684 157465152 179922799 249926128 259935066 278664749 303353397 307353445 327232761 364371566 377808424 407708598 415943560 433327418 445390916 446025960 473501503 492920674
39958599 28
26251 653758 785249 3541646 5638059 7139717 8821204 9152464 ...

output:

18568035 64259546 78115552 112150685 157465153 179922800 249926129 259935067 278664750 303353398 307353446 327232762 364371567 377808425 407708599 415943561 433327419 445390917 446025961 473501504 492920675
26252 653759 785250 3541647 5638060 7139718 8821205 9152465 12025607 12858249 12895826 141296...

result:

ok correct! (10000 test cases)

Test #28:

score: 9
Accepted
time: 33ms
memory: 4152kb

input:

1
1000
980734876 298
631485 891002 3796671 5541647 8178135 11132013 13273977 20202318 20688205 22353387 36947383 39190102 39889382 40855788 42824207 43431589 43532897 47389025 48905139 49307045 56935787 61922782 62814336 64721467 66153154 68588666 76786249 77330755 81917548 84386796 84404919 8680468...

output:

631484 891001 3796670 5541646 8178134 11132012 13273976 20202317 20688204 22353386 36947382 39190101 39889381 40855787 42824206 43431588 43532896 47389024 48905138 49307044 56935786 61922781 62814335 64721466 66153153 68588665 76786248 77330754 81917547 84386795 84404918 86804687 88845167 89027732 9...

input:

2
1000
84148050 260
185007 527202 767095 1447383 1591336 1673511 1763680 1823703 2167702 2171269 2294374 2421256 2741671 2881289 3165639 3461276 3516450 3824386 4019699 5058117 5158982 5344145 5960092 6253716 6395013 6847722 6982497 7240374 7284401 7550140 7882299 8133382 8833469 9336444 9966697 112...

output:

185008 527203 767096 1447384 1591337 1673512 1763681 1823704 2167703 2171270 2294375 2421257 2741672 2881290 3165640 3461277 3516451 3824387 4019700 5058118 5158983 5344146 5960093 6253717 6395014 6847723 6982498 7240375 7284402 7550141 7882300 8133383 8833470 9336445 9966698 11290917 11531938 11701...

result:

ok correct! (1000 test cases)

Test #29:

score: 9
Accepted
time: 34ms
memory: 4228kb

input:

1
100
335372428 2082
696529 725775 787536 867123 1050888 1533281 1681175 1856557 2022664 2024567 2068960 2235324 2258249 2304888 2412211 2435791 2475712 3054029 3510562 3818864 3959552 4014667 4266733 4593580 4829651 5074107 5490077 5553136 5816596 6086443 6355960 6363039 6385267 6592282 6718919 708...

output:

696528 725774 787535 867122 1050887 1533280 1681174 1856556 2022663 2024566 2068959 2235323 2258248 2304887 2412210 2435790 2475711 3054028 3510561 3818863 3959551 4014666 4266732 4593579 4829650 5074106 5490076 5553135 5816595 6086442 6355959 6363038 6385266 6592281 6718918 7089737 7220306 7559607 ...

input:

2
100
231954147 2660
96197 254562 289417 294112 305738 375541 395274 535676 701930 727339 752665 760883 825736 845636 929517 1276072 1428054 1467850 1472901 1515603 1630049 1636102 1724135 1791641 1895938 1956292 2111538 2413756 2530981 2630039 2673423 2707850 2711913 2753540 2891387 2908283 2941774...

output:

96198 254563 289418 294113 305739 375542 395275 535677 701931 727340 752666 760884 825737 845637 929518 1276073 1428055 1467851 1472902 1515604 1630050 1636103 1724136 1791642 1895939 1956293 2111539 2413757 2530982 2630040 2673424 2707851 2711914 2753541 2891388 2908284 2941775 2956341 2963026 2991...

result:

ok correct! (100 test cases)

Subtask #6:

score: 9
Accepted

Test #30:

score: 9
Accepted
time: 42ms
memory: 6716kb

input:

1
1
1000000000 300000
408756052 408756979 408759607 408760032 408760051 408761093 408761416 408761494 408761726 408764755 408767605 408776555 408778463 408781171 408781316 408782320 408785971 408787248 408787812 408790957 408791686 408794839 408794850 408796477 408797483 408799152 408799165 40879929...

output:

408756051 408756978 408759606 408760031 408760050 408761092 408761415 408761493 408761725 408764754 408767604 408776554 408778462 408781170 408781315 408782319 408785970 408787247 408787811 408790956 408791685 408794838 408794849 408796476 408797482 408799151 408799164 408799297 408806127 408809964 ...

input:

2
1
1000000000 300000
408756051 408756978 408759606 408760031 408760050 408761092 408761415 408761493 408761725 408764754 408767604 408776554 408778462 408781170 408781315 408782319 408785970 408787247 408787811 408790956 408791685 408794838 408794849 408796476 408797482 408799151 408799164 40879929...

output:

408756052 408756979 408759607 408760032 408760051 408761093 408761416 408761494 408761726 408764755 408767605 408776555 408778463 408781171 408781316 408782320 408785971 408787248 408787812 408790957 408791686 408794839 408794850 408796477 408797483 408799152 408799165 408799298 408806128 408809965 ...

result:

ok correct! (1 test case)

Test #31:

score: 9
Accepted
time: 40ms
memory: 6696kb

input:

1
1
1000000 300000
101763 101764 101766 101772 101773 101779 101780 101781 101783 101785 101786 101787 101788 101790 101791 101793 101795 101796 101798 101801 101803 101805 101806 101807 101808 101809 101810 101812 101814 101816 101817 101818 101819 101820 101821 101823 101824 101826 101828 101832 1...

output:

1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 ...

input:

2
1
1000000 300000
1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1...

output:

101763 101764 101766 101772 101773 101779 101780 101781 101783 101785 101786 101787 101788 101790 101791 101793 101795 101796 101798 101801 101803 101805 101806 101807 101808 101809 101810 101812 101814 101816 101817 101818 101819 101820 101821 101823 101824 101826 101828 101832 101834 101835 101839...

result:

ok correct! (1 test case)

Test #32:

score: 9
Accepted
time: 41ms
memory: 6776kb

input:

1
1
2000000 300000
853089 853090 853091 853093 853095 853101 853103 853105 853111 853115 853117 853119 853120 853126 853127 853137 853144 853147 853149 853151 853164 853165 853166 853168 853169 853170 853175 853178 853188 853197 853199 853202 853209 853213 853214 853218 853221 853223 853226 853227 8...

output:

853086 853087 853088 853092 853094 853100 853102 853104 853110 853113 853114 853116 853118 853124 853125 853136 853143 853146 853148 853150 853159 853160 853161 853162 853163 853167 853174 853177 853187 853196 853198 853201 853208 853211 853212 853217 853220 853222 853224 853225 853231 853236 853241...

input:

2
1
2000000 300000
853086 853087 853088 853092 853094 853100 853102 853104 853110 853113 853114 853116 853118 853124 853125 853136 853143 853146 853148 853150 853159 853160 853161 853162 853163 853167 853174 853177 853187 853196 853198 853201 853208 853211 853212 853217 853220 853222 853224 853225 8...

output:

853089 853090 853091 853093 853095 853101 853103 853105 853111 853115 853117 853119 853120 853126 853127 853137 853144 853147 853149 853151 853164 853165 853166 853168 853169 853170 853175 853178 853188 853197 853199 853202 853209 853213 853214 853218 853221 853223 853226 853227 853232 853237 853242...

result:

ok correct! (1 test case)

Test #33:

score: 9
Accepted
time: 39ms
memory: 6576kb

input:

1
1
4000000 300000
1561077 1561083 1561085 1561087 1561101 1561103 1561119 1561128 1561131 1561147 1561150 1561155 1561160 1561171 1561173 1561175 1561176 1561189 1561197 1561199 1561200 1561203 1561205 1561208 1561219 1561233 1561241 1561242 1561262 1561264 1561280 1561284 1561291 1561299 1561304 1...

output:

1561076 1561082 1561084 1561086 1561100 1561102 1561118 1561127 1561130 1561146 1561149 1561154 1561159 1561169 1561170 1561172 1561174 1561188 1561195 1561196 1561198 1561202 1561204 1561207 1561218 1561232 1561239 1561240 1561261 1561263 1561279 1561283 1561290 1561298 1561303 1561306 1561309 1561...

input:

2
1
4000000 300000
1561076 1561082 1561084 1561086 1561100 1561102 1561118 1561127 1561130 1561146 1561149 1561154 1561159 1561169 1561170 1561172 1561174 1561188 1561195 1561196 1561198 1561202 1561204 1561207 1561218 1561232 1561239 1561240 1561261 1561263 1561279 1561283 1561290 1561298 1561303 1...

output:

1561077 1561083 1561085 1561087 1561101 1561103 1561119 1561128 1561131 1561147 1561150 1561155 1561160 1561171 1561173 1561175 1561176 1561189 1561197 1561199 1561200 1561203 1561205 1561208 1561219 1561233 1561241 1561242 1561262 1561264 1561280 1561284 1561291 1561299 1561304 1561307 1561310 1561...

result:

ok correct! (1 test case)

Test #34:

score: 9
Accepted
time: 46ms
memory: 6584kb

input:

1
1
1000000000 300000
805298423 805298424 805298425 805298427 805298429 805298431 805298432 805298434 805298439 805298441 805298444 805298448 805298451 805298452 805298453 805298454 805298455 805298458 805298460 805298463 805298466 805298469 805298471 805298473 805298477 805298478 805298479 80529848...

output:

805298419 805298420 805298421 805298422 805298426 805298428 805298430 805298433 805298438 805298440 805298442 805298443 805298445 805298446 805298447 805298449 805298450 805298456 805298457 805298459 805298461 805298462 805298464 805298465 805298467 805298468 805298470 805298472 805298474 805298475 ...

input:

2
1
1000000000 300000
805298419 805298420 805298421 805298422 805298426 805298428 805298430 805298433 805298438 805298440 805298442 805298443 805298445 805298446 805298447 805298449 805298450 805298456 805298457 805298459 805298461 805298462 805298464 805298465 805298467 805298468 805298470 80529847...

output:

805298423 805298424 805298425 805298427 805298429 805298431 805298432 805298434 805298439 805298441 805298444 805298448 805298451 805298452 805298453 805298454 805298455 805298458 805298460 805298463 805298466 805298469 805298471 805298473 805298477 805298478 805298479 805298481 805298482 805298484 ...

result:

ok correct! (1 test case)

Test #35:

score: 9
Accepted
time: 78ms
memory: 9920kb

input:

1
1
1000000000 300000
1 4 5 7 8 11 12 13 15 16 21 23 24 25 34 35 37 38 39 42 43 47 48 49 54 59 62 64 65 66 67 68 71 72 73 74 75 76 82 83 84 85 87 88 89 91 93 94 100 101 104 105 106 107 108 111 112 115 116 117 119 123 124 126 127 129 131 133 138 139 142 143 146 147 148 149 152 153 154 155 156 157 158...

output:

2 3 6 9 10 14 17 18 19 20 22 26 27 28 29 30 31 32 33 36 40 41 44 45 46 50 51 52 53 55 56 57 58 60 61 63 69 70 77 78 79 80 81 86 90 92 95 96 97 98 99 102 103 109 110 113 114 118 120 121 122 125 128 130 132 134 135 136 137 140 141 144 145 150 151 159 160 161 164 166 167 168 171 172 174 175 178 180 181...

input:

2
1
1000000000 300000
2 3 6 9 10 14 17 18 19 20 22 26 27 28 29 30 31 32 33 36 40 41 44 45 46 50 51 52 53 55 56 57 58 60 61 63 69 70 77 78 79 80 81 86 90 92 95 96 97 98 99 102 103 109 110 113 114 118 120 121 122 125 128 130 132 134 135 136 137 140 141 144 145 150 151 159 160 161 164 166 167 168 171 1...

output:

1 4 5 7 8 11 12 13 15 16 21 23 24 25 34 35 37 38 39 42 43 47 48 49 54 59 62 64 65 66 67 68 71 72 73 74 75 76 82 83 84 85 87 88 89 91 93 94 100 101 104 105 106 107 108 111 112 115 116 117 119 123 124 126 127 129 131 133 138 139 142 143 146 147 148 149 152 153 154 155 156 157 158 162 163 165 169 170 1...

result:

ok correct! (1 test case)

Test #36:

score: 9
Accepted
time: 44ms
memory: 6712kb

input:

1
1
1000000000 300000
999500002 999500003 999500005 999500007 999500009 999500010 999500011 999500012 999500014 999500017 999500018 999500023 999500025 999500026 999500028 999500031 999500032 999500035 999500036 999500038 999500039 999500040 999500041 999500042 999500044 999500046 999500047 99950004...

output:

999400000 999400001 999400002 999400003 999400004 999400005 999400006 999400007 999400008 999400009 999400010 999400011 999400012 999400013 999400014 999400015 999400016 999400017 999400018 999400019 999400020 999400021 999400022 999400023 999400024 999400025 999400026 999400027 999400028 999400029 ...

input:

2
1
1000000000 300000
999400000 999400001 999400002 999400003 999400004 999400005 999400006 999400007 999400008 999400009 999400010 999400011 999400012 999400013 999400014 999400015 999400016 999400017 999400018 999400019 999400020 999400021 999400022 999400023 999400024 999400025 999400026 99940002...

output:

999500002 999500003 999500005 999500007 999500009 999500010 999500011 999500012 999500014 999500017 999500018 999500023 999500025 999500026 999500028 999500031 999500032 999500035 999500036 999500038 999500039 999500040 999500041 999500042 999500044 999500046 999500047 999500049 999500053 999500054 ...

result:

ok correct! (1 test case)

Test #37:

score: 9
Accepted
time: 35ms
memory: 6780kb

input:

1
1
1000000000 300000
978876240 978876241 978876242 978876243 978876244 978876245 978876246 978876247 978876248 978876249 978876250 978876251 978876252 978876253 978876254 978876255 978876256 978876257 978876258 978876259 978876260 978876261 978876262 978876263 978876264 978876265 978876266 97887626...

output:

978576240 978576241 978576242 978576243 978576244 978576245 978576246 978576247 978576248 978576249 978576250 978576251 978576252 978576253 978576254 978576255 978576256 978576257 978576258 978576259 978576260 978576261 978576262 978576263 978576264 978576265 978576266 978576267 978576268 978576269 ...

input:

2
1
1000000000 300000
978576240 978576241 978576242 978576243 978576244 978576245 978576246 978576247 978576248 978576249 978576250 978576251 978576252 978576253 978576254 978576255 978576256 978576257 978576258 978576259 978576260 978576261 978576262 978576263 978576264 978576265 978576266 97857626...

output:

978876240 978876241 978876242 978876243 978876244 978876245 978876246 978876247 978876248 978876249 978876250 978876251 978876252 978876253 978876254 978876255 978876256 978876257 978876258 978876259 978876260 978876261 978876262 978876263 978876264 978876265 978876266 978876267 978876268 978876269 ...

result:

ok correct! (1 test case)

Test #38:

score: 9
Accepted
time: 79ms
memory: 11896kb

input:

1
1
600000 300000
293429 293430 293431 293432 293433 293434 293435 293436 293437 293438 293439 293440 293441 293442 293443 293444 293445 293446 293447 293448 293449 293450 293451 293452 293453 293454 293455 293456 293457 293458 293459 293460 293461 293462 293463 293464 293465 293466 293467 293468 29...

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

input:

2
1
600000 300000
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 ...

output:

293429 293430 293431 293432 293433 293434 293435 293436 293437 293438 293439 293440 293441 293442 293443 293444 293445 293446 293447 293448 293449 293450 293451 293452 293453 293454 293455 293456 293457 293458 293459 293460 293461 293462 293463 293464 293465 293466 293467 293468 293469 293470 293471...

result:

ok correct! (1 test case)

Test #39:

score: 9
Accepted
time: 27ms
memory: 3876kb

input:

1
30000
10 1
2
2 1
2
4 2
3 4
9 2
4 6
2 1
2
4 2
1 2
6 1
3
9 3
1 2 3
3 1
3
8 4
3 4 5 6
6 3
2 3 4
6 3
1 2 3
6 2
5 6
9 4
1 2 3 4
2 1
2
4 2
2 3
5 1
1
3 1
1
3 1
2
7 1
6
5 1
2
9 2
2 5
10 1
8
10 3
6 8 9
8 3
1 2 4
7 3
4 5 6
2 1
1
3 1
3
7 1
6
2 1
1
7 2
1 3
9 3
3 4 6
8 2
4 6
7 2
4 6
9 4
2 3 4 5
4 1
3
4 2
3 4
8...

output:

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

input:

2
30000
7 3
1 6 7
8 4
5 6 7 8
7 2
4 5
2 1
1
9 1
3
8 3
1 2 5
2 1
1
10 5
1 2 3 4 5
2 1
1
6 3
1 2 3
10 5
1 2 3 4 10
9 3
3 4 6
2 1
1
2 1
1
10 1
4
10 4
1 2 4 10
2 1
2
9 4
1 2 8 9
2 1
1
5 1
1
8 1
4
9 1
7
6 3
1 5 6
8 2
2 4
4 2
1 2
10 3
1 4 10
8 1
5
4 1
2
6 1
3
4 2
1 4
4 2
1 2
7 3
1 2 3
3 1
2
8 2
1 2
8 1
4
...

output:

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

result:

ok correct! (30000 test cases)

Test #40:

score: 9
Accepted
time: 10ms
memory: 3916kb

input:

1
1000
207 67
66 68 70 71 72 73 74 76 78 80 81 83 84 85 86 88 89 90 92 94 95 96 99 101 102 104 105 108 109 111 113 115 117 119 120 122 123 125 126 127 130 131 132 134 135 136 138 139 140 142 144 146 147 148 149 151 153 154 155 157 158 159 161 162 165 166 168
258 46
78 82 85 92 95 99 102 103 106 107 ...

output:

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 67 69 75 77 79 82 87 91 93 97 98 100 103 106 107 110 112 114 116 118 121 124 128 129 133 137 141 143 145 150 152 156 160 163 164 167
77 81 84 91 94 98 100 101 104 105 109 112 115 117 121 122 124 125 126 127 ...

input:

2
1000
295 50
14 15 17 20 24 26 30 33 36 37 39 40 42 46 47 50 56 63 68 70 72 79 80 84 89 93 96 98 101 110 112 114 119 122 125 127 131 132 133 138 140 143 147 149 151 152 154 155 157 159
211 26
27 31 35 36 39 42 47 48 57 60 62 67 75 76 81 89 95 100 102 109 110 119 122 123 127 130
230 105
1 2 3 4 5 6 ...

output:

16 18 19 21 25 27 31 34 38 41 43 44 45 48 49 51 57 64 69 71 73 81 82 85 90 94 97 99 102 111 113 115 120 123 126 128 134 135 136 139 141 144 148 150 153 156 158 160 161 162
28 32 37 38 40 43 49 50 58 61 63 68 77 78 82 90 96 101 103 111 112 120 124 125 128 131
86 87 88 89 90 91 92 93 94 95 96 98 99 10...

result:

ok correct! (1000 test cases)

Test #41:

score: 9
Accepted
time: 11ms
memory: 4236kb

input:

1
100
2698 1244
1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1117 1118 1119 1120 1121 1122 1123 1124...

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

input:

2
100
2995 1497
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...

output:

676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 ...

result:

ok correct! (100 test cases)

Test #42:

score: 9
Accepted
time: 35ms
memory: 4128kb

input:

1
10000
587171507 26
36711877 65929107 86763008 95982022 104961484 108731317 116257793 131216905 155938881 158979520 161095290 168461914 178935040 189219596 193659784 209980439 213771144 219133468 219140752 228760685 228888224 236945024 252628581 257908531 260743139 296343321
107645675 30
6272884 67...

output:

36711876 65929106 86763007 95982021 104961483 108731316 116257792 131216904 155938880 158979519 161095289 168461913 178935039 189219595 193659783 209980438 213771143 219133467 219140751 228760684 228888223 236945023 252628580 257908530 260743138 296343320
6272883 6771283 7219631 9785255 10501396 123...

input:

2
10000
662493294 20
223023059 232645343 235134607 245297722 254131201 347401251 352655935 354137754 376048257 386791961 389437442 403782962 418597563 449184562 459636806 462171034 469369344 475333451 522603502 539134252
334645408 21
9082377 14252823 22935541 37408870 47545346 66947589 79316979 9829...

output:

223023060 232645344 235134608 245297723 254131202 347401252 352655936 354137755 376048258 386791962 389437443 403782963 418597564 449184563 459636807 462171035 469369345 475333452 522603503 539134253
9082378 14252824 22935542 37408871 47545347 66947590 79316980 98291537 101420015 103678712 107972986...

result:

ok correct! (10000 test cases)

Test #43:

score: 9
Accepted
time: 33ms
memory: 4180kb

input:

1
1000
862470154 254
99696469 104882755 105689905 112730859 113403793 115661779 118250669 120242977 120997683 122815058 127931239 128138512 131624970 132661707 132667010 138091286 139450214 141315057 141866656 143542018 148203451 148686231 150055444 151674828 151737518 152082644 152570767 153099541 ...

output:

99696468 104882754 105689904 112730858 113403792 115661778 118250668 120242976 120997682 122815057 127931238 128138511 131624969 132661706 132667009 138091285 139450213 141315056 141866655 143542017 148203450 148686230 150055443 151674827 151737517 152082643 152570766 153099540 154079562 156757173 1...

input:

2
1000
869725508 292
326104593 328636678 329257138 330109148 335284708 336057921 336121819 336716651 337319486 340890251 340912967 341314693 342282241 342758349 342990844 345151114 346099330 348621266 349087510 352019057 354270010 355801426 356050850 358799000 359760881 361177130 366212979 367434081...

output:

326104594 328636679 329257139 330109149 335284709 336057922 336121820 336716652 337319487 340890252 340912968 341314694 342282242 342758350 342990845 345151115 346099331 348621267 349087511 352019058 354270011 355801427 356050851 358799001 359760882 361177131 366212980 367434082 368323054 369189942 ...

result:

ok correct! (1000 test cases)

Test #44:

score: 9
Accepted
time: 33ms
memory: 4000kb

input:

1
100
492026639 2654
232281839 232339849 232428424 232447337 232729258 232740243 232887822 232890314 233123782 233501097 233608165 233628278 233652911 233790948 234002111 234057061 234073509 234206152 234217636 234327281 234345766 234477159 234671941 234734932 234879704 235025093 235155173 235337602...

output:

232281838 232339848 232428423 232447336 232729257 232740242 232887821 232890313 233123781 233501096 233608164 233628277 233652910 233790947 234002110 234057060 234073508 234206151 234217635 234327280 234345765 234477158 234671940 234734931 234879703 235025092 235155172 235337601 235355199 235545233 ...

input:

2
100
414378425 2918
153016842 153019681 153048135 153218017 153263808 153289964 153378583 153470504 153670206 153791109 153851282 153887403 154099983 154122652 154271938 154403224 154466236 154498866 154575122 154663089 154696581 154795018 154908507 154927770 155101941 155126322 155161066 155305102...

output:

153016843 153019682 153048136 153218018 153263809 153289965 153378584 153470505 153670207 153791110 153851283 153887404 154099984 154122653 154271939 154403225 154466237 154498867 154575123 154663090 154696582 154795019 154908508 154927771 155101942 155126323 155161067 155305103 155359006 155436715 ...

result:

ok correct! (100 test cases)

Subtask #7:

score: 10
Accepted

Test #45:

score: 10
Accepted
time: 0ms
memory: 3968kb

input:

1
1
5000 1000
8 12 13 25 39 41 44 46 47 48 50 51 54 56 60 64 68 70 72 76 80 89 90 97 99 103 110 112 117 118 119 122 123 131 132 133 134 141 157 166 170 173 189 190 192 195 196 197 210 218 220 222 223 229 235 238 240 249 251 252 254 266 267 270 274 276 282 286 288 291 292 293 294 295 305 306 307 309 ...

output:

7 10 11 24 36 37 38 40 42 43 45 49 53 55 59 63 67 69 71 75 79 87 88 96 98 102 109 111 114 115 116 120 121 127 128 129 130 140 156 165 169 172 186 187 188 191 193 194 209 216 217 219 221 228 234 237 239 247 248 250 253 264 265 269 273 275 280 281 283 284 285 287 289 290 301 302 303 304 308 315 320 32...

input:

2
1
5000 1000
7 10 11 24 36 37 38 40 42 43 45 49 53 55 59 63 67 69 71 75 79 87 88 96 98 102 109 111 114 115 116 120 121 127 128 129 130 140 156 165 169 172 186 187 188 191 193 194 209 216 217 219 221 228 234 237 239 247 248 250 253 264 265 269 273 275 280 281 283 284 285 287 289 290 301 302 303 304 ...

output:

8 12 13 25 39 41 44 46 47 48 50 51 54 56 60 64 68 70 72 76 80 89 90 97 99 103 110 112 117 118 119 122 123 131 132 133 134 141 157 166 170 173 189 190 192 195 196 197 210 218 220 222 223 229 235 238 240 249 251 252 254 266 267 270 274 276 282 286 288 291 292 293 294 295 305 306 307 309 310 316 321 32...

result:

ok correct! (1 test case)

Test #46:

score: 10
Accepted
time: 1ms
memory: 3992kb

input:

1
1
5000 1500
10 11 13 16 17 19 20 21 24 25 27 28 30 31 34 36 37 43 46 47 50 51 52 54 55 56 57 59 60 61 63 65 67 70 71 72 75 76 78 81 82 83 84 85 86 87 91 93 96 99 100 101 102 104 105 111 112 114 115 116 118 122 125 126 127 128 132 134 137 138 141 151 153 154 156 157 158 159 161 164 167 172 173 174 ...

output:

1 2 3 4 5 6 7 8 9 12 14 15 18 22 23 26 29 32 33 35 38 39 40 41 42 44 45 48 49 53 58 62 64 66 68 69 73 74 77 79 80 88 89 90 92 94 95 97 98 103 107 108 109 110 113 117 119 120 121 123 124 131 133 135 136 140 145 146 147 148 149 150 152 155 160 162 163 165 166 168 169 170 171 175 177 178 181 183 184 18...

input:

2
1
5000 1500
1 2 3 4 5 6 7 8 9 12 14 15 18 22 23 26 29 32 33 35 38 39 40 41 42 44 45 48 49 53 58 62 64 66 68 69 73 74 77 79 80 88 89 90 92 94 95 97 98 103 107 108 109 110 113 117 119 120 121 123 124 131 133 135 136 140 145 146 147 148 149 150 152 155 160 162 163 165 166 168 169 170 171 175 177 178 ...

output:

10 11 13 16 17 19 20 21 24 25 27 28 30 31 34 36 37 43 46 47 50 51 52 54 55 56 57 59 60 61 63 65 67 70 71 72 75 76 78 81 82 83 84 85 86 87 91 93 96 99 100 101 102 104 105 111 112 114 115 116 118 122 125 126 127 128 132 134 137 138 141 151 153 154 156 157 158 159 161 164 167 172 173 174 176 179 180 18...

result:

ok correct! (1 test case)

Test #47:

score: 10
Accepted
time: 1ms
memory: 3972kb

input:

1
1
5000 2000
1 2 3 5 8 9 10 11 12 13 15 16 19 21 22 23 24 25 28 29 32 36 37 40 41 42 43 44 45 46 48 49 50 51 55 56 57 58 59 60 62 64 65 68 69 72 73 74 75 76 78 79 80 81 82 83 84 85 87 88 92 93 94 96 97 98 99 100 101 103 104 105 106 109 112 115 116 117 118 119 120 123 126 128 130 132 133 135 136 139...

output:

4 6 7 14 17 18 20 26 27 30 31 33 34 35 38 39 47 52 53 54 61 63 66 67 70 71 77 86 89 90 91 95 102 107 108 110 111 113 114 121 122 124 125 127 129 131 134 137 138 140 144 145 149 152 153 159 162 163 164 165 170 179 182 187 188 191 193 196 198 199 201 203 204 206 208 210 211 214 215 224 226 235 241 242...

input:

2
1
5000 2000
4 6 7 14 17 18 20 26 27 30 31 33 34 35 38 39 47 52 53 54 61 63 66 67 70 71 77 86 89 90 91 95 102 107 108 110 111 113 114 121 122 124 125 127 129 131 134 137 138 140 144 145 149 152 153 159 162 163 164 165 170 179 182 187 188 191 193 196 198 199 201 203 204 206 208 210 211 214 215 224 2...

output:

1 2 3 5 8 9 10 11 12 13 15 16 19 21 22 23 24 25 28 29 32 36 37 40 41 42 43 44 45 46 48 49 50 51 55 56 57 58 59 60 62 64 65 68 69 72 73 74 75 76 78 79 80 81 82 83 84 85 87 88 92 93 94 96 97 98 99 100 101 103 104 105 106 109 112 115 116 117 118 119 120 123 126 128 130 132 133 135 136 139 141 142 143 1...

result:

ok correct! (1 test case)

Test #48:

score: 10
Accepted
time: 1ms
memory: 4232kb

input:

1
1
5000 2500
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 9...

output:

2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 ...

input:

2
1
5000 2500
2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 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 correct! (1 test case)

Test #49:

score: 10
Accepted
time: 1ms
memory: 4220kb

input:

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

output:

17 31 34 50 55 57 59 61 62 69 80 103 114 119 126 127 131 136 137 144 147 152 155 158 159 165 181 192 193 200 211 218 220 236 239 240 241 243 267 268 269 272 280 294 295 298 323 326 328 331 332 349 351 368 370 371 373 374 376 377 381 382 398 399 400 404 409 415 416 417 424 426 458 480 485 490 496 508...

input:

2
1
5000 1500
17 31 34 50 55 57 59 61 62 69 80 103 114 119 126 127 131 136 137 144 147 152 155 158 159 165 181 192 193 200 211 218 220 236 239 240 241 243 267 268 269 272 280 294 295 298 323 326 328 331 332 349 351 368 370 371 373 374 376 377 381 382 398 399 400 404 409 415 416 417 424 426 458 480 4...

output:

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

result:

ok correct! (1 test case)

Test #50:

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

input:

1
1
5000 1000
2502 2503 2505 2506 2507 2508 2512 2513 2514 2515 2517 2519 2520 2521 2522 2523 2525 2526 2527 2528 2530 2531 2533 2534 2535 2536 2537 2538 2540 2541 2542 2545 2546 2547 2548 2549 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2569 2571 2576 2577 2580 2582 2583 2584 2...

output:

2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 ...

input:

2
1
5000 1000
2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2...

output:

2502 2503 2505 2506 2507 2508 2512 2513 2514 2515 2517 2519 2520 2521 2522 2523 2525 2526 2527 2528 2530 2531 2533 2534 2535 2536 2537 2538 2540 2541 2542 2545 2546 2547 2548 2549 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2569 2571 2576 2577 2580 2582 2583 2584 2585 2586 2587 ...

result:

ok correct! (1 test case)

Test #51:

score: 10
Accepted
time: 1ms
memory: 3960kb

input:

1
625
8 3
1 3 4
2 1
1
3 1
1
6 2
2 3
6 2
1 3
5 2
1 2
2 1
1
3 1
2
3 1
1
5 1
3
7 1
1
2 1
1
6 3
1 2 3
3 1
1
4 1
1
8 2
3 6
4 2
1 2
3 1
2
5 1
1
6 1
5
3 1
2
4 2
1 2
3 1
2
5 2
2 3
7 2
1 4
8 1
6
5 1
3
6 2
1 3
5 1
1
3 1
1
4 1
2
6 2
1 3
4 1
2
7 2
3 4
5 2
1 3
8 1
1
8 1
5
4 2
1 2
6 2
1 4
3 1
1
2 1
1
3 1
1
5 1
1
...

output:

2 7 8
2
3
1 6
2 6
4 5
2
1
3
2
7
2
4 5 6
3
4
2 5
3 4
1
5
4
1
3 4
1
1 5
3 7
5
2
2 6
5
3
1
2 6
1
1 2
2 5
8
4
3 4
3 6
3
2
3
5
1 4 8
1
2 5
4
2
3
7 8
3
3 6 7
7
2
3 4
3 6
1
2
2 7 8
1 4 8
2
4 5 6
1 5
1
3 6
3 4
2
1
2
1 3
8
4 7
2
3 4
4 5 6
4 5 6
1
1 3 8
5 6 7 8
2
3
2
4 5 6
2
3 6 7
3
3 4
1
5 6 7 8
2
1 5
3
7
1
...

input:

2
625
6 3
4 5 6
7 1
7
6 3
4 5 6
3 1
1
3 1
1
3 1
1
3 1
3
7 2
1 2
4 2
3 4
3 1
1
7 3
2 6 7
3 1
3
7 3
2 6 7
3 1
3
5 2
4 5
6 1
1
7 3
3 6 7
2 1
2
5 1
2
8 1
4
8 4
5 6 7 8
4 1
1
5 1
1
8 4
5 6 7 8
2 1
2
4 2
3 4
8 1
4
6 3
4 5 6
3 1
1
8 1
1
7 2
1 4
5 1
5
5 1
2
4 2
3 4
4 2
3 4
8 1
5
4 1
1
4 1
1
8 1
2
5 2
1 5
6 ...

output:

1 2 3
1
1 2 3
2
2
2
1
3 4
1 2
2
1 3 4
1
1 3 4
1
1 2
2
1 2 4
1
3
5
1 2 3 4
2
2
1 2 3 4
1
1 2
5
1 2 3
2
2
2 5
1
3
1 2
1 2
6
2
2
3
2 3
3 4
1 3
1
1 2 3
1 2 3
1
3
1 2 3
3
1
1
1
6
1 2
3 5
1 3 5
1
2 5
1
1 3 4
1
1
1 4
4
1 2 3
3
1 2 4
1
1
2
1 2
1
3
3
1
1 2
2
4
1
1 2 3 4
1
1 2
1
3
5
2
1
1
1
1
2
2 3
5
1
3 4
1 ...

result:

ok correct! (625 test cases)

Test #52:

score: 10
Accepted
time: 1ms
memory: 4188kb

input:

1
500
10 5
1 2 3 4 5
9 4
1 2 3 5
4 2
1 2
3 1
2
2 1
1
5 2
1 2
7 3
1 3 4
5 1
1
4 1
3
6 3
1 2 3
6 1
1
7 3
1 2 4
3 1
1
9 3
1 3 5
5 2
2 3
9 4
1 2 3 5
9 2
3 6
10 1
4
2 1
1
6 3
1 2 3
3 1
2
5 1
2
8 1
5
9 2
5 6
2 1
1
5 1
3
10 2
2 5
7 3
2 3 4
3 1
2
4 2
1 2
10 5
1 2 3 4 5
6 3
1 2 3
8 3
1 3 5
9 2
3 7
3 1
2
5 1
...

output:

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

input:

2
500
4 2
3 4
2 1
2
2 1
2
9 1
9
2 1
2
9 2
4 9
8 1
1
5 2
4 5
7 2
4 7
7 2
1 2
4 1
4
6 2
3 6
4 2
3 4
6 1
2
3 1
3
5 2
4 5
5 2
2 5
4 1
2
5 2
1 5
3 1
1
9 2
5 9
5 2
2 5
4 2
3 4
6 1
4
7 3
2 6 7
7 3
2 6 7
6 2
1 6
8 3
3 7 8
9 3
7 8 9
4 1
1
9 3
1 2 5
5 2
1 5
8 4
5 6 7 8
8 2
2 4
8 3
3 7 8
10 1
5
10 2
7 10
10 4
...

output:

1 2
1
1
1
1
1 5
2
1 2
1 5
3 4
1
1 4
1 2
3
1
1 2
1 3
3
2 3
2
1 6
1 3
1 2
5
1 3 4
1 3 4
2 3
1 2 4
1 2 3
2
3 4 6
2 3
1 2 3 4
3 5
1 2 4
6
1 8
1 3 5 6
1 3 5
1 2
2 3
1 4
1 4 5
1 2 4
1 2
2 4
3
1
1
2 4
1 3
1
1 2
2
5
3
1
2
1 5
3 5
3
1 2 3
2 3 4 5
1
1 2 3 4 5
2 4
1
2
1 5
8
1 2
1 2 4
1 2 3
2 3
1 2 3 4 5
2 5
1
...

result:

ok correct! (500 test cases)

Test #53:

score: 10
Accepted
time: 1ms
memory: 4140kb

input:

1
100
17 8
1 2 3 4 5 7 8 9
20 5
1 3 6 11 13
20 7
1 4 5 7 11 12 13
19 7
1 2 3 5 7 9 11
38 3
12 20 26
32 15
1 2 3 4 6 7 8 9 10 11 13 14 15 16 17
10 3
2 3 6
26 4
7 9 12 16
36 10
2 3 5 8 12 16 20 21 24 26
5 1
4
41 3
2 6 24
16 7
1 2 3 5 6 7 8
39 17
1 2 3 5 6 7 9 10 12 13 14 15 17 19 20 21 22
25 6
3 6 7 1...

output:

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

input:

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

output:

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

result:

ok correct! (100 test cases)

Test #54:

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

input:

1
50
17 3
1 5 9
99 27
3 7 9 12 16 22 23 24 25 29 32 33 36 38 40 42 47 48 51 56 58 60 62 63 66 70 72
43 1
42
38 1
20
38 4
9 18 23 25
41 3
11 24 25
54 24
1 2 3 4 6 7 9 10 11 13 14 15 16 17 18 20 21 23 24 25 26 27 28 30
61 5
7 15 35 45 53
21 2
3 16
40 5
16 18 20 22 33
37 4
2 7 18 31
44 15
1 3 6 8 9 10 ...

output:

4 8 17
2 6 8 11 15 18 19 20 21 28 30 31 35 37 39 41 45 46 50 54 55 57 59 61 65 69 71
41
19
8 17 22 24
10 22 23
5 8 12 19 22 29 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
6 14 34 44 52
2 15
15 17 19 21 32
1 6 17 30
2 4 5 7 11 15 17 19 24 26 27 41 42 43 44
20 60
2 3 5 7 9 11 17 21 29 32 37 ...

input:

2
50
54 24
5 8 12 19 22 29 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
74 19
2 3 5 7 9 11 17 21 29 32 37 40 43 45 47 49 52 73 74
22 11
12 13 14 15 16 17 18 19 20 21 22
95 26
2 4 5 7 9 11 12 14 17 26 27 34 36 37 40 42 44 47 51 53 55 57 60 64 65 68
65 28
3 4 6 9 17 22 26 31 33 47 48 49 50 51...

output:

1 2 3 4 6 7 9 10 11 13 14 15 16 17 18 20 21 23 24 25 26 27 28 30
1 4 6 8 10 12 13 14 18 22 30 33 38 41 44 46 48 50 53
1 2 3 4 5 6 7 8 9 10 11
3 6 8 10 13 15 16 18 19 28 29 35 38 39 41 43 45 48 52 54 56 58 61 66 67 69
1 2 5 7 8 10 11 12 13 14 15 16 18 19 20 21 23 24 25 27 28 29 30 32 34 35 36 37
7 9 ...

result:

ok correct! (50 test cases)

Subtask #8:

score: 12
Accepted

Test #55:

score: 12
Accepted
time: 0ms
memory: 3944kb

input:

1
1
100 30
1 8 9 10 12 17 22 24 25 27 28 29 32 33 34 42 45 47 50 52 54 56 62 71 79 81 85 86 90 94

output:

5 6 7 11 15 16 18 19 20 21 23 26 30 31 41 44 46 49 51 53 55 61 70 78 80 83 84 89 93 100

input:

2
1
100 30
5 6 7 11 15 16 18 19 20 21 23 26 30 31 41 44 46 49 51 53 55 61 70 78 80 83 84 89 93 100

output:

1 8 9 10 12 17 22 24 25 27 28 29 32 33 34 42 45 47 50 52 54 56 62 71 79 81 85 86 90 94

result:

ok correct! (1 test case)

Test #56:

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

input:

1
1
100 10
1 3 19 30 33 65 79 91 92 95

output:

2 18 29 32 64 78 89 90 94 100

input:

2
1
100 10
2 18 29 32 64 78 89 90 94 100

output:

1 3 19 30 33 65 79 91 92 95

result:

ok correct! (1 test case)

Test #57:

score: 12
Accepted
time: 0ms
memory: 3892kb

input:

1
1
100 40
5 8 10 14 16 17 21 24 27 31 32 33 34 35 37 39 40 44 49 50 51 53 58 61 62 67 69 70 72 74 75 76 77 85 87 90 93 96 97 99

output:

4 7 9 12 13 15 19 20 22 23 25 26 28 29 30 36 38 43 46 47 48 52 56 57 59 60 63 64 65 66 68 71 73 84 86 89 92 94 95 98

input:

2
1
100 40
4 7 9 12 13 15 19 20 22 23 25 26 28 29 30 36 38 43 46 47 48 52 56 57 59 60 63 64 65 66 68 71 73 84 86 89 92 94 95 98

output:

5 8 10 14 16 17 21 24 27 31 32 33 34 35 37 39 40 44 49 50 51 53 58 61 62 67 69 70 72 74 75 76 77 85 87 90 93 96 97 99

result:

ok correct! (1 test case)

Test #58:

score: 12
Accepted
time: 0ms
memory: 3964kb

input:

1
1
100 50
5 6 8 12 15 16 17 19 20 23 26 29 30 32 34 38 39 40 41 42 44 46 50 51 54 60 61 62 63 64 65 66 67 68 69 71 74 75 79 80 81 82 86 87 90 91 92 94 98 99

output:

1 2 3 4 7 9 10 11 13 14 18 21 22 24 25 27 28 31 33 35 36 37 43 45 47 48 49 52 53 55 56 57 58 59 70 72 73 76 77 78 83 84 85 88 89 93 95 96 97 100

input:

2
1
100 50
1 2 3 4 7 9 10 11 13 14 18 21 22 24 25 27 28 31 33 35 36 37 43 45 47 48 49 52 53 55 56 57 58 59 70 72 73 76 77 78 83 84 85 88 89 93 95 96 97 100

output:

5 6 8 12 15 16 17 19 20 23 26 29 30 32 34 38 39 40 41 42 44 46 50 51 54 60 61 62 63 64 65 66 67 68 69 71 74 75 79 80 81 82 86 87 90 91 92 94 98 99

result:

ok correct! (1 test case)

Test #59:

score: 12
Accepted
time: 0ms
memory: 3900kb

input:

1
1
100 20
28 31 32 33 34 35 38 39 40 41 43 44 45 46 47 51 52 53 55 56

output:

17 18 19 20 21 22 23 24 25 26 27 29 30 36 37 42 48 49 50 54

input:

2
1
100 20
17 18 19 20 21 22 23 24 25 26 27 29 30 36 37 42 48 49 50 54

output:

28 31 32 33 34 35 38 39 40 41 43 44 45 46 47 51 52 53 55 56

result:

ok correct! (1 test case)

Test #60:

score: 12
Accepted
time: 0ms
memory: 4176kb

input:

1
1
100 30
2 3 6 7 8 9 10 11 13 15 16 18 19 22 24 77 78 80 82 83 84 85 88 89 93 94 96 97 98 99

output:

1 4 5 12 14 17 21 23 64 65 66 67 68 69 70 71 72 73 74 75 76 79 81 86 87 90 91 92 95 100

input:

2
1
100 30
1 4 5 12 14 17 21 23 64 65 66 67 68 69 70 71 72 73 74 75 76 79 81 86 87 90 91 92 95 100

output:

2 3 6 7 8 9 10 11 13 15 16 18 19 22 24 77 78 80 82 83 84 85 88 89 93 94 96 97 98 99

result:

ok correct! (1 test case)

Test #61:

score: 12
Accepted
time: 0ms
memory: 3940kb

input:

1
1
100 40
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 21 23 24 25 27 28 33 34 35 36 38 41 42 44 45 46 49 51 52 53 57 60

output:

18 20 22 26 29 30 31 32 37 39 40 43 47 48 50 56 59 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

input:

2
1
100 40
18 20 22 26 29 30 31 32 37 39 40 43 47 48 50 56 59 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

output:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 19 21 23 24 25 27 28 33 34 35 36 38 41 42 44 45 46 49 51 52 53 57 60

result:

ok correct! (1 test case)

Test #62:

score: 12
Accepted
time: 0ms
memory: 3960kb

input:

1
1
100 30
53 54 55 57 59 60 61 62 63 65 67 71 72 74 76 80 81 82 83 84 85 87 90 91 94 95 97 98 99 100

output:

41 42 43 44 45 46 47 48 49 50 51 52 56 58 64 66 68 69 70 73 75 77 78 79 86 88 89 92 93 96

input:

2
1
100 30
41 42 43 44 45 46 47 48 49 50 51 52 56 58 64 66 68 69 70 73 75 77 78 79 86 88 89 92 93 96

output:

53 54 55 57 59 60 61 62 63 65 67 71 72 74 76 80 81 82 83 84 85 87 90 91 94 95 97 98 99 100

result:

ok correct! (1 test case)

Test #63:

score: 12
Accepted
time: 0ms
memory: 4148kb

input:

1
1
100 40
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 96 97 98 99 100

output:

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

input:

2
1
100 40
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

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 96 97 98 99 100

result:

ok correct! (1 test case)

Test #64:

score: 12
Accepted
time: 0ms
memory: 3900kb

input:

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

output:

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

input:

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

output:

3
1 2 5
2
1
1
3 4
1 4
1 3 4
2
2 5 8

result:

ok correct! (10 test cases)

Test #65:

score: 12
Accepted
time: 0ms
memory: 4180kb

input:

1
5
16 4
3 4 5 8
10 2
5 7
8 2
1 6
13 5
3 5 10 12 13
11 2
8 11

output:

1 2 7 16
4 6
5 8
2 4 8 9 11
7 10

input:

2
5
11 2
7 10
16 4
1 2 7 16
10 2
4 6
13 5
2 4 8 9 11
8 2
5 8

output:

8 11
3 4 5 8
5 7
3 5 10 12 13
1 6

result:

ok correct! (5 test cases)

Subtask #9:

score: 3
Accepted

Test #66:

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

input:

1
1
5000 100
19 71 363 365 392 404 520 539 563 567 717 729 851 930 937 1082 1088 1140 1311 1340 1351 1355 1357 1421 1455 1466 1472 1520 1598 1614 1758 1799 1827 1974 2062 2088 2136 2178 2183 2205 2232 2328 2355 2450 2469 2518 2535 2666 2723 2772 2782 2821 2833 2836 2896 2937 2940 3042 3066 3082 3191...

output:

18 70 362 364 391 403 519 538 562 566 716 728 850 929 936 1081 1087 1139 1310 1339 1350 1354 1356 1420 1454 1465 1471 1519 1597 1613 1757 1798 1826 1973 2061 2087 2135 2177 2182 2204 2231 2327 2354 2449 2468 2517 2534 2665 2722 2771 2781 2820 2832 2835 2895 2936 2939 3041 3065 3081 3190 3299 3322 33...

input:

2
1
5000 100
18 70 362 364 391 403 519 538 562 566 716 728 850 929 936 1081 1087 1139 1310 1339 1350 1354 1356 1420 1454 1465 1471 1519 1597 1613 1757 1798 1826 1973 2061 2087 2135 2177 2182 2204 2231 2327 2354 2449 2468 2517 2534 2665 2722 2771 2781 2820 2832 2835 2895 2936 2939 3041 3065 3081 3190...

output:

19 71 363 365 392 404 520 539 563 567 717 729 851 930 937 1082 1088 1140 1311 1340 1351 1355 1357 1421 1455 1466 1472 1520 1598 1614 1758 1799 1827 1974 2062 2088 2136 2178 2183 2205 2232 2328 2355 2450 2469 2518 2535 2666 2723 2772 2782 2821 2833 2836 2896 2937 2940 3042 3066 3082 3191 3300 3323 33...

result:

ok correct! (1 test case)

Test #67:

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

input:

1
1
5000 1000
4 12 16 69 81 88 91 101 106 107 108 113 115 118 131 135 136 139 141 145 152 154 160 163 164 172 173 180 182 185 197 201 205 219 225 227 230 242 251 252 266 267 274 277 278 280 282 294 295 298 300 301 304 307 312 321 325 326 328 334 343 344 345 346 348 351 359 380 382 383 390 394 398 40...

output:

3 11 15 68 80 87 90 100 103 104 105 112 114 117 130 133 134 138 140 144 151 153 159 161 162 170 171 179 181 184 196 200 204 218 224 226 229 241 249 250 264 265 273 275 276 279 281 292 293 296 297 299 303 306 311 320 323 324 327 333 339 340 341 342 347 350 358 378 379 381 389 393 397 404 407 408 413 ...

input:

2
1
5000 1000
3 11 15 68 80 87 90 100 103 104 105 112 114 117 130 133 134 138 140 144 151 153 159 161 162 170 171 179 181 184 196 200 204 218 224 226 229 241 249 250 264 265 273 275 276 279 281 292 293 296 297 299 303 306 311 320 323 324 327 333 339 340 341 342 347 350 358 378 379 381 389 393 397 40...

output:

4 12 16 69 81 88 91 101 106 107 108 113 115 118 131 135 136 139 141 145 152 154 160 163 164 172 173 180 182 185 197 201 205 219 225 227 230 242 251 252 266 267 274 277 278 280 282 294 295 298 300 301 304 307 312 321 325 326 328 334 343 344 345 346 348 351 359 380 382 383 390 394 398 405 409 410 414 ...

result:

ok correct! (1 test case)

Test #68:

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

input:

1
1
5000 1500
3 5 17 26 30 34 35 39 40 47 52 55 61 62 63 65 67 71 74 78 83 89 98 103 106 107 110 113 115 116 126 140 144 150 154 157 159 160 162 165 166 169 175 177 179 183 184 185 188 190 191 192 193 196 198 199 200 201 202 209 211 213 214 216 218 220 221 224 226 227 229 230 232 235 238 239 240 241...

output:

2 4 16 25 29 32 33 37 38 46 51 54 58 59 60 64 66 70 73 77 82 88 97 102 104 105 109 111 112 114 125 139 143 148 149 151 152 153 155 156 158 161 163 164 167 168 170 171 172 173 174 176 178 180 181 182 186 187 189 194 195 197 203 204 205 206 207 208 210 212 215 217 219 222 223 225 228 231 233 234 236 2...

input:

2
1
5000 1500
2 4 16 25 29 32 33 37 38 46 51 54 58 59 60 64 66 70 73 77 82 88 97 102 104 105 109 111 112 114 125 139 143 148 149 151 152 153 155 156 158 161 163 164 167 168 170 171 172 173 174 176 178 180 181 182 186 187 189 194 195 197 203 204 205 206 207 208 210 212 215 217 219 222 223 225 228 231...

output:

3 5 17 26 30 34 35 39 40 47 52 55 61 62 63 65 67 71 74 78 83 89 98 103 106 107 110 113 115 116 126 140 144 150 154 157 159 160 162 165 166 169 175 177 179 183 184 185 188 190 191 192 193 196 198 199 200 201 202 209 211 213 214 216 218 220 221 224 226 227 229 230 232 235 238 239 240 241 242 243 244 2...

result:

ok correct! (1 test case)

Test #69:

score: 3
Accepted
time: 1ms
memory: 3936kb

input:

1
1
5000 2000
5 6 7 8 10 14 15 17 18 20 21 24 26 28 31 35 37 38 39 41 42 43 45 46 47 51 52 53 56 57 60 61 62 67 69 76 77 78 80 84 85 86 91 100 101 103 104 105 106 109 111 114 116 118 121 123 125 131 134 136 137 138 141 146 147 148 149 150 151 159 160 162 163 166 169 170 171 176 177 178 179 183 184 1...

output:

1 2 3 4 9 11 12 13 16 19 22 23 25 27 29 30 32 33 34 36 40 44 48 49 50 54 55 58 59 66 68 73 74 75 79 81 82 83 90 95 96 97 98 99 102 108 110 113 115 117 120 122 124 128 129 130 132 133 135 139 140 142 143 144 145 156 157 158 161 164 165 167 168 172 173 174 175 180 181 182 185 186 188 191 193 194 195 1...

input:

2
1
5000 2000
1 2 3 4 9 11 12 13 16 19 22 23 25 27 29 30 32 33 34 36 40 44 48 49 50 54 55 58 59 66 68 73 74 75 79 81 82 83 90 95 96 97 98 99 102 108 110 113 115 117 120 122 124 128 129 130 132 133 135 139 140 142 143 144 145 156 157 158 161 164 165 167 168 172 173 174 175 180 181 182 185 186 188 191...

output:

5 6 7 8 10 14 15 17 18 20 21 24 26 28 31 35 37 38 39 41 42 43 45 46 47 51 52 53 56 57 60 61 62 67 69 76 77 78 80 84 85 86 91 100 101 103 104 105 106 109 111 114 116 118 121 123 125 131 134 136 137 138 141 146 147 148 149 150 151 159 160 162 163 166 169 170 171 176 177 178 179 183 184 187 189 190 192...

result:

ok correct! (1 test case)

Test #70:

score: 3
Accepted
time: 1ms
memory: 3900kb

input:

1
1
5000 2300
2 8 11 15 16 17 20 23 24 25 28 29 30 35 36 37 38 42 43 45 47 48 49 52 53 54 55 58 70 72 73 75 76 77 80 83 85 86 88 91 92 93 94 96 98 99 100 101 109 110 115 120 121 125 126 128 129 134 139 144 146 150 154 157 158 160 162 164 166 169 170 172 174 175 177 178 180 182 183 184 185 190 192 19...

output:

1 4 5 6 7 9 10 12 13 14 18 19 21 22 26 27 31 32 33 34 39 40 41 44 46 50 51 57 62 63 64 65 66 67 68 69 71 74 78 79 81 82 84 87 89 90 95 97 107 108 114 118 119 122 123 124 127 133 138 142 143 145 147 148 149 151 152 153 155 156 159 161 163 165 167 168 171 173 176 179 181 188 189 191 196 197 198 200 20...

input:

2
1
5000 2300
1 4 5 6 7 9 10 12 13 14 18 19 21 22 26 27 31 32 33 34 39 40 41 44 46 50 51 57 62 63 64 65 66 67 68 69 71 74 78 79 81 82 84 87 89 90 95 97 107 108 114 118 119 122 123 124 127 133 138 142 143 145 147 148 149 151 152 153 155 156 159 161 163 165 167 168 171 173 176 179 181 188 189 191 196 ...

output:

2 8 11 15 16 17 20 23 24 25 28 29 30 35 36 37 38 42 43 45 47 48 49 52 53 54 55 58 70 72 73 75 76 77 80 83 85 86 88 91 92 93 94 96 98 99 100 101 109 110 115 120 121 125 126 128 129 134 139 144 146 150 154 157 158 160 162 164 166 169 170 172 174 175 177 178 180 182 183 184 185 190 192 193 199 201 202 ...

result:

ok correct! (1 test case)

Test #71:

score: 3
Accepted
time: 1ms
memory: 3968kb

input:

1
1
5000 1000
4 11 14 15 16 28 29 35 37 41 43 45 47 52 53 57 58 60 62 64 71 72 73 75 80 82 83 89 92 94 103 106 109 112 113 114 119 123 125 128 129 137 138 139 143 147 148 155 156 167 168 170 171 173 174 176 177 186 190 192 201 206 207 209 215 216 217 218 220 222 224 229 234 235 238 239 249 251 254 2...

output:

3 9 10 12 13 26 27 34 36 40 42 44 46 50 51 55 56 59 61 63 68 69 70 74 78 79 81 88 91 93 102 105 107 108 110 111 118 122 124 126 127 134 135 136 142 145 146 153 154 162 163 164 165 166 169 172 175 185 189 191 200 204 205 208 211 212 213 214 219 221 223 228 232 233 236 237 247 248 250 252 253 256 261 ...

input:

2
1
5000 1000
3 9 10 12 13 26 27 34 36 40 42 44 46 50 51 55 56 59 61 63 68 69 70 74 78 79 81 88 91 93 102 105 107 108 110 111 118 122 124 126 127 134 135 136 142 145 146 153 154 162 163 164 165 166 169 172 175 185 189 191 200 204 205 208 211 212 213 214 219 221 223 228 232 233 236 237 247 248 250 25...

output:

4 11 14 15 16 28 29 35 37 41 43 45 47 52 53 57 58 60 62 64 71 72 73 75 80 82 83 89 92 94 103 106 109 112 113 114 119 123 125 128 129 137 138 139 143 147 148 155 156 167 168 170 171 173 174 176 177 186 190 192 201 206 207 209 215 216 217 218 220 222 224 229 234 235 238 239 249 251 254 255 257 258 262...

result:

ok correct! (1 test case)

Test #72:

score: 3
Accepted
time: 1ms
memory: 3896kb

input:

1
1
5000 1300
908 910 911 912 914 916 918 919 921 922 923 927 928 929 930 933 934 939 940 941 943 944 946 948 949 950 951 952 957 958 959 963 964 967 971 972 973 983 984 985 986 987 988 989 990 991 992 993 994 996 997 999 1000 1001 1005 1007 1009 1010 1011 1012 1014 1015 1019 1021 1022 1023 1024 102...

output:

306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 ...

input:

2
1
5000 1300
306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 37...

output:

908 910 911 912 914 916 918 919 921 922 923 927 928 929 930 933 934 939 940 941 943 944 946 948 949 950 951 952 957 958 959 963 964 967 971 972 973 983 984 985 986 987 988 989 990 991 992 993 994 996 997 999 1000 1001 1005 1007 1009 1010 1011 1012 1014 1015 1019 1021 1022 1023 1024 1026 1028 1031 10...

result:

ok correct! (1 test case)

Test #73:

score: 3
Accepted
time: 1ms
memory: 3964kb

input:

1
1
5000 2000
1 2 3 4 10 12 13 16 18 22 23 24 25 27 28 29 30 31 32 34 36 37 38 39 42 46 47 49 51 53 55 56 58 59 61 62 63 65 66 67 68 70 71 72 73 74 75 77 78 80 81 82 83 84 85 88 89 95 96 97 101 102 103 104 110 111 112 113 115 116 117 118 119 121 122 123 124 125 127 128 129 131 132 133 135 136 140 14...

output:

5 6 7 8 9 11 14 15 17 19 20 21 26 33 35 40 41 43 44 45 48 50 52 54 57 60 64 69 76 79 86 87 90 91 92 93 94 98 99 100 105 106 107 108 109 114 120 126 130 134 137 138 139 144 150 153 156 159 166 167 174 176 179 181 183 185 186 190 191 192 193 199 202 210 212 218 226 240 242 243 244 247 250 253 256 257 ...

input:

2
1
5000 2000
5 6 7 8 9 11 14 15 17 19 20 21 26 33 35 40 41 43 44 45 48 50 52 54 57 60 64 69 76 79 86 87 90 91 92 93 94 98 99 100 105 106 107 108 109 114 120 126 130 134 137 138 139 144 150 153 156 159 166 167 174 176 179 181 183 185 186 190 191 192 193 199 202 210 212 218 226 240 242 243 244 247 25...

output:

1 2 3 4 10 12 13 16 18 22 23 24 25 27 28 29 30 31 32 34 36 37 38 39 42 46 47 49 51 53 55 56 58 59 61 62 63 65 66 67 68 70 71 72 73 74 75 77 78 80 81 82 83 84 85 88 89 95 96 97 101 102 103 104 110 111 112 113 115 116 117 118 119 121 122 123 124 125 127 128 129 131 132 133 135 136 140 141 142 143 145 ...

result:

ok correct! (1 test case)

Test #74:

score: 3
Accepted
time: 1ms
memory: 3960kb

input:

1
1
5000 2100
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 15...

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 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 ...

input:

2
1
5000 2100
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 2984 2985 2986 2987 2988 2989 2990 2991 2992 2...

output:

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 ...

result:

ok correct! (1 test case)

Test #75:

score: 3
Accepted
time: 1ms
memory: 3944kb

input:

1
1
5000 1700
1 2 4 5 6 7 8 12 16 17 18 20 22 24 25 26 28 29 30 31 32 33 36 37 38 39 40 41 44 45 46 47 48 49 50 51 55 58 59 60 61 62 63 64 65 67 68 71 72 73 74 75 80 81 82 83 84 85 86 87 88 89 90 92 95 97 98 99 100 101 102 104 105 108 109 110 111 113 114 115 120 121 122 123 124 125 127 128 129 130 1...

output:

3 9 10 11 13 14 15 19 21 23 27 34 35 42 43 52 53 54 56 57 66 69 70 76 77 78 79 91 93 94 96 103 106 107 112 116 117 118 119 126 132 135 138 140 141 144 145 147 150 152 155 158 161 162 167 169 171 172 173 174 176 177 178 181 183 186 187 191 192 194 195 196 205 207 209 213 216 231 241 242 250 253 257 2...

input:

2
1
5000 1700
3 9 10 11 13 14 15 19 21 23 27 34 35 42 43 52 53 54 56 57 66 69 70 76 77 78 79 91 93 94 96 103 106 107 112 116 117 118 119 126 132 135 138 140 141 144 145 147 150 152 155 158 161 162 167 169 171 172 173 174 176 177 178 181 183 186 187 191 192 194 195 196 205 207 209 213 216 231 241 242...

output:

1 2 4 5 6 7 8 12 16 17 18 20 22 24 25 26 28 29 30 31 32 33 36 37 38 39 40 41 44 45 46 47 48 49 50 51 55 58 59 60 61 62 63 64 65 67 68 71 72 73 74 75 80 81 82 83 84 85 86 87 88 89 90 92 95 97 98 99 100 101 102 104 105 108 109 110 111 113 114 115 120 121 122 123 124 125 127 128 129 130 131 133 134 136...

result:

ok correct! (1 test case)

Test #76:

score: 3
Accepted
time: 1ms
memory: 4192kb

input:

1
1
5000 1200
3003 3007 3008 3009 3010 3012 3013 3014 3016 3017 3018 3019 3020 3022 3023 3024 3026 3027 3028 3029 3031 3032 3033 3034 3036 3039 3040 3041 3043 3044 3045 3048 3049 3052 3053 3056 3058 3059 3060 3062 3065 3066 3067 3069 3070 3073 3075 3077 3078 3079 3081 3082 3083 3084 3085 3087 3088 3...

output:

2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 ...

input:

2
1
5000 1200
2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2...

output:

3003 3007 3008 3009 3010 3012 3013 3014 3016 3017 3018 3019 3020 3022 3023 3024 3026 3027 3028 3029 3031 3032 3033 3034 3036 3039 3040 3041 3043 3044 3045 3048 3049 3052 3053 3056 3058 3059 3060 3062 3065 3066 3067 3069 3070 3073 3075 3077 3078 3079 3081 3082 3083 3084 3085 3087 3088 3091 3094 3096 ...

result:

ok correct! (1 test case)

Test #77:

score: 3
Accepted
time: 1ms
memory: 3888kb

input:

1
500
6 1
4
6 3
1 2 6
10 5
3 4 5 8 10
7 1
3
9 2
2 3
9 3
7 8 9
10 1
9
2 1
2
9 2
4 6
10 5
3 4 6 8 9
10 4
3 7 8 10
2 1
2
8 1
4
2 1
1
8 1
7
7 2
2 5
7 1
2
10 4
2 4 9 10
3 1
1
6 2
3 4
7 3
1 5 6
9 2
2 4
9 1
5
9 3
5 8 9
8 4
1 2 5 6
10 1
3
3 1
3
4 1
1
10 1
6
6 3
3 4 5
8 3
1 3 4
7 2
4 6
5 1
3
4 2
1 2
6 3
3 4 ...

output:

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

input:

2
500
6 1
1
4 1
3
5 2
2 4
8 1
2
4 2
1 2
8 2
3 6
4 1
2
7 3
1 3 5
3 1
2
4 2
1 3
7 1
4
3 1
1
10 5
1 2 8 9 10
3 1
2
4 2
3 4
10 4
1 2 5 10
9 4
1 5 6 7
5 2
1 5
10 2
1 9
5 2
2 4
9 3
4 6 7
4 2
1 3
10 5
2 4 5 8 9
5 1
5
9 3
3 4 8
4 1
1
7 3
2 6 7
4 1
3
5 1
1
5 1
2
9 1
5
7 2
1 7
3 1
3
5 1
2
6 2
1 2
10 2
8 9
9 4...

output:

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

result:

ok correct! (500 test cases)

Test #78:

score: 3
Accepted
time: 1ms
memory: 3952kb

input:

1
50
2 1
1
46 8
7 10 17 18 26 27 31 43
47 22
6 7 10 14 15 16 17 18 19 21 22 24 25 26 35 36 37 40 43 44 45 46
39 7
5 6 11 13 16 22 23
60 27
1 2 5 6 8 12 14 18 19 20 23 24 25 26 27 30 32 38 40 42 43 46 50 51 56 57 58
85 16
10 16 18 22 27 34 38 40 42 48 49 56 66 76 81 85
89 13
2 15 20 31 44 51 57 59 62...

output:

2
6 9 15 16 24 25 30 42
1 2 3 4 5 8 9 11 12 13 20 23 30 31 32 33 34 38 39 41 42 47
3 4 10 12 15 20 21
3 4 7 9 10 11 13 15 16 17 21 22 29 31 36 37 39 41 45 48 49 52 53 54 55 59 60
9 15 17 21 26 33 37 39 41 46 47 55 65 75 80 84
1 14 19 30 43 50 56 58 61 68 69 74 76
6 23 25 29 34 36 40 51 62 70 82 94
7...

input:

2
50
73 4
20 28 32 46
47 9
8 19 21 25 31 32 34 39 47
99 37
2 4 9 10 11 14 16 17 20 21 22 24 27 29 32 41 44 47 53 54 55 58 59 60 62 63 68 71 73 74 75 76 78 82 85 93 98
59 13
5 6 16 18 20 23 24 38 40 42 50 51 54
76 32
1 3 5 8 15 19 20 21 24 26 27 31 33 36 41 42 43 46 47 49 50 52 53 57 60 62 66 68 69 7...

output:

21 29 33 47
1 9 20 22 26 33 35 36 40
3 5 12 13 15 18 19 23 25 26 28 30 31 33 34 42 45 48 56 57 61 64 65 66 67 69 70 72 77 79 80 81 83 84 86 94 99
7 8 17 19 21 25 26 39 41 43 52 53 55
2 4 6 7 9 16 22 23 25 28 29 30 32 34 37 44 45 48 51 54 55 56 58 59 61 63 64 67 71 73 74 75
7 24 26 30 35 37 41 52 63 ...

result:

ok correct! (50 test cases)

Subtask #10:

score: 7
Accepted

Test #79:

score: 7
Accepted
time: 2ms
memory: 4324kb

input:

1
1
300000 10000
43 78 83 84 146 195 197 227 230 242 250 270 275 280 288 313 317 358 363 456 497 533 535 537 549 569 573 600 623 685 717 726 730 740 745 758 763 793 796 801 811 820 823 835 848 900 908 910 935 941 951 955 961 1009 1051 1093 1177 1183 1230 1294 1321 1332 1368 1403 1483 1500 1511 1574 ...

output:

42 77 81 82 145 194 196 226 229 241 249 269 274 279 287 312 316 357 362 455 496 532 534 536 548 568 572 599 622 684 716 725 729 739 744 757 762 792 795 800 810 819 822 834 847 899 907 909 934 940 950 954 960 1008 1050 1092 1176 1182 1229 1293 1320 1331 1367 1402 1482 1499 1510 1572 1573 1593 1601 16...

input:

2
1
300000 10000
42 77 81 82 145 194 196 226 229 241 249 269 274 279 287 312 316 357 362 455 496 532 534 536 548 568 572 599 622 684 716 725 729 739 744 757 762 792 795 800 810 819 822 834 847 899 907 909 934 940 950 954 960 1008 1050 1092 1176 1182 1229 1293 1320 1331 1367 1402 1482 1499 1510 1572 ...

output:

43 78 83 84 146 195 197 227 230 242 250 270 275 280 288 313 317 358 363 456 497 533 535 537 549 569 573 600 623 685 717 726 730 740 745 758 763 793 796 801 811 820 823 835 848 900 908 910 935 941 951 955 961 1009 1051 1093 1177 1183 1230 1294 1321 1332 1368 1403 1483 1500 1511 1574 1575 1594 1602 16...

result:

ok correct! (1 test case)

Test #80:

score: 7
Accepted
time: 16ms
memory: 4808kb

input:

1
1
300000 50000
1 4 11 13 15 22 36 40 41 44 45 46 49 56 57 67 70 83 86 90 92 95 103 108 113 116 122 128 134 141 144 153 154 156 163 164 171 172 181 194 196 197 205 206 207 209 223 231 239 249 259 261 266 281 288 291 301 311 318 319 326 339 368 371 381 383 393 395 403 407 416 418 436 440 442 447 452...

output:

3 10 12 14 21 35 37 38 39 42 43 48 54 55 66 69 82 85 89 91 94 102 107 112 115 121 127 133 140 143 151 152 155 161 162 169 170 180 192 193 195 202 203 204 208 222 230 238 248 258 260 265 280 287 290 300 310 316 317 325 338 367 370 380 382 392 394 402 406 415 417 435 439 441 446 451 453 454 461 463 47...

input:

2
1
300000 50000
3 10 12 14 21 35 37 38 39 42 43 48 54 55 66 69 82 85 89 91 94 102 107 112 115 121 127 133 140 143 151 152 155 161 162 169 170 180 192 193 195 202 203 204 208 222 230 238 248 258 260 265 280 287 290 300 310 316 317 325 338 367 370 380 382 392 394 402 406 415 417 435 439 441 446 451 4...

output:

1 4 11 13 15 22 36 40 41 44 45 46 49 56 57 67 70 83 86 90 92 95 103 108 113 116 122 128 134 141 144 153 154 156 163 164 171 172 181 194 196 197 205 206 207 209 223 231 239 249 259 261 266 281 288 291 301 311 318 319 326 339 368 371 381 383 393 395 403 407 416 418 436 440 442 447 452 455 456 462 464 ...

result:

ok correct! (1 test case)

Test #81:

score: 7
Accepted
time: 11ms
memory: 4612kb

input:

1
1
300000 80000
3 7 8 13 18 20 21 22 23 28 31 39 42 44 45 49 51 61 68 69 78 79 80 84 92 101 102 107 111 114 115 116 117 118 120 121 123 128 129 132 136 138 141 143 156 160 165 168 169 170 172 175 179 193 195 197 203 206 210 213 217 218 223 235 240 250 255 258 259 260 262 268 276 287 289 290 293 294...

output:

2 5 6 12 14 15 16 17 19 27 30 38 40 41 43 48 50 60 66 67 75 76 77 83 91 99 100 104 105 106 108 109 110 112 113 119 122 126 127 131 135 137 140 142 155 159 163 164 166 167 171 174 178 192 194 196 202 205 209 212 215 216 222 234 239 249 253 254 256 257 261 267 275 284 285 286 288 291 292 295 298 301 3...

input:

2
1
300000 80000
2 5 6 12 14 15 16 17 19 27 30 38 40 41 43 48 50 60 66 67 75 76 77 83 91 99 100 104 105 106 108 109 110 112 113 119 122 126 127 131 135 137 140 142 155 159 163 164 166 167 171 174 178 192 194 196 202 205 209 212 215 216 222 234 239 249 253 254 256 257 261 267 275 284 285 286 288 291 ...

output:

3 7 8 13 18 20 21 22 23 28 31 39 42 44 45 49 51 61 68 69 78 79 80 84 92 101 102 107 111 114 115 116 117 118 120 121 123 128 129 132 136 138 141 143 156 160 165 168 169 170 172 175 179 193 195 197 203 206 210 213 217 218 223 235 240 250 255 258 259 260 262 268 276 287 289 290 293 294 296 297 299 302 ...

result:

ok correct! (1 test case)

Test #82:

score: 7
Accepted
time: 41ms
memory: 6312kb

input:

1
1
300000 120000
2 3 5 9 10 13 14 15 22 23 24 27 29 34 37 39 42 44 46 48 51 53 58 61 62 64 70 71 75 76 77 78 85 86 88 89 90 91 92 101 102 104 107 109 110 111 113 114 115 116 125 127 130 131 133 134 136 138 139 142 145 149 151 153 155 156 158 160 162 166 170 171 175 176 177 179 180 181 182 183 184 1...

output:

1 4 6 7 8 11 12 19 20 21 26 28 33 36 38 41 43 45 47 50 52 57 59 60 63 67 68 69 72 73 74 79 80 81 82 83 84 87 95 96 97 98 99 100 103 105 106 108 112 122 123 124 126 128 129 132 135 137 140 141 143 144 146 147 148 150 152 154 157 159 161 163 164 165 167 168 169 172 173 174 178 187 188 190 191 193 195 ...

input:

2
1
300000 120000
1 4 6 7 8 11 12 19 20 21 26 28 33 36 38 41 43 45 47 50 52 57 59 60 63 67 68 69 72 73 74 79 80 81 82 83 84 87 95 96 97 98 99 100 103 105 106 108 112 122 123 124 126 128 129 132 135 137 140 141 143 144 146 147 148 150 152 154 157 159 161 163 164 165 167 168 169 172 173 174 178 187 18...

output:

2 3 5 9 10 13 14 15 22 23 24 27 29 34 37 39 42 44 46 48 51 53 58 61 62 64 70 71 75 76 77 78 85 86 88 89 90 91 92 101 102 104 107 109 110 111 113 114 115 116 125 127 130 131 133 134 136 138 139 142 145 149 151 153 155 156 158 160 162 166 170 171 175 176 177 179 180 181 182 183 184 185 189 192 194 196...

result:

ok correct! (1 test case)

Test #83:

score: 7
Accepted
time: 36ms
memory: 6012kb

input:

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

output:

5 16 17 18 30 39 56 67 74 82 100 104 114 118 125 130 164 174 193 195 201 208 209 210 237 239 251 264 275 277 282 292 300 302 305 326 328 345 350 358 364 370 371 373 376 386 387 393 395 425 426 427 428 441 442 446 451 452 465 473 488 494 515 527 529 539 542 551 553 566 576 582 588 590 593 596 602 607...

input:

2
1
300000 150000
5 16 17 18 30 39 56 67 74 82 100 104 114 118 125 130 164 174 193 195 201 208 209 210 237 239 251 264 275 277 282 292 300 302 305 326 328 345 350 358 364 370 371 373 376 386 387 393 395 425 426 427 428 441 442 446 451 452 465 473 488 494 515 527 529 539 542 551 553 566 576 582 588 5...

output:

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

result:

ok correct! (1 test case)

Test #84:

score: 7
Accepted
time: 16ms
memory: 4828kb

input:

1
1
300000 50000
2 3 4 5 13 18 19 21 22 26 32 43 47 51 54 56 60 62 72 79 80 86 87 88 89 91 103 105 108 111 116 149 152 160 162 171 173 175 176 184 187 190 211 212 213 218 219 222 224 227 233 234 242 246 249 251 252 254 265 268 273 275 281 292 294 297 298 303 306 308 311 326 329 330 331 341 344 347 3...

output:

1 12 15 16 17 20 25 31 42 46 50 53 55 59 61 71 77 78 82 83 84 85 90 102 104 107 110 115 148 151 159 161 169 170 172 174 183 186 189 208 209 210 216 217 221 223 226 231 232 241 245 247 248 250 253 264 267 272 274 280 291 293 295 296 302 305 307 310 324 325 327 328 340 343 346 359 362 365 368 383 384 ...

input:

2
1
300000 50000
1 12 15 16 17 20 25 31 42 46 50 53 55 59 61 71 77 78 82 83 84 85 90 102 104 107 110 115 148 151 159 161 169 170 172 174 183 186 189 208 209 210 216 217 221 223 226 231 232 241 245 247 248 250 253 264 267 272 274 280 291 293 295 296 302 305 307 310 324 325 327 328 340 343 346 359 362...

output:

2 3 4 5 13 18 19 21 22 26 32 43 47 51 54 56 60 62 72 79 80 86 87 88 89 91 103 105 108 111 116 149 152 160 162 171 173 175 176 184 187 190 211 212 213 218 219 222 224 227 233 234 242 246 249 251 252 254 265 268 273 275 281 292 294 297 298 303 306 308 311 326 329 330 331 341 344 347 360 363 366 369 38...

result:

ok correct! (1 test case)

Test #85:

score: 7
Accepted
time: 24ms
memory: 5212kb

input:

1
1
300000 80000
1 2 3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 32 33 35 37 38 40 42 43 44 45 47 48 49 50 51 52 53 56 57 60 61 62 64 66 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 84 85 86 88 89 90 91 92 93 94 95 97 98 100 101 102 104 105 106 107 108 109 110 111 113 ...

output:

8 30 34 36 39 41 46 54 55 58 59 63 65 67 83 87 96 99 103 112 118 128 140 159 160 161 162 163 165 175 187 188 189 190 198 199 204 205 210 215 227 229 238 244 245 246 254 255 281 284 290 294 298 300 304 306 311 319 322 327 333 338 344 350 351 352 354 361 363 373 378 391 394 400 406 417 422 431 435 438...

input:

2
1
300000 80000
8 30 34 36 39 41 46 54 55 58 59 63 65 67 83 87 96 99 103 112 118 128 140 159 160 161 162 163 165 175 187 188 189 190 198 199 204 205 210 215 227 229 238 244 245 246 254 255 281 284 290 294 298 300 304 306 311 319 322 327 333 338 344 350 351 352 354 361 363 373 378 391 394 400 406 41...

output:

1 2 3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 32 33 35 37 38 40 42 43 44 45 47 48 49 50 51 52 53 56 57 60 61 62 64 66 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 84 85 86 88 89 90 91 92 93 94 95 97 98 100 101 102 104 105 106 107 108 109 110 111 113 114 115 116 117 1...

result:

ok correct! (1 test case)

Test #86:

score: 7
Accepted
time: 32ms
memory: 5792kb

input:

1
1
300000 100000
1 3 6 8 9 11 12 19 20 21 22 27 28 29 31 32 38 40 43 44 46 47 48 52 55 56 61 65 66 68 69 70 72 76 83 90 92 97 99 100 102 104 105 106 108 109 114 115 116 121 122 124 125 126 128 129 131 132 134 135 136 137 138 145 146 147 148 150 155 157 160 161 162 163 165 166 167 173 175 176 178 17...

output:

2 4 5 7 10 13 14 15 16 17 18 23 24 25 26 30 33 34 35 36 37 39 41 42 45 49 50 51 53 54 57 58 59 60 62 63 64 67 71 73 74 75 77 78 79 80 81 82 84 85 86 87 88 89 91 93 94 95 96 98 101 103 107 110 111 112 113 117 118 119 120 123 127 130 133 139 140 141 142 143 144 149 151 152 153 154 156 158 159 164 168 ...

input:

2
1
300000 100000
2 4 5 7 10 13 14 15 16 17 18 23 24 25 26 30 33 34 35 36 37 39 41 42 45 49 50 51 53 54 57 58 59 60 62 63 64 67 71 73 74 75 77 78 79 80 81 82 84 85 86 87 88 89 91 93 94 95 96 98 101 103 107 110 111 112 113 117 118 119 120 123 127 130 133 139 140 141 142 143 144 149 151 152 153 154 15...

output:

1 3 6 8 9 11 12 19 20 21 22 27 28 29 31 32 38 40 43 44 46 47 48 52 55 56 61 65 66 68 69 70 72 76 83 90 92 97 99 100 102 104 105 106 108 109 114 115 116 121 122 124 125 126 128 129 131 132 134 135 136 137 138 145 146 147 148 150 155 157 160 161 162 163 165 166 167 173 175 176 178 179 180 183 184 185 ...

result:

ok correct! (1 test case)

Test #87:

score: 7
Accepted
time: 24ms
memory: 5056kb

input:

1
1
300000 90000
3 4 5 7 8 10 11 12 14 15 16 18 19 21 22 23 24 27 29 30 31 32 33 34 35 36 37 38 39 40 42 45 46 49 50 51 52 53 54 57 58 59 61 63 64 65 67 68 69 72 75 78 81 82 83 84 85 87 88 91 92 93 96 97 98 99 102 104 105 106 107 108 111 112 113 114 115 117 118 119 120 121 122 124 125 127 128 129 13...

output:

1 2 6 9 13 17 20 25 26 28 41 43 44 47 48 55 56 60 62 66 70 71 73 74 76 77 79 80 86 89 90 94 95 100 101 103 109 110 116 123 126 131 135 136 138 140 141 142 143 144 145 146 148 152 154 155 157 161 162 163 165 168 170 173 175 176 177 178 180 184 185 186 189 191 194 197 198 199 203 204 205 207 209 212 2...

input:

2
1
300000 90000
1 2 6 9 13 17 20 25 26 28 41 43 44 47 48 55 56 60 62 66 70 71 73 74 76 77 79 80 86 89 90 94 95 100 101 103 109 110 116 123 126 131 135 136 138 140 141 142 143 144 145 146 148 152 154 155 157 161 162 163 165 168 170 173 175 176 177 178 180 184 185 186 189 191 194 197 198 199 203 204 ...

output:

3 4 5 7 8 10 11 12 14 15 16 18 19 21 22 23 24 27 29 30 31 32 33 34 35 36 37 38 39 40 42 45 46 49 50 51 52 53 54 57 58 59 61 63 64 65 67 68 69 72 75 78 81 82 83 84 85 87 88 91 92 93 96 97 98 99 102 104 105 106 107 108 111 112 113 114 115 117 118 119 120 121 122 124 125 127 128 129 130 132 133 134 137...

result:

ok correct! (1 test case)

Test #88:

score: 7
Accepted
time: 14ms
memory: 4444kb

input:

1
1
300000 110000
130000 130002 130003 130004 130005 130006 130007 130008 130009 130010 130011 130013 130016 130017 130019 130020 130021 130022 130024 130025 130026 130027 130028 130029 130030 130031 130033 130035 130037 130038 130039 130040 130041 130042 130043 130044 130046 130047 130049 130050 13...

output:

80000 80001 80002 80003 80004 80005 80006 80007 80008 80009 80010 80011 80012 80013 80014 80015 80016 80017 80018 80019 80020 80021 80022 80023 80024 80025 80026 80027 80028 80029 80030 80031 80032 80033 80034 80035 80036 80037 80038 80039 80040 80041 80042 80043 80044 80045 80046 80047 80048 80049 ...

input:

2
1
300000 110000
80000 80001 80002 80003 80004 80005 80006 80007 80008 80009 80010 80011 80012 80013 80014 80015 80016 80017 80018 80019 80020 80021 80022 80023 80024 80025 80026 80027 80028 80029 80030 80031 80032 80033 80034 80035 80036 80037 80038 80039 80040 80041 80042 80043 80044 80045 80046 ...

output:

130000 130002 130003 130004 130005 130006 130007 130008 130009 130010 130011 130013 130016 130017 130019 130020 130021 130022 130024 130025 130026 130027 130028 130029 130030 130031 130033 130035 130037 130038 130039 130040 130041 130042 130043 130044 130046 130047 130049 130050 130052 130053 130055...

result:

ok correct! (1 test case)

Test #89:

score: 7
Accepted
time: 25ms
memory: 5604kb

input:

1
1
300000 140000
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 ...

output:

112152 112153 112154 112155 112156 112157 112158 112159 112160 112161 112162 112163 112164 112165 112166 112167 112168 112169 112170 112171 112172 112173 112174 112175 112176 112177 112178 112179 112180 112181 112182 112183 112184 112185 112186 112187 112188 112189 112190 112191 112192 112193 112194...

input:

2
1
300000 140000
112152 112153 112154 112155 112156 112157 112158 112159 112160 112161 112162 112163 112164 112165 112166 112167 112168 112169 112170 112171 112172 112173 112174 112175 112176 112177 112178 112179 112180 112181 112182 112183 112184 112185 112186 112187 112188 112189 112190 112191 11...

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 correct! (1 test case)

Test #90:

score: 7
Accepted
time: 23ms
memory: 4124kb

input:

1
30000
5 2
3 4
6 2
1 5
5 1
4
4 1
1
4 1
4
2 1
1
7 2
3 6
5 2
1 2
3 1
3
2 1
2
4 2
1 3
6 1
1
2 1
1
10 2
2 5
10 2
1 3
7 3
1 2 4
3 1
2
6 1
2
10 3
1 3 8
5 1
2
5 2
1 4
9 1
7
6 3
2 4 5
4 1
4
10 5
4 5 6 9 10
2 1
1
10 2
6 9
5 2
2 4
7 2
6 7
5 1
2
5 1
5
5 2
1 5
2 1
1
2 1
1
4 2
1 4
10 3
7 8 10
9 4
5 6 7 9
5 2
4 ...

output:

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

input:

2
30000
2 1
1
3 1
1
10 4
2 5 6 9
7 2
5 6
8 4
1 2 4 7
6 2
1 5
8 4
1 3 6 8
9 2
2 6
8 1
4
7 3
4 5 6
5 2
2 4
4 2
1 4
4 1
1
3 1
2
5 1
3
4 2
3 4
9 4
4 6 7 8
8 1
3
6 3
1 3 5
3 1
3
7 1
7
4 1
3
7 1
3
6 3
4 5 6
7 2
1 3
4 1
2
6 3
1 2 5
5 1
1
5 2
2 4
8 4
4 5 6 7
6 3
1 3 5
8 1
5
3 1
3
7 3
3 6 7
2 1
1
9 3
1 7 9
4...

output:

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

result:

ok correct! (30000 test cases)

Test #91:

score: 7
Accepted
time: 13ms
memory: 3888kb

input:

1
3000
97 27
3 9 13 14 15 18 20 21 35 46 48 54 56 57 58 59 63 64 73 76 77 82 86 88 90 91 92
94 38
5 7 9 12 13 14 17 18 19 20 22 24 25 26 28 29 31 43 46 50 53 55 56 57 62 64 65 66 68 69 71 82 83 85 86 89 91 94
74 22
4 5 6 13 17 21 29 32 33 34 35 38 39 41 44 56 58 62 66 67 69 73
67 19
1 2 8 12 13 19 2...

output:

2 8 10 11 12 16 17 19 34 45 47 50 51 52 53 55 61 62 72 74 75 81 83 84 85 87 89
1 2 3 4 6 8 10 11 15 16 21 23 27 30 42 45 48 49 51 52 54 58 59 60 61 63 67 70 78 79 80 81 84 87 88 90 92 93
1 2 3 12 16 20 26 27 28 30 31 36 37 40 43 55 57 61 64 65 68 72
7 10 11 18 22 24 25 26 28 35 36 37 43 46 59 61 64 ...

input:

2
3000
53 26
1 2 4 7 8 10 11 14 18 20 24 25 26 27 28 29 32 35 37 38 42 45 46 50 52 53
62 31
1 5 9 10 12 20 21 25 26 27 30 31 32 36 37 40 42 43 44 45 47 49 50 51 54 55 57 58 59 61 62
75 13
8 9 13 17 24 36 44 45 48 63 66 70 71
72 27
1 4 6 11 12 18 19 21 25 26 27 28 30 33 35 36 37 41 43 46 52 53 55 59 ...

output:

3 5 6 9 12 13 15 16 17 19 21 22 30 31 33 34 36 39 40 41 43 44 47 48 49 51
2 3 4 6 7 8 11 13 14 15 16 17 18 19 22 23 24 28 29 33 34 35 38 39 41 46 48 52 53 56 60
10 11 14 18 25 37 46 47 49 64 67 72 73
2 5 7 13 14 20 22 23 29 31 32 34 38 39 40 42 44 45 47 48 54 56 57 60 66 69 71
3 4 7 8 19 20 23 26 29...

result:

ok correct! (3000 test cases)

Test #92:

score: 7
Accepted
time: 9ms
memory: 4220kb

input:

1
300
515 177
2 5 6 7 8 9 13 17 26 38 46 50 52 55 57 59 60 61 62 68 70 72 80 82 86 87 88 93 94 103 104 105 106 111 116 122 123 126 127 129 134 138 140 144 146 147 149 150 152 155 159 162 164 166 168 169 171 172 177 182 183 188 190 191 198 199 202 204 208 210 213 216 218 222 223 225 227 228 229 233 2...

output:

1 3 4 12 16 25 37 45 47 48 49 51 53 54 56 58 67 69 71 79 81 83 84 85 91 92 99 100 101 102 110 115 120 121 124 125 128 133 137 139 141 142 143 145 148 151 154 157 158 160 161 163 165 167 170 176 180 181 186 187 189 196 197 201 203 207 209 212 214 215 217 219 220 221 224 226 232 238 240 250 257 261 26...

input:

2
300
780 179
6 13 14 19 26 30 40 46 48 52 55 56 58 59 62 69 73 85 97 98 103 106 109 114 115 122 125 126 128 132 136 137 153 164 165 169 179 182 186 187 188 201 211 214 218 224 232 235 238 240 241 254 255 257 259 260 269 272 274 286 288 302 306 309 311 321 323 325 334 339 344 347 350 355 361 366 369...

output:

1 2 3 7 15 16 20 27 31 41 47 49 53 57 60 61 63 64 70 74 86 99 100 104 107 110 116 117 123 127 129 130 133 138 139 154 166 167 170 180 183 189 190 191 202 212 215 219 225 233 236 239 242 243 256 258 261 262 263 270 273 275 287 289 303 307 310 312 322 324 326 335 340 345 348 351 356 362 367 370 377 38...

result:

ok correct! (300 test cases)

Subtask #11:

score: 7
Accepted

Test #93:

score: 7
Accepted
time: 1ms
memory: 4016kb

input:

1
1
1000000000 5000
142830 837372 1031624 1394124 1397380 1577671 1619716 1895054 2004216 2067374 2120527 2234328 2549170 3097800 3390668 3567753 3775237 4797343 4814389 4971353 5607418 5619485 5903034 6036068 6083563 6154402 6274315 6596441 6869140 7332716 7670739 7711787 7715259 7964665 8009716 81...

output:

142829 837371 1031623 1394123 1397379 1577670 1619715 1895053 2004215 2067373 2120526 2234327 2549169 3097799 3390667 3567752 3775236 4797342 4814388 4971352 5607417 5619484 5903033 6036067 6083562 6154401 6274314 6596440 6869139 7332715 7670738 7711786 7715258 7964664 8009715 8145748 8505442 870600...

input:

2
1
1000000000 5000
142829 837371 1031623 1394123 1397379 1577670 1619715 1895053 2004215 2067373 2120526 2234327 2549169 3097799 3390667 3567752 3775236 4797342 4814388 4971352 5607417 5619484 5903033 6036067 6083562 6154401 6274314 6596440 6869139 7332715 7670738 7711786 7715258 7964664 8009715 81...

output:

142830 837372 1031624 1394124 1397380 1577671 1619716 1895054 2004216 2067374 2120527 2234328 2549170 3097800 3390668 3567753 3775237 4797343 4814389 4971353 5607418 5619485 5903034 6036068 6083563 6154402 6274315 6596441 6869140 7332716 7670739 7711787 7715259 7964665 8009716 8145749 8505443 870600...

result:

ok correct! (1 test case)

Test #94:

score: 7
Accepted
time: 1ms
memory: 4240kb

input:

1
1
30000 5000
3 6 12 24 27 31 35 44 49 51 56 63 67 68 70 72 77 81 85 86 90 94 105 108 115 122 131 132 140 148 149 170 172 175 181 186 191 196 200 202 204 210 218 221 227 229 230 231 232 234 235 239 241 255 284 286 289 290 291 300 302 303 306 318 322 324 327 345 348 367 373 375 378 380 386 389 404 4...

output:

2 5 11 23 26 30 34 43 48 50 55 62 65 66 69 71 76 80 83 84 89 93 104 107 114 121 129 130 139 146 147 169 171 174 180 185 190 195 199 201 203 209 217 220 222 223 224 225 226 228 233 238 240 254 282 283 285 287 288 298 299 301 305 317 321 323 326 344 347 366 372 374 377 379 385 388 403 405 430 441 443 ...

input:

2
1
30000 5000
2 5 11 23 26 30 34 43 48 50 55 62 65 66 69 71 76 80 83 84 89 93 104 107 114 121 129 130 139 146 147 169 171 174 180 185 190 195 199 201 203 209 217 220 222 223 224 225 226 228 233 238 240 254 282 283 285 287 288 298 299 301 305 317 321 323 326 344 347 366 372 374 377 379 385 388 403 4...

output:

3 6 12 24 27 31 35 44 49 51 56 63 67 68 70 72 77 81 85 86 90 94 105 108 115 122 131 132 140 148 149 170 172 175 181 186 191 196 200 202 204 210 218 221 227 229 230 231 232 234 235 239 241 255 284 286 289 290 291 300 302 303 306 318 322 324 327 345 348 367 373 375 378 380 386 389 404 406 431 442 444 ...

result:

ok correct! (1 test case)

Test #95:

score: 7
Accepted
time: 1ms
memory: 4216kb

input:

1
1
1000000000 5000
387339264 387339266 387339267 387339268 387339270 387339271 387339272 387339273 387339274 387339275 387339276 387339277 387339278 387339279 387339280 387339281 387339282 387339285 387339287 387339288 387339289 387339291 387339292 387339293 387339294 387339296 387339297 387339299 ...

output:

387336263 387336264 387336265 387336266 387336267 387336268 387336269 387336270 387336271 387336272 387336273 387336274 387336275 387336276 387336277 387336278 387336279 387336280 387336281 387336282 387336283 387336284 387336285 387336286 387336287 387336288 387336289 387336290 387336291 387336292 ...

input:

2
1
1000000000 5000
387336263 387336264 387336265 387336266 387336267 387336268 387336269 387336270 387336271 387336272 387336273 387336274 387336275 387336276 387336277 387336278 387336279 387336280 387336281 387336282 387336283 387336284 387336285 387336286 387336287 387336288 387336289 387336290 ...

output:

387339264 387339266 387339267 387339268 387339270 387339271 387339272 387339273 387339274 387339275 387339276 387339277 387339278 387339279 387339280 387339281 387339282 387339285 387339287 387339288 387339289 387339291 387339292 387339293 387339294 387339296 387339297 387339299 387339300 387339301 ...

result:

ok correct! (1 test case)

Test #96:

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

input:

1
1
1000000000 5000
639409160 639409161 639409162 639409163 639409164 639409171 639409172 639409175 639409178 639409180 639409182 639409183 639409184 639409185 639409186 639409188 639409190 639409192 639409193 639409194 639409197 639409200 639409201 639409202 639409203 639409205 639409207 639409208 ...

output:

639409073 639409074 639409075 639409076 639409077 639409078 639409079 639409080 639409081 639409082 639409083 639409084 639409085 639409086 639409087 639409088 639409089 639409090 639409091 639409092 639409093 639409094 639409095 639409096 639409097 639409098 639409099 639409100 639409101 639409102 ...

input:

2
1
1000000000 5000
639409073 639409074 639409075 639409076 639409077 639409078 639409079 639409080 639409081 639409082 639409083 639409084 639409085 639409086 639409087 639409088 639409089 639409090 639409091 639409092 639409093 639409094 639409095 639409096 639409097 639409098 639409099 639409100 ...

output:

639409160 639409161 639409162 639409163 639409164 639409171 639409172 639409175 639409178 639409180 639409182 639409183 639409184 639409185 639409186 639409188 639409190 639409192 639409193 639409194 639409197 639409200 639409201 639409202 639409203 639409205 639409207 639409208 639409214 639409215 ...

result:

ok correct! (1 test case)

Test #97:

score: 7
Accepted
time: 2ms
memory: 4316kb

input:

1
1
1000000000 5000
1 3 7 9 15 17 18 22 23 24 27 33 35 45 48 50 52 53 64 70 71 78 81 86 87 90 91 94 99 100 105 107 108 121 127 130 136 140 146 149 153 155 159 161 169 171 175 176 182 194 204 205 208 210 213 232 234 240 241 242 245 248 253 254 266 273 275 276 280 288 289 290 291 298 300 301 305 306 3...

output:

2 6 8 13 14 16 19 20 21 26 32 34 44 46 47 49 51 63 68 69 77 80 84 85 88 89 93 97 98 103 104 106 120 126 129 135 139 145 148 152 154 158 160 168 170 173 174 181 193 202 203 207 209 212 231 233 237 238 239 244 247 251 252 265 271 272 274 279 284 285 286 287 296 297 299 303 304 317 319 322 323 329 331 ...

input:

2
1
1000000000 5000
2 6 8 13 14 16 19 20 21 26 32 34 44 46 47 49 51 63 68 69 77 80 84 85 88 89 93 97 98 103 104 106 120 126 129 135 139 145 148 152 154 158 160 168 170 173 174 181 193 202 203 207 209 212 231 233 237 238 239 244 247 251 252 265 271 272 274 279 284 285 286 287 296 297 299 303 304 317 ...

output:

1 3 7 9 15 17 18 22 23 24 27 33 35 45 48 50 52 53 64 70 71 78 81 86 87 90 91 94 99 100 105 107 108 121 127 130 136 140 146 149 153 155 159 161 169 171 175 176 182 194 204 205 208 210 213 232 234 240 241 242 245 248 253 254 266 273 275 276 280 288 289 290 291 298 300 301 305 306 318 320 324 325 330 3...

result:

ok correct! (1 test case)

Test #98:

score: 7
Accepted
time: 2ms
memory: 4324kb

input:

1
1
1000000000 5000
1 10 11 18 21 23 24 26 27 32 33 34 38 40 46 56 57 61 63 66 67 70 73 74 76 77 85 89 90 91 92 93 94 97 98 100 102 105 107 108 111 116 120 126 128 129 132 135 139 141 145 153 155 161 165 166 168 169 172 174 178 181 182 184 187 192 194 200 205 209 211 215 222 224 225 228 231 236 245 ...

output:

8 9 16 17 19 20 22 25 29 30 31 37 39 45 54 55 60 62 64 65 68 69 71 72 75 81 82 83 84 86 87 88 95 96 99 101 103 104 106 110 115 119 124 125 127 131 134 138 140 144 152 154 160 162 163 164 167 171 173 177 179 180 183 186 191 193 199 204 208 210 214 220 221 223 227 230 235 244 247 253 254 256 257 258 2...

input:

2
1
1000000000 5000
8 9 16 17 19 20 22 25 29 30 31 37 39 45 54 55 60 62 64 65 68 69 71 72 75 81 82 83 84 86 87 88 95 96 99 101 103 104 106 110 115 119 124 125 127 131 134 138 140 144 152 154 160 162 163 164 167 171 173 177 179 180 183 186 191 193 199 204 208 210 214 220 221 223 227 230 235 244 247 2...

output:

1 10 11 18 21 23 24 26 27 32 33 34 38 40 46 56 57 61 63 66 67 70 73 74 76 77 85 89 90 91 92 93 94 97 98 100 102 105 107 108 111 116 120 126 128 129 132 135 139 141 145 153 155 161 165 166 168 169 172 174 178 181 182 184 187 192 194 200 205 209 211 215 222 224 225 228 231 236 245 248 255 260 261 265 ...

result:

ok correct! (1 test case)

Test #99:

score: 7
Accepted
time: 1ms
memory: 4240kb

input:

1
1
1000000000 5000
999975001 999975004 999975005 999975009 999975013 999975015 999975017 999975020 999975032 999975033 999975040 999975041 999975042 999975055 999975061 999975063 999975066 999975072 999975076 999975086 999975097 999975102 999975105 999975111 999975117 999975122 999975129 999975142 ...

output:

999975000 999975002 999975003 999975008 999975012 999975014 999975016 999975019 999975030 999975031 999975037 999975038 999975039 999975054 999975060 999975062 999975065 999975071 999975075 999975085 999975096 999975101 999975104 999975110 999975116 999975121 999975128 999975140 999975141 999975155 ...

input:

2
1
1000000000 5000
999975000 999975002 999975003 999975008 999975012 999975014 999975016 999975019 999975030 999975031 999975037 999975038 999975039 999975054 999975060 999975062 999975065 999975071 999975075 999975085 999975096 999975101 999975104 999975110 999975116 999975121 999975128 999975140 ...

output:

999975001 999975004 999975005 999975009 999975013 999975015 999975017 999975020 999975032 999975033 999975040 999975041 999975042 999975055 999975061 999975063 999975066 999975072 999975076 999975086 999975097 999975102 999975105 999975111 999975117 999975122 999975129 999975142 999975143 999975156 ...

result:

ok correct! (1 test case)

Test #100:

score: 7
Accepted
time: 1ms
memory: 4244kb

input:

1
1
1000000000 5000
623189688 623189689 623189690 623189691 623189692 623189693 623189694 623189695 623189696 623189697 623189698 623189699 623189700 623189701 623189702 623189703 623189704 623189705 623189706 623189707 623189708 623189709 623189710 623189711 623189712 623189713 623189714 623189715 ...

output:

623184688 623184689 623184690 623184691 623184692 623184693 623184694 623184695 623184696 623184697 623184698 623184699 623184700 623184701 623184702 623184703 623184704 623184705 623184706 623184707 623184708 623184709 623184710 623184711 623184712 623184713 623184714 623184715 623184716 623184717 ...

input:

2
1
1000000000 5000
623184688 623184689 623184690 623184691 623184692 623184693 623184694 623184695 623184696 623184697 623184698 623184699 623184700 623184701 623184702 623184703 623184704 623184705 623184706 623184707 623184708 623184709 623184710 623184711 623184712 623184713 623184714 623184715 ...

output:

623189688 623189689 623189690 623189691 623189692 623189693 623189694 623189695 623189696 623189697 623189698 623189699 623189700 623189701 623189702 623189703 623189704 623189705 623189706 623189707 623189708 623189709 623189710 623189711 623189712 623189713 623189714 623189715 623189716 623189717 ...

result:

ok correct! (1 test case)

Test #101:

score: 7
Accepted
time: 1ms
memory: 3920kb

input:

1
100
102234216 28
821836 12050893 19180771 27315903 30061799 30407373 33923060 35794838 40454507 40648598 41441128 46060216 48940648 48953100 52065427 52936567 54507464 57351436 60291379 60420114 64281695 68513184 74295066 77796659 85307683 85338464 89185551 94023035
950323965 11
510509 184260338 1...

output:

821835 12050892 19180770 27315902 30061798 30407372 33923059 35794837 40454506 40648597 41441127 46060215 48940647 48953099 52065426 52936566 54507463 57351435 60291378 60420113 64281694 68513183 74295065 77796658 85307682 85338463 89185550 94023034
510508 184260337 186570176 187133918 256740887 381...

input:

2
100
654661061 12
9335549 31554847 44840685 139058209 208780249 252534591 273020900 570345312 585432807 586381815 595246176 648103724
453925392 28
25955930 35651383 54313446 86653854 106777935 117318976 136362704 137444680 140329253 147795873 149253578 249933143 252373190 254956129 261840811 280361...

output:

9335550 31554848 44840686 139058210 208780250 252534592 273020901 570345313 585432808 586381816 595246177 648103725
25955931 35651384 54313447 86653855 106777936 117318977 136362705 137444681 140329254 147795874 149253579 249933144 252373191 254956130 261840812 280361832 311314575 342403749 36481857...

result:

ok correct! (100 test cases)

Test #102:

score: 7
Accepted
time: 1ms
memory: 4152kb

input:

1
100
87 25
1 4 9 12 17 26 28 32 35 40 41 46 50 51 60 63 64 65 71 80 81 82 84 86 87
15 5
3 4 5 9 14
11 5
1 2 4 10 11
37 2
12 17
33 2
30 31
26 11
1 4 5 13 14 15 18 20 21 22 24
36 17
4 5 7 8 9 10 12 17 18 20 24 25 27 28 32 35 36
95 46
2 3 7 8 10 11 14 16 17 19 25 26 28 29 30 33 34 37 40 41 49 50 51 59...

output:

3 8 11 16 25 27 31 34 38 39 45 48 49 58 59 61 62 70 75 76 77 78 79 83 85
1 2 8 13 15
3 6 7 8 9
11 16
28 29
2 3 9 10 11 12 16 17 19 23 26
1 2 3 6 11 15 16 19 21 22 23 26 29 30 31 33 34
1 4 5 6 9 12 13 15 18 21 22 23 24 27 31 32 36 38 39 43 44 45 46 47 48 52 53 54 55 56 57 58 60 66 69 70 72 73 74 76 7...

input:

2
100
39 13
4 5 6 8 14 15 18 21 22 25 27 33 39
9 3
1 2 8
76 18
2 5 10 24 25 30 43 46 48 57 61 64 65 68 69 72 73 75
36 17
1 2 3 6 11 15 16 19 21 22 23 26 29 30 31 33 34
47 1
4
94 12
6 8 13 40 44 54 55 57 60 65 70 85
17 5
3 4 12 13 15
95 27
5 10 14 15 16 21 22 24 28 33 36 39 44 45 48 49 52 54 65 67 68...

output:

1 7 9 10 11 16 17 19 23 24 26 28 34
3 4 9
1 3 6 11 26 27 31 44 47 49 58 62 66 67 70 71 74 76
4 5 7 8 9 10 12 17 18 20 24 25 27 28 32 35 36
5
7 9 14 41 45 56 58 59 61 66 71 86
5 6 14 16 17
6 11 17 18 19 23 25 26 29 34 37 40 46 47 50 51 53 55 66 69 70 73 74 76 81 84 87
5 7
3 7 9 12 17 19 20 25 29 33 3...

result:

ok correct! (100 test cases)

Subtask #12:

score: 7
Accepted

Test #103:

score: 7
Accepted
time: 38ms
memory: 6520kb

input:

1
1
1000000000 300000
8140 24077 33879 40646 41993 42253 46535 46774 47773 60778 68389 80128 81700 85026 86191 87771 88028 94612 95473 96265 97011 99471 104013 107579 109028 113542 119019 121123 125874 131041 132036 133211 145619 147729 149546 149727 151921 155596 156260 166214 170584 173155 177356 ...

output:

8139 24076 33878 40645 41992 42252 46534 46773 47772 60777 68388 80127 81699 85025 86190 87770 88027 94611 95472 96264 97010 99470 104012 107578 109027 113541 119018 121122 125873 131040 132035 133210 145618 147728 149545 149726 151920 155595 156259 166213 170583 173154 177355 181382 181676 181794 1...

input:

2
1
1000000000 300000
8139 24076 33878 40645 41992 42252 46534 46773 47772 60777 68388 80127 81699 85025 86190 87770 88027 94611 95472 96264 97010 99470 104012 107578 109027 113541 119018 121122 125873 131040 132035 133210 145618 147728 149545 149726 151920 155595 156259 166213 170583 173154 177355 ...

output:

8140 24077 33879 40646 41993 42253 46535 46774 47773 60778 68389 80128 81700 85026 86191 87771 88028 94612 95473 96265 97011 99471 104013 107579 109028 113542 119019 121123 125874 131041 132036 133211 145619 147729 149546 149727 151921 155596 156260 166214 170584 173155 177356 181383 181677 181795 1...

result:

ok correct! (1 test case)

Test #104:

score: 7
Accepted
time: 97ms
memory: 12376kb

input:

1
1
600000 300000
4 5 8 11 13 15 16 18 20 23 25 26 29 30 31 36 37 38 39 40 43 44 45 46 47 48 49 50 52 58 61 62 63 64 66 67 69 70 71 74 76 78 80 82 83 84 85 92 93 94 95 98 100 102 103 105 106 107 110 114 115 116 117 118 122 124 130 133 134 135 136 138 139 140 141 143 145 146 151 152 156 157 159 160 1...

output:

1 2 3 6 7 9 10 12 14 17 19 21 22 24 27 28 32 33 34 35 41 42 51 53 54 55 56 57 59 60 65 68 72 73 75 77 79 81 86 87 88 89 90 91 96 97 99 101 104 108 109 111 112 113 119 120 121 123 125 126 127 128 129 131 132 137 142 144 147 148 149 150 153 154 155 158 163 164 165 168 170 172 173 177 178 179 183 184 1...

input:

2
1
600000 300000
1 2 3 6 7 9 10 12 14 17 19 21 22 24 27 28 32 33 34 35 41 42 51 53 54 55 56 57 59 60 65 68 72 73 75 77 79 81 86 87 88 89 90 91 96 97 99 101 104 108 109 111 112 113 119 120 121 123 125 126 127 128 129 131 132 137 142 144 147 148 149 150 153 154 155 158 163 164 165 168 170 172 173 177...

output:

4 5 8 11 13 15 16 18 20 23 25 26 29 30 31 36 37 38 39 40 43 44 45 46 47 48 49 50 52 58 61 62 63 64 66 67 69 70 71 74 76 78 80 82 83 84 85 92 93 94 95 98 100 102 103 105 106 107 110 114 115 116 117 118 122 124 130 133 134 135 136 138 139 140 141 143 145 146 151 152 156 157 159 160 161 162 166 167 169...

result:

ok correct! (1 test case)

Test #105:

score: 7
Accepted
time: 101ms
memory: 11496kb

input:

1
1
1000000 300000
1 6 9 11 12 18 19 23 24 26 31 33 34 35 36 37 39 47 48 58 59 60 63 69 73 78 81 90 91 93 94 96 110 111 118 121 124 125 128 131 135 136 139 140 142 144 147 151 153 154 162 171 180 181 186 195 198 201 204 208 211 218 219 222 224 226 227 236 238 240 242 245 249 252 256 259 265 267 275 ...

output:

5 7 8 10 16 17 20 21 22 25 27 28 29 30 32 38 45 46 55 56 57 62 68 72 77 80 87 88 89 92 95 108 109 117 120 122 123 127 130 133 134 137 138 141 143 146 149 150 152 161 170 178 179 185 194 197 200 203 207 210 216 217 220 221 223 225 235 237 239 241 244 248 251 255 258 264 266 274 279 280 281 286 289 29...

input:

2
1
1000000 300000
5 7 8 10 16 17 20 21 22 25 27 28 29 30 32 38 45 46 55 56 57 62 68 72 77 80 87 88 89 92 95 108 109 117 120 122 123 127 130 133 134 137 138 141 143 146 149 150 152 161 170 178 179 185 194 197 200 203 207 210 216 217 220 221 223 225 235 237 239 241 244 248 251 255 258 264 266 274 279...

output:

1 6 9 11 12 18 19 23 24 26 31 33 34 35 36 37 39 47 48 58 59 60 63 69 73 78 81 90 91 93 94 96 110 111 118 121 124 125 128 131 135 136 139 140 142 144 147 151 153 154 162 171 180 181 186 195 198 201 204 208 211 218 219 222 224 226 227 236 238 240 242 245 249 252 256 259 265 267 275 282 283 284 287 291...

result:

ok correct! (1 test case)

Test #106:

score: 7
Accepted
time: 44ms
memory: 7524kb

input:

1
1
1000000000 300000
868765587 868765588 868765590 868765591 868765597 868765598 868765599 868765601 868765602 868765603 868765604 868765605 868765606 868765608 868765610 868765612 868765614 868765617 868765620 868765624 868765625 868765626 868765627 868765629 868765630 868765631 868765634 86876563...

output:

868665587 868665588 868665589 868665590 868665591 868665592 868665593 868665594 868665595 868665596 868665597 868665598 868665599 868665600 868665601 868665602 868665603 868665604 868665605 868665606 868665607 868665608 868665609 868665610 868665611 868665612 868665613 868665614 868665615 868665616 ...

input:

2
1
1000000000 300000
868665587 868665588 868665589 868665590 868665591 868665592 868665593 868665594 868665595 868665596 868665597 868665598 868665599 868665600 868665601 868665602 868665603 868665604 868665605 868665606 868665607 868665608 868665609 868665610 868665611 868665612 868665613 86866561...

output:

868765587 868765588 868765590 868765591 868765597 868765598 868765599 868765601 868765602 868765603 868765604 868765605 868765606 868765608 868765610 868765612 868765614 868765617 868765620 868765624 868765625 868765626 868765627 868765629 868765630 868765631 868765634 868765635 868765637 868765639 ...

result:

ok correct! (1 test case)

Test #107:

score: 7
Accepted
time: 40ms
memory: 6712kb

input:

1
1
1000000000 300000
158108569 158108571 158108575 158108576 158108578 158108579 158108580 158108581 158108588 158108592 158108593 158108597 158108600 158108607 158108609 158108610 158108617 158108618 158108630 158108641 158108642 158108643 158108644 158108647 158108648 158108653 158108658 15810865...

output:

158108566 158108567 158108568 158108570 158108572 158108573 158108574 158108577 158108587 158108590 158108591 158108596 158108599 158108605 158108606 158108608 158108615 158108616 158108629 158108637 158108638 158108639 158108640 158108645 158108646 158108652 158108656 158108657 158108662 158108666 ...

input:

2
1
1000000000 300000
158108566 158108567 158108568 158108570 158108572 158108573 158108574 158108577 158108587 158108590 158108591 158108596 158108599 158108605 158108606 158108608 158108615 158108616 158108629 158108637 158108638 158108639 158108640 158108645 158108646 158108652 158108656 15810865...

output:

158108569 158108571 158108575 158108576 158108578 158108579 158108580 158108581 158108588 158108592 158108593 158108597 158108600 158108607 158108609 158108610 158108617 158108618 158108630 158108641 158108642 158108643 158108644 158108647 158108648 158108653 158108658 158108659 158108663 158108669 ...

result:

ok correct! (1 test case)

Test #108:

score: 7
Accepted
time: 39ms
memory: 6712kb

input:

1
1
1000000000 300000
873070146 873070147 873070148 873070149 873070151 873070152 873070154 873070158 873070160 873070167 873070168 873070173 873070176 873070177 873070179 873070182 873070184 873070185 873070190 873070193 873070195 873070197 873070204 873070207 873070211 873070214 873070217 87307021...

output:

873070141 873070142 873070143 873070144 873070145 873070150 873070153 873070157 873070159 873070165 873070166 873070172 873070174 873070175 873070178 873070180 873070181 873070183 873070189 873070192 873070194 873070196 873070203 873070206 873070210 873070213 873070215 873070216 873070219 873070234 ...

input:

2
1
1000000000 300000
873070141 873070142 873070143 873070144 873070145 873070150 873070153 873070157 873070159 873070165 873070166 873070172 873070174 873070175 873070178 873070180 873070181 873070183 873070189 873070192 873070194 873070196 873070203 873070206 873070210 873070213 873070215 87307021...

output:

873070146 873070147 873070148 873070149 873070151 873070152 873070154 873070158 873070160 873070167 873070168 873070173 873070176 873070177 873070179 873070182 873070184 873070185 873070190 873070193 873070195 873070197 873070204 873070207 873070211 873070214 873070217 873070218 873070220 873070235 ...

result:

ok correct! (1 test case)

Test #109:

score: 7
Accepted
time: 44ms
memory: 6716kb

input:

1
1
1000000000 300000
492256081 492256090 492256092 492256098 492256103 492256104 492256107 492256112 492256114 492256116 492256118 492256128 492256132 492256134 492256142 492256146 492256163 492256167 492256170 492256182 492256185 492256188 492256189 492256202 492256216 492256228 492256229 49225623...

output:

492256080 492256089 492256091 492256097 492256101 492256102 492256106 492256111 492256113 492256115 492256117 492256127 492256131 492256133 492256141 492256145 492256162 492256166 492256169 492256181 492256184 492256186 492256187 492256201 492256215 492256226 492256227 492256235 492256245 492256246 ...

input:

2
1
1000000000 300000
492256080 492256089 492256091 492256097 492256101 492256102 492256106 492256111 492256113 492256115 492256117 492256127 492256131 492256133 492256141 492256145 492256162 492256166 492256169 492256181 492256184 492256186 492256187 492256201 492256215 492256226 492256227 49225623...

output:

492256081 492256090 492256092 492256098 492256103 492256104 492256107 492256112 492256114 492256116 492256118 492256128 492256132 492256134 492256142 492256146 492256163 492256167 492256170 492256182 492256185 492256188 492256189 492256202 492256216 492256228 492256229 492256236 492256247 492256248 ...

result:

ok correct! (1 test case)

Test #110:

score: 7
Accepted
time: 96ms
memory: 11476kb

input:

1
1
1000000000 300000
1 3 4 5 7 9 10 11 14 15 19 20 22 23 24 25 31 34 36 37 41 49 53 54 56 60 63 65 66 68 69 73 74 77 78 80 83 84 86 89 90 92 93 95 104 109 110 113 114 115 116 117 119 121 124 131 132 133 135 138 140 141 143 145 146 150 157 160 166 167 172 175 177 178 179 180 181 190 191 192 193 196 ...

output:

2 6 8 12 13 16 17 18 21 30 32 33 35 40 48 51 52 55 58 59 61 62 64 67 70 71 72 75 76 79 81 82 85 87 88 91 94 102 103 105 106 107 108 111 112 118 120 123 127 128 129 130 134 136 137 139 142 144 149 156 159 163 164 165 168 169 170 171 173 174 176 182 183 184 185 186 187 188 189 194 195 197 200 202 206 ...

input:

2
1
1000000000 300000
2 6 8 12 13 16 17 18 21 30 32 33 35 40 48 51 52 55 58 59 61 62 64 67 70 71 72 75 76 79 81 82 85 87 88 91 94 102 103 105 106 107 108 111 112 118 120 123 127 128 129 130 134 136 137 139 142 144 149 156 159 163 164 165 168 169 170 171 173 174 176 182 183 184 185 186 187 188 189 19...

output:

1 3 4 5 7 9 10 11 14 15 19 20 22 23 24 25 31 34 36 37 41 49 53 54 56 60 63 65 66 68 69 73 74 77 78 80 83 84 86 89 90 92 93 95 104 109 110 113 114 115 116 117 119 121 124 131 132 133 135 138 140 141 143 145 146 150 157 160 166 167 172 175 177 178 179 180 181 190 191 192 193 196 198 199 201 203 204 20...

result:

ok correct! (1 test case)

Test #111:

score: 7
Accepted
time: 41ms
memory: 6576kb

input:

1
1
1000000000 300000
2 6 15 18 20 24 29 33 34 35 36 40 42 47 50 51 55 59 60 61 62 68 76 78 79 80 88 94 99 100 107 114 115 121 128 129 131 133 137 138 146 149 155 157 162 165 167 168 170 173 175 176 180 182 185 188 191 193 203 207 208 214 215 221 229 237 238 239 243 245 248 251 256 260 265 266 275 2...

output:

1 5 14 17 19 23 27 28 30 31 32 39 41 46 48 49 53 54 56 57 58 67 73 74 75 77 87 93 97 98 106 112 113 120 126 127 130 132 135 136 145 148 154 156 161 163 164 166 169 171 172 174 179 181 184 187 190 192 202 205 206 212 213 220 228 234 235 236 242 244 247 250 255 259 263 264 270 271 272 273 274 276 279 ...

input:

2
1
1000000000 300000
1 5 14 17 19 23 27 28 30 31 32 39 41 46 48 49 53 54 56 57 58 67 73 74 75 77 87 93 97 98 106 112 113 120 126 127 130 132 135 136 145 148 154 156 161 163 164 166 169 171 172 174 179 181 184 187 190 192 202 205 206 212 213 220 228 234 235 236 242 244 247 250 255 259 263 264 270 27...

output:

2 6 15 18 20 24 29 33 34 35 36 40 42 47 50 51 55 59 60 61 62 68 76 78 79 80 88 94 99 100 107 114 115 121 128 129 131 133 137 138 146 149 155 157 162 165 167 168 170 173 175 176 180 182 185 188 191 193 203 207 208 214 215 221 229 237 238 239 243 245 248 251 256 260 265 266 275 277 278 280 284 287 288...

result:

ok correct! (1 test case)

Test #112:

score: 7
Accepted
time: 43ms
memory: 6776kb

input:

1
1
1000000000 300000
998000004 998000021 998000022 998000037 998000046 998000050 998000053 998000058 998000084 998000085 998000086 998000091 998000098 998000102 998000103 998000107 998000113 998000115 998000120 998000123 998000134 998000141 998000145 998000146 998000154 998000162 998000166 99800016...

output:

998000003 998000019 998000020 998000036 998000045 998000049 998000052 998000057 998000081 998000082 998000083 998000090 998000097 998000100 998000101 998000106 998000112 998000114 998000119 998000122 998000133 998000140 998000143 998000144 998000153 998000161 998000165 998000168 998000183 998000192 ...

input:

2
1
1000000000 300000
998000003 998000019 998000020 998000036 998000045 998000049 998000052 998000057 998000081 998000082 998000083 998000090 998000097 998000100 998000101 998000106 998000112 998000114 998000119 998000122 998000133 998000140 998000143 998000144 998000153 998000161 998000165 99800016...

output:

998000004 998000021 998000022 998000037 998000046 998000050 998000053 998000058 998000084 998000085 998000086 998000091 998000098 998000102 998000103 998000107 998000113 998000115 998000120 998000123 998000134 998000141 998000145 998000146 998000154 998000162 998000166 998000169 998000184 998000193 ...

result:

ok correct! (1 test case)

Test #113:

score: 7
Accepted
time: 42ms
memory: 6716kb

input:

1
1
1000000000 300000
806819891 806819892 806819893 806819894 806819895 806819896 806819897 806819898 806819899 806819900 806819901 806819902 806819903 806819904 806819905 806819906 806819907 806819908 806819909 806819910 806819911 806819912 806819913 806819914 806819915 806819916 806819917 80681991...

output:

806519891 806519892 806519893 806519894 806519895 806519896 806519897 806519898 806519899 806519900 806519901 806519902 806519903 806519904 806519905 806519906 806519907 806519908 806519909 806519910 806519911 806519912 806519913 806519914 806519915 806519916 806519917 806519918 806519919 806519920 ...

input:

2
1
1000000000 300000
806519891 806519892 806519893 806519894 806519895 806519896 806519897 806519898 806519899 806519900 806519901 806519902 806519903 806519904 806519905 806519906 806519907 806519908 806519909 806519910 806519911 806519912 806519913 806519914 806519915 806519916 806519917 80651991...

output:

806819891 806819892 806819893 806819894 806819895 806819896 806819897 806819898 806819899 806819900 806819901 806819902 806819903 806819904 806819905 806819906 806819907 806819908 806819909 806819910 806819911 806819912 806819913 806819914 806819915 806819916 806819917 806819918 806819919 806819920 ...

result:

ok correct! (1 test case)

Test #114:

score: 7
Accepted
time: 32ms
memory: 3960kb

input:

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

output:

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

input:

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

output:

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

result:

ok correct! (30000 test cases)

Test #115:

score: 7
Accepted
time: 37ms
memory: 3932kb

input:

1
30000
281971123 7
33631922 75311185 158598709 197494595 198632634 245261877 271751303
627038929 9
249717199 275320717 292755279 351724583 407946662 415852217 464636955 542224500 572959653
766933745 4
65054845 390488464 421976924 599003581
133997827 9
514674 40836413 47691426 72196590 75845486 8115...

output:

33631921 75311184 158598708 197494594 198632633 245261876 271751302
249717198 275320716 292755278 351724582 407946661 415852216 464636954 542224499 572959652
65054844 390488463 421976923 599003580
514673 40836412 47691425 72196589 75845485 81157377 94628658 96533427 116338495
46547810 54061166 72859...

input:

2
30000
859015756 5
184121719 278480193 407188536 627173560 765041615
486633594 3
144299427 286208895 308654457
709146856 4
71996774 260748174 287966615 547744019
541054797 1
43515813
571855680 5
6667155 188577000 212306471 266706752 508345535
602486406 10
33090369 182685096 247159602 391325129 4575...

output:

184121720 278480194 407188537 627173561 765041616
144299428 286208896 308654458
71996775 260748175 287966616 547744020
43515814
6667156 188577001 212306472 266706753 508345536
33090370 182685097 247159603 391325130 457510369 510501602 513365458 540603468 553515369 563780276
34703706 73556197 7425228...

result:

ok correct! (30000 test cases)

Test #116:

score: 7
Accepted
time: 30ms
memory: 3956kb

input:

1
3000
113 51
1 5 9 10 17 18 23 24 25 27 28 30 32 33 34 36 38 39 42 43 45 48 49 51 56 58 60 62 63 65 71 81 82 83 84 85 87 89 91 93 97 99 100 102 103 104 106 108 109 110 111
188 85
3 4 5 7 9 11 13 14 17 20 21 23 26 28 29 32 34 36 37 39 46 48 49 53 57 60 62 63 65 66 72 76 79 80 82 83 87 89 92 96 97 98...

output:

4 7 8 12 13 14 15 16 19 20 21 22 26 29 31 35 37 40 41 44 46 47 50 54 55 57 59 61 64 70 72 73 74 75 76 77 78 79 80 86 88 90 92 94 95 96 98 101 105 107 113
1 2 6 8 10 12 16 18 19 22 24 25 27 30 31 33 35 38 44 45 47 51 52 54 55 56 58 59 61 64 67 68 69 70 71 73 74 75 77 78 81 84 85 86 88 90 91 93 94 95 ...

input:

2
3000
219 75
4 9 13 15 16 22 25 26 27 31 34 35 44 46 47 55 57 62 66 73 76 77 81 82 87 90 92 93 97 103 106 109 113 118 122 124 127 128 130 131 135 137 138 140 141 142 155 156 159 161 164 165 168 172 173 175 176 177 183 185 186 188 189 191 195 196 198 199 200 207 210 212 214 215 217
129 59
1 4 8 9 16...

output:

5 10 14 17 18 23 28 29 30 32 36 37 45 48 49 56 58 63 67 74 78 79 83 84 88 91 94 95 98 104 107 110 114 119 123 125 129 132 133 134 136 139 143 144 145 146 157 158 160 162 166 167 169 174 178 179 180 181 184 187 190 192 193 194 197 201 202 203 204 208 211 213 216 218 219
2 3 5 6 7 10 11 12 18 23 25 26...

result:

ok correct! (3000 test cases)

Test #117:

score: 7
Accepted
time: 30ms
memory: 4188kb

input:

1
3000
678745064 74
4516447 5019813 19652760 47391032 54268539 55823139 72762643 77852009 102945112 105432222 107251951 117777415 127065944 156399883 157781923 166870884 178523517 183163207 183783008 185196952 204200963 204738698 220412637 231536161 238702583 240261966 251177887 255911428 259555167 ...

output:

4516446 5019812 19652759 47391031 54268538 55823138 72762642 77852008 102945111 105432221 107251950 117777414 127065943 156399882 157781922 166870883 178523516 183163206 183783007 185196951 204200962 204738697 220412636 231536160 238702582 240261965 251177886 255911427 259555166 262004733 270193507 ...

input:

2
3000
649052093 68
22810360 43137439 59101675 67985383 76585703 116719898 121903003 129698192 139693388 146223175 158540359 159035207 160966765 166331873 177656306 189594559 192292795 200533543 206445400 208773823 220687366 224271362 230243997 239944357 253123679 274578592 302686239 320894100 32180...

output:

22810361 43137440 59101676 67985384 76585704 116719899 121903004 129698193 139693389 146223176 158540360 159035208 160966766 166331874 177656307 189594560 192292796 200533544 206445401 208773824 220687367 224271363 230243998 239944358 253123680 274578593 302686240 320894101 321806256 323656346 32664...

result:

ok correct! (3000 test cases)

Test #118:

score: 7
Accepted
time: 36ms
memory: 3912kb

input:

1
300
1691 704
5 13 15 16 18 19 21 22 25 28 30 31 32 33 35 39 42 45 48 50 51 57 62 64 66 71 72 73 75 77 79 80 81 83 84 88 89 90 91 92 95 99 101 106 107 108 109 112 114 115 122 124 129 130 131 133 134 137 144 148 150 153 154 161 162 163 164 165 168 169 170 180 183 188 189 196 197 201 207 208 211 212 ...

output:

4 8 9 10 11 12 14 17 20 23 24 26 27 29 34 38 41 44 46 47 49 55 56 58 59 60 61 63 65 67 68 69 70 74 76 78 82 85 86 87 94 98 100 102 103 104 105 110 111 113 121 123 125 126 127 128 132 136 143 147 149 151 152 155 156 157 158 159 160 166 167 179 182 186 187 191 192 193 194 195 198 199 200 202 203 204 2...

input:

2
300
2399 699
2 5 11 17 24 31 32 33 34 37 39 43 45 47 50 61 68 69 70 73 74 75 80 81 83 87 89 90 91 94 99 103 107 109 110 112 113 115 117 118 125 130 134 137 139 142 149 150 152 156 163 166 167 169 175 178 182 187 191 195 196 198 199 200 202 206 208 213 218 227 231 235 243 244 245 250 252 253 255 26...

output:

1 3 6 12 18 25 35 36 38 40 41 42 44 46 48 51 62 71 72 76 77 78 79 82 84 85 88 92 93 95 96 100 104 108 111 114 116 119 120 121 122 126 131 135 138 140 143 151 153 154 157 164 168 170 171 176 179 183 188 192 197 201 203 204 205 207 209 210 214 219 228 232 236 246 247 248 251 254 256 257 264 267 270 27...

result:

ok correct! (300 test cases)

Test #119:

score: 7
Accepted
time: 26ms
memory: 4184kb

input:

1
300
25785067 968
3801 4877 83649 104134 126201 133023 161629 163808 213014 317315 361955 386025 443492 465612 466110 473851 489173 517110 571269 577477 592378 626055 673931 682603 717290 732202 751033 751732 761804 784755 891508 948996 956816 1066874 1110192 1170447 1180929 1187441 1210077 1232495...

output:

3800 4876 83648 104133 126200 133022 161628 163807 213013 317314 361954 386024 443491 465611 466109 473850 489172 517109 571268 577476 592377 626054 673930 682602 717289 732201 751032 751731 761803 784754 891507 948995 956815 1066873 1110191 1170446 1180928 1187440 1210076 1232494 1238453 1276271 13...

input:

2
300
810606317 576
20930 142883 491293 2141199 2143446 3063316 3801022 3811955 4373589 5542782 5588461 7562299 7904361 8464181 10580284 10852311 11543679 15395332 16177129 17103491 18468994 18836969 19063480 19260472 19339177 19744139 20768085 23337109 23890704 25630054 26411408 26559959 28717190 2...

output:

20931 142884 491294 2141200 2143447 3063317 3801023 3811956 4373590 5542783 5588462 7562300 7904362 8464182 10580285 10852312 11543680 15395333 16177130 17103492 18468995 18836970 19063481 19260473 19339178 19744140 20768086 23337110 23890705 25630055 26411409 26559960 28717191 28784281 29187241 295...

result:

ok correct! (300 test cases)

Extra Test:

score: 0
Extra Test Passed