QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#210583#5242. Płótno [B]Lynkcat10 ✓701ms135252kbC++146.4kb2023-10-11 17:04:452023-10-11 17:04:45

Judging History

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

  • [2023-10-11 17:04:45]
  • 评测
  • 测评结果:10
  • 用时:701ms
  • 内存:135252kb
  • [2023-10-11 17:04:45]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long 
#define pa pair<int,int> 
#define fi first 
#define se second 
#define mp make_pair
#define poly vector<int> 
using namespace std;
const int N=200005,B=15;
int inf;
struct node
{
    int val[B],cnt[B];
    node()
    {
        memset(val,0x3f,sizeof(val));
        memset(cnt,0,sizeof(cnt));
    }
}tr[N<<2];
int tag[N<<2];
node merge(node x,node y)
{
    node res;
    int l=0,r=0;
    for (int i=0;i<B;i++)
    {
        if (l<B&&r<B&&x.val[l]==y.val[r])
        {
            res.val[i]=x.val[l];
            res.cnt[i]=x.cnt[l]+y.cnt[r];
            l++,r++;
            continue;
        }
        if (r==B||l<B&&x.val[l]<y.val[r])
        {
            res.val[i]=x.val[l];
            res.cnt[i]=x.cnt[l];
            l++;
            continue;
        }
        res.val[i]=y.val[r];
        res.cnt[i]=y.cnt[r];
        r++;
    }
    return res;
}
void build(int k,int l,int r)
{
    tag[k]=0;
    if (l==r)
    {
        tr[k].val[0]=0;
        tr[k].cnt[0]=1;
        return;
    }
    int mid=l+(r-l)/2;
    build(k<<1,l,mid);
    build(k<<1|1,mid+1,r);
    tr[k]=merge(tr[k<<1],tr[k<<1|1]);
}
void ptag(int k,int x)
{
    for (int i=0;i<B;i++)
        if (tr[k].val[i]!=inf) tr[k].val[i]+=x;
    tag[k]+=x;
}
void update(int k,int l,int r,int L,int R,int x)
{
    if (L<=l&&r<=R)
    {
        ptag(k,x);
        return;
    }
    if (tag[k])
    {
        ptag(k<<1,tag[k]);
        ptag(k<<1|1,tag[k]);
        tag[k]=0;
    }
    int mid=l+(r-l)/2;
    if (L<=mid) update(k<<1,l,mid,L,R,x);
    if (R>mid) update(k<<1|1,mid+1,r,L,R,x);
    tr[k]=merge(tr[k<<1],tr[k<<1|1]);
}
node query(int k,int l,int r,int L,int R)
{
    if (L<=l&&r<=R) return tr[k];
    if (tag[k])
    {
        ptag(k<<1,tag[k]);
        ptag(k<<1|1,tag[k]);
        tag[k]=0;
    }
    int mid=l+(r-l)/2;
    if (R<=mid) return query(k<<1,l,mid,L,R); 
    if (L>mid) return query(k<<1|1,mid+1,r,L,R);
    return merge(query(k<<1,l,mid,L,R),query(k<<1|1,mid+1,r,L,R));
}
int n,m;
int a[N],b[N],fa[N];
poly G[N],E[N];
ll ans[N];
namespace LCT{
    const int N=500005;
	int tr[N];
	int tot;
	inline void upd(int x,int y){while (x<=m){tr[x]+=y;x+=x&-x;}}
	inline int qry(int x){int res=0;while(x){res+=tr[x];x-=x&-x;}return res;}
	bool rev[N];
	int fa[N],ch[N][2];
	int val[N],mx[N];
	int ecnt;
	#define ls(x) (ch[x][0])
	#define rs(x) (ch[x][1])
	#define dir(x) (x == ch[fa[x]][1])
	#define IsRoot(x) (x != ch[fa[x]][0] && x != ch[fa[x]][1])

	inline void PushUp(int x) {
		mx[x] = x;
		if(ls(x) && val[mx[ls(x)]] > val[mx[x]]) mx[x] = mx[ls(x)];
		if(rs(x) && val[mx[rs(x)]] > val[mx[x]]) mx[x] = mx[rs(x)];
	}

	inline void PushDown(int x) {
		if(rev[x]) {
			if(ls(x)) std::swap(ls(ls(x)),rs(ls(x))),rev[ls(x)] ^= 1;
			if(rs(x)) std::swap(ls(rs(x)),rs(rs(x))),rev[rs(x)] ^= 1;
			rev[x] = 0;
		}
	}

	void update(int x) {
		if(!IsRoot(x)) update(fa[x]);
		PushDown(x);
	}

	inline void rotate(int x) {
		int y = fa[x],z = fa[y],d = dir(x),w = ch[x][d ^ 1];
		if(!IsRoot(y)) ch[z][dir(y)] = x;
		ch[y][d] = w,ch[x][d ^ 1] = y;
		fa[y] = x,fa[x] = z;
		if(w) fa[w] = y;
		PushUp(y);
	}

	inline void splay(int x) {
		update(x);
		while(!IsRoot(x)) {
			int y = fa[x],z = fa[y];
			if(!IsRoot(y))
				rotate((ls(y) == x) ^ (ls(z) == y) ? x : y);
			rotate(x);
		}
		PushUp(x);
	}

	inline void access(int x) {
		for(int p = 0;x;p = x,x = fa[x])
			splay(x),rs(x) = p,PushUp(x);
	}

	inline void MakeRoot(int x) {
		// cout<<"makeroot "<<x<<endl;
		access(x),splay(x);
		// cout<<"makeroot "<<x<<endl;
		std::swap(ls(x),rs(x)),rev[x] ^= 1;
	}

	inline int FindRoot(int x) {
		access(x),splay(x);
		while(ls(x)) PushDown(x),x = ls(x);
		splay(x);
		return x;
	}

	inline void split(int x,int y) {
		MakeRoot(x),access(y),splay(y);
	}

	inline void link(int x,int y) {
		// assert(x<N&&y<N);
		MakeRoot(x); fa[x] = y;
	}
	inline int addedge(int u,int v,int w)
	{
		val[++tot] = w;
        // cout<<"Add "<<u<<" "<<v<<" "<<w<<" "<<tot<<endl;
		MakeRoot(u);
		if(u != FindRoot(v)) {
			link(tot,u),link(tot,v);
			ecnt++;
		}
		else {
			split(u,v);
			int ep = mx[v];
			if(w < val[ep]) {
                int now=val[ep];
                // cout<<"wtf "<<now<<" "<<ep<<endl;
				splay(ep);
				fa[ch[ep][0]] = fa[ch[ep][1]] = 0;
				link(tot,u);
				link(tot,v);
                return now;
			}
            return -1;
		}
        return -2;
	}
	inline int qzadd(int u,int v,int w)
	{
		if (qry(w)-qry(w-1)) return -1;
		val[++tot] = w;
		MakeRoot(u);
		split(u,v);
		int ep = mx[v];
		{
			splay(ep);
			fa[ch[ep][0]] = fa[ch[ep][1]] = 0;
			link(tot,u);
			link(tot,v);
			upd(val[ep],-1);
			upd(w,1);
		}
		return val[ep];
	}
	inline void clr()
	{
		for (int i=1;i<=m;i++) tr[i]=0;
		for (int i=1;i<=tot;i++) rev[i]=0,fa[i]=0,
		val[i]=mx[i]=0,ch[i][0]=ch[i][1]=0;
		ecnt=0;
		tot=0;
	}			
}
void Bellakira()
{
    inf=tr[0].val[0];
    cin>>n>>m;
    for (int i=0;i<n;i++)
        cin>>a[i];
    for (int i=0;i<n;i++)
        G[max(a[i],a[(i+n-1)%n])].push_back(min(a[i],a[(i+n-1)%n]));
    for (int i=0;i<n;i++)
        cin>>b[i];
    for (int i=0;i<n;i++)
        G[max(b[i],b[(i+n-1)%n])].push_back(min(b[i],b[(i+n-1)%n]));
    for (int i=0;i<n;i++)
        E[max(b[i],a[i])].push_back(min(b[i],a[i]));
    n*=2;
	LCT::tot=n;
    build(1,1,n);
    for (int i=1;i<=n;i++)
    {
        update(1,1,n,1,i,1);
        for (auto u:G[i])
        {
            int o=LCT::addedge(u,i,n-u+1);
            if (o==-1) continue;
            update(1,1,n,1,u,-1);
            if (o!=-2)
                update(1,1,n,1,n-o+1,1);
        }
        for (auto u:E[i])
        {
            int o=LCT::addedge(u,i,n-u+1);
            if (o==-1) continue;
            update(1,1,n,1,u,-1);
            if (o!=-2)
                update(1,1,n,1,n-o+1,1);
        }
        node now=query(1,1,n,1,i);
        // for (int j=0;j<B;j++)
        //     if (now.cnt[j])
        //         cout<<now.val[j]<<" "<<now.cnt[j]<<endl;
        for (int j=0;j<B;j++)
            if (now.cnt[j]&&now.val[j]<=m) 
            {
                ans[now.val[j]]+=now.cnt[j];
            }
    }
    for (int i=1;i<=m;i++) cout<<ans[i]<<' ';
}
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T=1;
    while (T--)
    {
        Bellakira();
    }
}
/*
n=50
*/

详细

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 8ms
memory: 107028kb

input:

10 1
6 18 4 17 1 8 7 13 5 10
2 20 3 11 15 12 19 16 14 9

output:

58 

result:

ok single line: '58 '

Test #2:

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

input:

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

output:

136 

result:

ok single line: '136 '

Test #3:

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

input:

100 1
195 19 174 197 7 116 192 87 159 3 90 93 148 47 125 151 30 181 84 5 166 161 122 127 45 4 144 98 26 171 153 86 138 51 124 194 101 52 49 11 58 172 139 176 160 14 33 28 63 146 20 114 102 44 89 25 179 40 60 55 8 48 82 141 175 1 165 61 190 134 105 66 157 97 12 117 32 78 164 76 131 180 35 65 94 96 22...

output:

386 

result:

ok single line: '386 '

Test #4:

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

input:

100 1
183 186 188 190 192 194 195 198 199 1 4 5 7 9 11 13 16 18 19 21 24 25 28 30 31 34 36 38 39 42 43 46 48 50 51 54 55 57 60 61 63 66 67 70 72 74 76 77 80 81 83 86 87 90 92 94 95 98 99 101 103 105 107 109 111 113 116 117 119 121 123 125 127 129 131 133 135 137 140 141 143 146 148 150 151 154 155 1...

output:

20047 

result:

ok single line: '20047 '

Test #5:

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

input:

100 1
85 89 90 96 95 98 97 101 104 105 107 112 111 114 113 118 117 122 124 127 125 132 130 136 134 139 138 142 141 147 146 151 152 154 156 160 159 162 164 168 166 169 172 174 176 179 178 184 181 185 187 190 189 194 193 199 200 1 4 7 8 12 10 14 16 20 17 21 23 26 28 31 32 36 34 40 38 44 43 45 47 52 51...

output:

10706 

result:

ok single line: '10706 '

Test #6:

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

input:

100 1
82 87 86 83 85 100 94 91 93 98 103 107 104 106 105 118 115 116 112 113 126 122 127 128 129 136 135 137 133 139 142 141 149 148 147 160 156 158 151 153 162 163 165 166 164 171 178 173 180 172 183 188 181 184 186 200 198 195 197 194 6 2 1 4 5 14 16 17 13 12 27 26 25 29 28 32 34 38 31 36 42 49 45...

output:

3654 

result:

ok single line: '3654 '

Test #7:

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

input:

100 1
188 194 189 195 193 187 196 191 190 183 16 13 15 5 17 11 20 6 14 4 23 40 36 22 30 24 34 25 32 29 55 41 53 46 43 45 57 59 54 52 72 62 79 71 68 80 65 67 74 77 88 83 89 98 82 84 100 96 91 99 107 106 109 102 115 101 105 117 113 110 137 121 128 133 125 129 123 136 122 132 144 143 145 149 156 157 15...

output:

1098 

result:

ok single line: '1098 '

Test #8:

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

input:

100 1
53 55 70 62 64 66 68 78 80 72 74 76 81 83 85 87 89 99 91 93 95 97 103 105 107 109 101 119 111 113 115 117 121 123 125 127 129 136 138 140 132 134 144 146 148 150 142 156 158 160 152 154 161 163 165 167 169 173 175 177 179 171 190 182 184 186 188 194 196 198 200 192 6 8 10 2 4 20 12 14 16 18 23...

output:

2899 

result:

ok single line: '2899 '

Test #9:

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

input:

100 1
105 107 109 111 113 115 117 119 125 127 129 131 133 135 137 139 121 123 157 159 141 143 145 147 149 151 153 155 178 180 162 164 166 168 170 172 174 176 182 184 186 188 190 192 194 196 198 200 18 20 2 4 6 8 10 12 14 16 26 28 30 32 34 36 38 40 22 24 51 53 55 57 59 41 43 45 47 49 66 68 70 72 74 7...

output:

1351 

result:

ok single line: '1351 '

Test #10:

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

input:

100 1
43 49 46 48 60 67 70 89 72 73 74 78 81 79 83 88 87 62 65 63 18 17 103 102 99 100 94 95 91 114 105 112 107 108 118 115 181 182 178 175 174 183 184 164 166 172 169 167 155 157 160 161 190 187 192 141 145 146 147 149 152 154 140 139 194 196 197 200 120 135 136 129 131 121 127 124 126 9 4 3 8 1 12...

output:

1078 

result:

ok single line: '1078 '

Test #11:

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

input:

100 1
199 99 98 74 71 69 70 66 63 86 80 78 75 81 83 35 59 61 62 56 49 51 50 42 44 38 40 47 45 31 17 30 23 24 26 21 20 34 96 93 91 90 87 15 10 8 5 3 2 11 14 119 115 118 138 134 133 131 129 123 124 127 121 149 144 140 143 148 145 106 105 109 114 113 101 104 169 166 163 168 153 155 152 162 157 159 172 ...

output:

1042 

result:

ok single line: '1042 '

Test #12:

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

input:

100 1
88 90 89 91 97 99 100 103 104 108 106 110 62 64 61 69 71 67 74 112 116 115 149 148 152 151 134 138 136 140 137 143 142 125 123 128 119 117 121 129 16 13 11 10 7 6 3 2 18 43 42 29 32 39 33 35 40 25 26 28 22 20 46 47 51 50 57 55 54 58 184 183 188 172 167 169 176 173 175 180 174 161 157 153 160 1...

output:

1080 

result:

ok single line: '1080 '

Test #13:

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

input:

99 1
58 140 60 138 62 136 64 134 66 132 68 130 70 128 72 126 74 124 76 122 78 120 80 118 82 116 84 114 86 112 88 110 90 108 92 106 94 104 96 102 98 100 198 2 196 4 194 6 192 8 190 10 188 12 186 14 184 16 182 18 180 20 178 22 176 24 174 26 172 28 170 30 168 32 166 34 164 36 162 38 160 40 158 42 156 4...

output:

495 

result:

ok single line: '495 '

Test #14:

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

input:

100 1
55 145 57 143 59 141 61 139 63 137 65 135 67 133 69 131 71 129 73 127 75 125 77 123 79 121 81 119 83 117 85 115 87 113 89 111 91 109 93 107 95 105 97 103 99 101 1 199 3 197 5 195 7 193 9 191 11 189 13 187 15 185 17 183 19 181 21 179 23 177 25 175 27 173 29 171 31 169 33 167 35 165 37 163 39 16...

output:

500 

result:

ok single line: '500 '

Test #15:

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

input:

100 1
87 90 91 94 95 98 99 102 103 106 107 110 111 114 115 118 119 122 123 126 127 130 131 134 135 138 139 142 143 146 147 150 151 154 155 158 159 162 163 166 167 170 171 174 175 178 179 182 183 186 187 190 191 194 195 198 199 2 3 6 7 10 11 14 15 18 19 22 23 26 27 30 31 34 35 38 39 42 43 46 47 50 51...

output:

20100 

result:

ok single line: '20100 '

Subtask #2:

score: 1
Accepted

Test #16:

score: 1
Accepted
time: 8ms
memory: 108712kb

input:

2 4
1 2
4 3

output:

10 0 0 0 

result:

ok single line: '10 0 0 0 '

Test #17:

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

input:

2 4
1 4
2 3

output:

10 0 0 0 

result:

ok single line: '10 0 0 0 '

Test #18:

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

input:

2 4
1 4
3 2

output:

8 2 0 0 

result:

ok single line: '8 2 0 0 '

Test #19:

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

input:

10 10
12 17 9 11 8 6 13 15 20 16
14 19 4 18 2 5 7 1 3 10

output:

54 70 70 14 2 0 0 0 0 0 

result:

ok single line: '54 70 70 14 2 0 0 0 0 0 '

Test #20:

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

input:

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

output:

124 134 147 166 169 173 179 205 220 225 

result:

ok single line: '124 134 147 166 169 173 179 205 220 225 '

Test #21:

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

input:

100 10
44 99 183 115 55 138 68 181 39 46 152 54 198 120 17 165 83 25 143 133 33 179 100 94 95 197 117 125 6 160 154 147 88 64 75 196 114 1 112 104 61 58 98 31 67 4 9 52 129 89 128 192 12 18 141 5 80 60 8 16 105 118 63 177 157 149 158 132 29 153 178 71 180 97 127 139 59 146 15 30 171 32 13 184 168 24...

output:

365 288 282 284 310 335 319 365 363 350 

result:

ok single line: '365 288 282 284 310 335 319 365 363 350 '

Test #22:

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

input:

100 10
28 30 31 33 35 38 39 42 43 46 47 49 52 54 56 57 59 61 63 66 68 69 72 74 75 78 79 82 84 86 87 89 91 94 96 97 100 101 104 106 107 110 112 114 116 117 120 121 124 125 128 130 132 134 135 137 140 142 144 146 147 149 151 153 155 157 160 161 163 166 168 170 172 173 175 178 180 181 183 186 187 190 1...

output:

20051 49 0 0 0 0 0 0 0 0 

result:

ok single line: '20051 49 0 0 0 0 0 0 0 0 '

Test #23:

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

input:

100 10
21 28 26 32 29 33 35 37 39 43 42 45 46 49 52 53 56 58 57 64 62 65 67 69 72 74 75 79 80 82 81 87 88 92 89 96 94 100 99 103 102 108 106 109 110 116 114 119 117 121 122 127 125 130 131 135 133 140 138 143 141 148 147 151 150 154 155 160 158 161 162 166 165 171 172 176 173 178 177 182 184 187 186...

output:

11932 7149 1019 0 0 0 0 0 0 0 

result:

ok single line: '11932 7149 1019 0 0 0 0 0 0 0 '

Test #24:

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

input:

100 10
46 41 43 49 55 52 56 53 59 67 65 70 66 64 75 77 79 76 72 84 83 82 87 81 92 91 97 93 94 101 107 109 108 110 113 115 111 114 116 130 122 121 125 127 136 133 137 134 131 147 150 141 142 145 155 158 152 160 156 167 164 165 170 166 174 171 176 178 173 185 186 183 190 182 200 195 191 194 197 5 3 8 ...

output:

3138 6031 6099 3528 1144 152 8 0 0 0 

result:

ok single line: '3138 6031 6099 3528 1144 152 8 0 0 0 '

Test #25:

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

input:

100 10
65 61 67 66 74 72 73 77 79 76 96 87 95 83 90 86 88 100 84 93 108 107 115 117 110 120 106 101 112 119 133 124 121 131 128 123 134 140 136 130 149 144 156 142 160 146 154 157 147 148 161 175 169 167 171 163 166 168 176 164 189 195 181 184 185 187 197 199 191 183 18 6 1 4 15 7 17 16 19 20 33 30 ...

output:

1241 2654 3675 4026 3529 2557 1470 666 229 50 

result:

ok single line: '1241 2654 3675 4026 3529 2557 1470 666 229 50 '

Test #26:

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

input:

100 10
8 10 2 4 6 20 12 14 16 18 28 30 22 24 26 33 35 37 39 31 48 50 42 44 46 51 53 55 57 59 67 69 61 63 65 75 77 79 71 73 82 84 86 88 90 97 99 91 93 95 105 107 109 101 103 115 117 119 111 113 121 123 125 127 129 137 139 131 133 135 150 142 144 146 148 151 153 155 157 159 162 164 166 168 170 171 173...

output:

2933 7258 6758 2770 366 15 0 0 0 0 

result:

ok single line: '2933 7258 6758 2770 366 15 0 0 0 0 '

Test #27:

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

input:

100 10
43 49 53 41 55 57 59 45 47 51 79 67 73 75 63 77 61 71 69 65 82 92 90 88 86 84 100 98 94 96 114 120 104 106 110 102 118 108 116 112 127 139 123 125 131 121 137 129 133 135 155 157 141 151 145 147 159 153 143 149 178 162 174 166 172 168 170 164 180 176 187 191 189 193 195 181 183 199 185 197 11...

output:

1077 3122 4969 5163 3741 1623 362 42 1 0 

result:

ok single line: '1077 3122 4969 5163 3741 1623 362 42 1 0 '

Test #28:

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

input:

100 10
182 178 180 176 157 164 162 168 167 169 171 159 53 54 57 61 59 50 52 47 45 32 30 36 43 42 41 37 33 21 22 15 17 13 24 26 28 7 2 4 6 10 11 197 196 193 192 189 187 200 185 137 135 133 134 121 124 123 128 127 144 142 140 146 154 152 156 148 150 118 117 115 110 109 114 94 93 97 100 88 89 92 108 10...

output:

1161 3919 6857 5815 2118 230 0 0 0 0 

result:

ok single line: '1161 3919 6857 5815 2118 230 0 0 0 0 '

Test #29:

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

input:

100 10
84 86 71 64 66 67 69 61 57 60 51 56 52 31 33 49 47 45 42 43 39 37 35 89 94 92 187 189 191 192 197 198 195 179 182 181 183 178 175 174 173 151 150 152 137 145 144 142 141 127 130 131 133 135 120 123 124 126 158 161 163 159 166 167 165 153 154 117 20 21 23 11 14 18 16 3 4 10 7 6 29 27 28 112 11...

output:

1174 3176 4987 5240 3597 1547 349 30 0 0 

result:

ok single line: '1174 3176 4987 5240 3597 1547 349 30 0 0 '

Test #30:

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

input:

100 10
192 182 185 186 187 190 177 180 170 172 176 174 164 168 166 157 160 162 141 143 145 147 154 152 153 155 107 109 114 115 112 120 126 122 117 121 130 131 127 134 138 139 137 104 106 102 99 98 92 91 96 90 89 85 82 80 84 78 8 10 3 1 5 25 29 30 23 47 51 54 50 31 34 35 38 39 37 46 43 60 58 62 57 71...

output:

1544 4630 6475 4841 2030 500 76 4 0 0 

result:

ok single line: '1544 4630 6475 4841 2030 500 76 4 0 0 '

Test #31:

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

input:

99 10
99 1 197 3 195 5 193 7 191 9 189 11 187 13 185 15 183 17 181 19 179 21 177 23 175 25 173 27 171 29 169 31 167 33 165 35 163 37 161 39 159 41 157 43 155 45 153 47 151 49 149 51 147 53 145 55 143 57 141 59 139 61 137 63 135 65 133 67 131 69 129 71 127 73 125 75 123 77 121 79 119 81 117 83 115 85...

output:

495 390 386 382 378 374 370 366 362 358 

result:

ok single line: '495 390 386 382 378 374 370 366 362 358 '

Test #32:

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

input:

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

output:

500 394 390 386 382 378 374 370 366 362 

result:

ok single line: '500 394 390 386 382 378 374 370 366 362 '

Test #33:

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

input:

100 10
144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 173 176 177 180 181 184 185 188 189 192 193 196 197 200 1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116...

output:

20100 0 0 0 0 0 0 0 0 0 

result:

ok single line: '20100 0 0 0 0 0 0 0 0 0 '

Subtask #3:

score: 1
Accepted

Test #34:

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

input:

500 10
917 838 302 172 930 427 28 597 459 846 477 474 4 764 33 821 250 204 653 309 142 916 795 928 387 956 810 433 973 609 226 556 547 540 860 847 535 147 768 619 448 52 551 131 294 892 423 241 363 117 566 285 702 230 6 624 358 802 672 641 384 639 911 251 823 750 587 865 751 890 604 317 473 606 998 ...

output:

1781 1446 1564 1298 1500 1585 1516 1761 1659 1513 

result:

ok single line: '1781 1446 1564 1298 1500 1585 1516 1761 1659 1513 '

Test #35:

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

input:

800 10
501 301 1042 332 774 1438 229 750 870 1491 761 609 859 1069 624 1199 1566 1600 48 1356 1453 61 558 1469 1024 1266 947 1379 1232 202 1029 834 1468 222 83 1297 665 1574 898 214 549 1068 1162 633 427 879 1134 360 252 1047 1360 540 939 1178 1311 353 595 305 1445 599 374 890 1484 998 948 58 65 177...

output:

2569 1672 1809 1843 2103 2017 2020 2103 2346 2728 

result:

ok single line: '2569 1672 1809 1843 2103 2017 2020 2103 2346 2728 '

Test #36:

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

input:

1000 10
533 824 156 1787 314 921 594 1157 744 225 948 1568 1666 1948 1367 1922 1810 88 1915 1529 1306 1980 590 467 837 35 518 1373 863 137 1974 1841 1557 1082 336 71 1330 189 565 1162 1780 1295 1112 804 1999 1160 729 899 107 477 1718 401 1548 1412 1956 964 226 739 393 1155 540 1104 335 642 1674 1657...

output:

4097 2479 2501 2703 2532 2700 2566 2584 2614 2622 

result:

ok single line: '4097 2479 2501 2703 2532 2700 2566 2584 2614 2622 '

Test #37:

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

input:

1000 10
586 588 589 592 594 596 598 599 601 604 606 607 609 611 614 615 617 620 621 623 625 627 630 631 634 635 637 639 642 644 645 648 649 652 653 656 658 660 661 664 666 668 670 671 674 676 677 679 681 683 686 688 690 691 693 696 697 700 702 704 705 707 710 712 713 715 717 720 721 724 725 728 729 ...

output:

2000494 506 0 0 0 0 0 0 0 0 

result:

ok single line: '2000494 506 0 0 0 0 0 0 0 0 '

Test #38:

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

input:

1000 10
1523 1526 1525 1530 1529 1533 1535 1538 1539 1544 1541 1547 1546 1550 1551 1554 1553 1558 1559 1563 1561 1566 1565 1572 1569 1576 1575 1580 1577 1584 1583 1587 1588 1589 1590 1595 1596 1597 1598 1603 1601 1607 1608 1612 1611 1613 1615 1619 1617 1621 1622 1628 1626 1632 1629 1635 1636 1637 16...

output:

1181009 712660 107313 18 0 0 0 0 0 0 

result:

ok single line: '1181009 712660 107313 18 0 0 0 0 0 0 '

Test #39:

score: 0
Accepted
time: 15ms
memory: 107840kb

input:

1000 10
1252 1258 1256 1255 1261 1265 1266 1270 1263 1275 1279 1271 1280 1273 1283 1287 1284 1282 1290 1295 1291 1294 1300 1293 1304 1309 1306 1310 1301 1315 1319 1318 1316 1320 1329 1323 1325 1327 1322 1336 1338 1331 1337 1335 1350 1349 1342 1346 1341 1354 1358 1355 1353 1352 1365 1364 1366 1361 13...

output:

285812 632880 616696 333633 107599 21422 2730 220 8 0 

result:

ok single line: '285812 632880 616696 333633 107599 21422 2730 220 8 0 '

Test #40:

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

input:

1000 10
932 930 936 921 937 927 944 958 948 957 956 951 942 943 946 959 969 973 978 967 965 961 962 966 977 974 996 988 984 994 993 997 982 995 987 998 1012 1013 1007 1019 1006 1008 1018 1020 1004 1016 1032 1025 1024 1037 1027 1031 1040 1035 1036 1039 1051 1053 1058 1044 1050 1047 1060 1056 1048 104...

output:

92789 173192 268596 363760 366156 306700 222602 129693 55470 17122 

result:

ok single line: '92789 173192 268596 363760 366...6700 222602 129693 55470 17122 '

Test #41:

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

input:

992 10
4 42 12 53 56 35 40 29 22 52 48 15 61 47 59 23 10 58 3 18 8 11 41 43 7 34 54 25 119 81 95 73 124 72 74 118 112 92 116 80 83 102 90 98 121 70 69 66 110 88 106 99 115 117 100 111 97 86 108 183 168 169 139 141 134 167 146 148 145 182 172 177 166 131 170 174 171 144 142 176 159 140 125 149 147 15...

output:

28144 32800 41988 47901 52909 66176 75605 90646 108403 125518 

result:

ok single line: '28144 32800 41988 47901 52909 66176 75605 90646 108403 125518 '

Test #42:

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

input:

1000 10
789 781 783 794 796 798 800 792 803 805 807 809 801 814 816 818 820 812 823 825 827 829 821 838 840 832 834 836 843 845 847 849 841 854 856 858 860 852 862 864 866 868 870 875 877 879 871 873 881 883 885 887 889 891 893 895 897 899 905 907 909 901 903 920 912 914 916 918 929 921 923 925 927 ...

output:

238584 632984 678116 356244 87426 7475 171 0 0 0 

result:

ok single line: '238584 632984 678116 356244 87426 7475 171 0 0 0 '

Test #43:

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

input:

992 10
1090 1116 1104 1110 1078 1094 1092 1088 1114 1062 1142 1134 1176 1148 1140 1162 1130 1168 1122 1166 1124 1132 1174 1126 1150 1178 1144 1138 1118 1164 1146 1154 1160 1158 1120 1156 1128 1152 1172 1170 1136 1234 1218 1208 1194 1192 1228 1206 1232 1198 1210 1224 1216 1202 1188 1180 1214 1184 120...

output:

31767 59120 94505 137345 195677 243286 258910 247577 223028 192422 

result:

ok single line: '31767 59120 94505 137345 19567...86 258910 247577 223028 192422 '

Test #44:

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

input:

1000 10
1323 1321 1326 1325 1320 1336 1331 1333 1338 1337 1310 1312 1308 1301 1304 1306 1450 1453 1451 1470 1468 1465 1471 1456 1455 1459 1461 1464 1477 1478 1475 1474 1533 1530 1531 1527 1499 1501 1498 1495 1494 1489 1491 1487 1507 1509 1506 1505 1513 1512 1482 1483 1485 1518 1517 1526 1525 1520 15...

output:

12781 51065 138473 283918 418222 429889 328483 191658 91784 37732 

result:

ok single line: '12781 51065 138473 283918 4182...9889 328483 191658 91784 37732 '

Test #45:

score: 0
Accepted
time: 22ms
memory: 107988kb

input:

1000 10
259 247 248 252 256 253 258 84 80 82 8 6 3 15 11 10 9 20 17 54 53 57 58 48 51 47 44 46 38 37 41 35 34 27 28 25 22 21 32 61 71 70 66 68 63 73 75 78 2 1922 1916 1913 1914 1911 1919 1951 1950 1954 1962 1960 1956 1957 1963 1967 1968 1946 1945 1937 1939 1943 1940 1933 1932 1935 1930 1929 1925 192...

output:

13080 60740 185591 363223 468752 426565 283206 137098 48232 11978 

result:

ok single line: '13080 60740 185591 363223 4687...6565 283206 137098 48232 11978 '

Test #46:

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

input:

1000 10
1979 1980 1977 1973 1974 1992 1990 1989 1985 1983 1987 1988 1147 1142 1143 1150 1146 1140 1135 1136 1133 1118 1123 1116 1120 1121 1127 1128 1130 1125 1113 1112 1108 1111 1094 1090 1088 1087 1105 1101 1104 1100 1097 1098 1001 1004 1007 1003 997 999 1041 1039 1037 1042 1028 1030 1026 1032 1025...

output:

11747 52711 161689 338407 469296 444061 301509 149692 54252 14295 

result:

ok single line: '11747 52711 161689 338407 4692...4061 301509 149692 54252 14295 '

Test #47:

score: 0
Accepted
time: 17ms
memory: 108160kb

input:

1000 10
1759 1766 1762 1777 1772 1780 1773 1774 1770 1786 1787 1785 1783 1790 1751 1752 1796 1792 1794 1672 1702 1697 1705 1703 1704 1708 1699 1696 1681 1683 1677 1685 1688 1690 1689 1693 1692 1673 1676 1712 1724 1713 1720 1721 1716 1719 1740 1739 1734 1732 1733 1725 1735 1730 1748 1741 1745 1744 16...

output:

9185 33302 86937 177400 290043 363096 361904 291707 195757 110144 

result:

ok single line: '9185 33302 86937 177400 290043...96 361904 291707 195757 110144 '

Test #48:

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

input:

999 10
300 1698 302 1696 304 1694 306 1692 308 1690 310 1688 312 1686 314 1684 316 1682 318 1680 320 1678 322 1676 324 1674 326 1672 328 1670 330 1668 332 1666 334 1664 336 1662 338 1660 340 1658 342 1656 344 1654 346 1652 348 1650 350 1648 352 1646 354 1644 356 1642 358 1640 360 1638 362 1636 364 1...

output:

4995 3990 3986 3982 3978 3974 3970 3966 3962 3958 

result:

ok single line: '4995 3990 3986 3982 3978 3974 3970 3966 3962 3958 '

Test #49:

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

input:

1000 10
584 1416 586 1414 588 1412 590 1410 592 1408 594 1406 596 1404 598 1402 600 1400 602 1398 604 1396 606 1394 608 1392 610 1390 612 1388 614 1386 616 1384 618 1382 620 1380 622 1378 624 1376 626 1374 628 1372 630 1370 632 1368 634 1366 636 1364 638 1362 640 1360 642 1358 644 1356 646 1354 648 ...

output:

5000 3994 3990 3986 3982 3978 3974 3970 3966 3962 

result:

ok single line: '5000 3994 3990 3986 3982 3978 3974 3970 3966 3962 '

Test #50:

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

input:

1000 10
1316 1317 1320 1321 1324 1325 1328 1329 1332 1333 1336 1337 1340 1341 1344 1345 1348 1349 1352 1353 1356 1357 1360 1361 1364 1365 1368 1369 1372 1373 1376 1377 1380 1381 1384 1385 1388 1389 1392 1393 1396 1397 1400 1401 1404 1405 1408 1409 1412 1413 1416 1417 1420 1421 1424 1425 1428 1429 14...

output:

2001000 0 0 0 0 0 0 0 0 0 

result:

ok single line: '2001000 0 0 0 0 0 0 0 0 0 '

Subtask #4:

score: 1
Accepted

Test #51:

score: 1
Accepted
time: 701ms
memory: 127212kb

input:

100000 1
96176 27939 172191 74850 13479 117742 8634 21501 87321 149607 137789 134176 152101 180468 138683 166438 7726 31523 144362 26825 69995 74641 50479 72511 84577 185202 80203 157069 16984 58419 129101 172394 1618 195274 94592 35724 186278 93215 35874 2038 125395 20762 171892 53749 678 174925 13...

output:

335745 

result:

ok single line: '335745 '

Test #52:

score: 0
Accepted
time: 664ms
memory: 126796kb

input:

100000 2
170783 26768 69936 22997 22291 13639 44531 76698 81150 128645 154355 59243 5215 178708 157385 18780 198955 133209 18007 20002 188378 178114 46068 166367 62605 55573 17763 182141 27755 104470 20650 139323 47842 165493 41521 49348 58537 82037 3081 62236 23508 137494 49695 136932 61382 190819 ...

output:

335083 292683 

result:

ok single line: '335083 292683 '

Test #53:

score: 0
Accepted
time: 667ms
memory: 127500kb

input:

100000 3
102334 67693 173466 38627 151162 156973 151122 60695 128437 24 106826 40047 142265 38939 83187 106178 179159 164127 117033 148834 62055 50542 60158 19422 4228 36600 170093 180142 35898 102360 100696 50887 60084 136538 138020 150186 11792 195833 3119 51674 126768 184926 92452 75490 23780 110...

output:

317422 291067 277513 

result:

ok single line: '317422 291067 277513 '

Test #54:

score: 0
Accepted
time: 664ms
memory: 127540kb

input:

100000 4
31461 131164 112937 156353 150752 169116 105176 179553 52140 116979 97935 57534 18938 6413 168419 35338 75142 35809 25240 127771 74764 88034 65929 195948 83321 156461 22420 128149 6105 128333 112445 70327 189276 93533 58084 188399 69802 175247 165426 19730 106487 61450 46516 80087 58329 541...

output:

499551 318912 268161 265669 

result:

ok single line: '499551 318912 268161 265669 '

Test #55:

score: 0
Accepted
time: 656ms
memory: 127464kb

input:

100000 5
56198 3335 158234 19602 127484 23477 42355 104396 90633 80115 50944 70078 96456 56565 130189 197500 97119 101027 187136 29918 166716 169538 151951 129295 134324 38191 14313 153147 133788 96102 12643 97572 144543 56718 140358 82947 141087 82982 115987 94703 68323 113802 84599 289 198653 1913...

output:

302982 316988 275446 297474 260390 

result:

ok single line: '302982 316988 275446 297474 260390 '

Test #56:

score: 0
Accepted
time: 682ms
memory: 127336kb

input:

100000 6
107164 163226 79002 179801 172716 23741 181434 142825 37137 55199 47277 36806 12776 55347 63782 140898 139114 146335 190957 93967 8659 752 108233 53223 46114 174833 170407 11754 100952 167793 139584 113669 106144 152360 13343 47044 29190 97173 127000 54295 87083 55269 1211 139408 178205 109...

output:

304082 322673 234605 254530 268649 242750 

result:

ok single line: '304082 322673 234605 254530 268649 242750 '

Test #57:

score: 0
Accepted
time: 665ms
memory: 126880kb

input:

100000 7
127786 167732 81915 191816 46364 8676 82252 115116 180060 76291 181019 114880 57736 126309 182479 196530 146364 40749 183326 157754 10004 32423 20609 114100 142866 41894 169210 22014 180976 65111 170915 197118 18598 105378 62053 54660 37690 198746 141621 55314 31204 108125 124412 189300 378...

output:

292813 234588 250035 268844 290514 257881 271046 

result:

ok single line: '292813 234588 250035 268844 290514 257881 271046 '

Test #58:

score: 0
Accepted
time: 659ms
memory: 127540kb

input:

100000 8
146405 111337 183356 24927 27423 149489 83125 67761 178554 107594 133511 147830 124148 106971 182678 111873 167995 70838 89275 133345 127352 148526 85119 106374 99390 140952 10042 84782 129396 173453 47223 150843 167154 130798 22698 170285 127531 58613 155155 181758 98529 138679 1624 39214 ...

output:

321147 257528 244586 240031 229796 274583 233789 274923 

result:

ok single line: '321147 257528 244586 240031 229796 274583 233789 274923 '

Test #59:

score: 0
Accepted
time: 664ms
memory: 127004kb

input:

100000 9
175315 30190 125154 60695 35796 5654 13185 185725 100778 174202 126507 85714 156363 87141 68751 102604 51358 128718 128282 70422 52363 25685 75547 40966 40794 131429 117191 18610 156962 874 180857 121195 120101 59618 93075 24442 118821 90967 103202 146202 127847 175726 56732 114906 105032 1...

output:

376549 307018 287953 285075 290657 295040 297740 279939 289624 

result:

ok single line: '376549 307018 287953 285075 290657 295040 297740 279939 289624 '

Test #60:

score: 0
Accepted
time: 670ms
memory: 127580kb

input:

100000 10
82700 7683 137043 155189 135611 103381 139402 54862 187788 67354 13676 193437 181365 182510 140196 149621 122703 135929 37600 40501 31230 107839 131591 116615 79875 146805 63194 161558 62531 167126 147506 3103 13770 177683 94033 7452 10760 102106 17060 8530 34798 118310 4003 174949 4349 11...

output:

253134 223114 235579 236713 261897 242454 230508 245578 287775 239531 

result:

ok single line: '253134 223114 235579 236713 26...54 230508 245578 287775 239531 '

Subtask #5:

score: 1
Accepted

Test #61:

score: 1
Accepted
time: 115ms
memory: 112880kb

input:

20000 1
8260 23162 19083 31764 38686 5100 19437 18310 29053 16504 25374 30501 7543 30973 12153 5191 24580 3044 23328 33054 31229 26909 10407 33096 22917 26256 5677 13524 16383 36303 27681 25325 2346 30364 23195 6239 24636 2591 24756 17408 20987 35844 10387 25215 22822 31666 39853 30752 36965 8863 35...

output:

58709 

result:

ok single line: '58709 '

Test #62:

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

input:

20000 1
26639 26637 26642 26644 26645 26647 26649 26652 26655 26653 26660 26657 26661 26663 26667 26665 26670 26669 26673 26676 26677 26680 26681 26683 26685 26688 26692 26691 26696 26693 26697 26699 26703 26702 26708 26707 26709 26711 26713 26715 26719 26717 26724 26722 26728 26725 26730 26729 2673...

output:

449361772 

result:

ok single line: '449361772 '

Test #63:

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

input:

19998 1
31187 31183 31188 31194 31190 31193 31197 31200 31196 31202 31201 31204 31207 31211 31208 31216 31213 31218 31220 31224 31219 31230 31226 31227 31234 31232 31235 31237 31242 31241 31243 31247 31248 31250 31249 31253 31258 31255 31256 31263 31262 31264 31268 31272 31267 31278 31275 31274 3127...

output:

263187864 

result:

ok single line: '263187864 '

Test #64:

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

input:

20000 1
28347 28360 28353 28359 28355 28358 28364 28370 28362 28361 28368 28374 28376 28371 28378 28379 28389 28381 28382 28385 28384 28393 28396 28400 28392 28394 28409 28403 28410 28401 28404 28411 28419 28417 28420 28418 28429 28430 28421 28423 28424 28435 28438 28432 28431 28437 28446 28443 2844...

output:

111679201 

result:

ok single line: '111679201 '

Test #65:

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

input:

20000 1
4209 4215 4219 4221 4201 4232 4238 4210 4229 4227 4205 4226 4244 4272 4246 4263 4278 4279 4245 4275 4277 4253 4255 4254 4274 4252 4266 4249 4259 4268 4262 4250 4297 4319 4299 4308 4285 4289 4316 4287 4290 4304 4320 4305 4281 4317 4309 4314 4315 4312 4311 4306 4352 4346 4333 4328 4354 4359 43...

output:

14538075 

result:

ok single line: '14538075 '

Test #66:

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

input:

19881 1
846 576 825 677 808 672 716 832 601 810 583 781 638 740 813 777 686 749 818 670 724 692 827 809 691 590 824 722 780 823 838 812 651 756 593 719 752 800 621 820 718 776 817 844 736 619 700 647 815 679 714 1054 851 914 1093 906 1023 1095 1036 973 860 961 945 862 864 890 917 897 980 865 1072 10...

output:

1599263 

result:

ok single line: '1599263 '

Test #67:

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

input:

19998 1
14523 14527 14529 14531 14538 14534 14536 14540 14542 14544 14549 14545 14547 14553 14555 14551 14557 14559 14561 14568 14564 14566 14571 14573 14569 14575 14577 14579 14581 14583 14585 14587 14589 14591 14598 14594 14596 14604 14600 14602 14610 14606 14608 14611 14613 14615 14617 14619 1462...

output:

198343066 

result:

ok single line: '198343066 '

Test #68:

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

input:

20000 1
26839 26801 26803 26805 26807 26809 26811 26813 26815 26817 26819 26842 26844 26846 26848 26850 26852 26854 26856 26858 26860 26862 26864 26866 26868 26870 26872 26874 26876 26878 26880 26897 26899 26901 26903 26905 26907 26909 26911 26913 26915 26917 26919 26881 26883 26885 26887 26889 2689...

output:

20074550 

result:

ok single line: '20074550 '

Test #69:

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

input:

19881 1
11766 11768 11770 11772 11774 11776 11778 11780 11782 11784 11786 11788 11790 11792 11794 11796 11798 11800 11802 11804 11806 11808 11810 11812 11814 11816 11818 11820 11822 11824 11826 11828 11830 11832 11834 11836 11838 11840 11842 11844 11564 11566 11568 11570 11572 11574 11576 11578 1158...

output:

3621404 

result:

ok single line: '3621404 '

Test #70:

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

input:

20000 1
39574 39573 39595 39600 39597 39558 39555 39560 39559 39554 39547 39543 39545 39546 39551 39522 39519 39518 39523 39524 39538 39532 39530 39527 39534 39536 39542 39539 39502 39499 39503 39513 39516 39512 39508 39510 39506 39468 39464 39467 39469 39473 39471 39487 39498 39496 39494 39489 3949...

output:

241654 

result:

ok single line: '241654 '

Test #71:

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

input:

20000 1
22703 22710 22702 22713 22715 22724 22725 22721 22728 22718 22723 22729 22740 22735 22742 22738 22736 22732 22743 22746 22752 22754 22747 22750 22766 22763 22772 22775 22771 22774 22773 22782 22785 22779 22778 22783 22758 22760 22762 22755 22790 22787 22791 22697 22698 22911 22913 22907 2290...

output:

227673 

result:

ok single line: '227673 '

Test #72:

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

input:

20000 1
25617 25613 25620 25609 25614 25622 25615 25618 25604 25606 25601 25600 25598 26233 26235 26203 26204 26206 26208 26214 26210 26216 26217 26228 26226 26229 26221 26220 26222 26231 26238 26240 26196 26192 26191 26194 26201 26186 26197 26190 26185 26178 26183 26179 26176 26181 26182 26169 2617...

output:

180672 

result:

ok single line: '180672 '

Test #73:

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

input:

20000 1
20708 20721 20724 20704 20709 20711 20716 20713 20717 20694 20695 20703 20723 20697 20718 20714 20706 20707 20570 20575 20571 20567 20573 20574 20554 20544 20546 20533 20562 20552 20549 20534 20540 20538 20563 20558 20559 20557 20536 20537 20542 20421 20450 20422 20433 20429 20454 20456 2041...

output:

141898 

result:

ok single line: '141898 '

Test #74:

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

input:

19999 1
32970 7030 32968 7032 32966 7034 32964 7036 32962 7038 32960 7040 32958 7042 32956 7044 32954 7046 32952 7048 32950 7050 32948 7052 32946 7054 32944 7056 32942 7058 32940 7060 32938 7062 32936 7064 32934 7066 32932 7068 32930 7070 32928 7072 32926 7074 32924 7076 32922 7078 32920 7080 32918 ...

output:

99995 

result:

ok single line: '99995 '

Test #75:

score: 0
Accepted
time: 58ms
memory: 115120kb

input:

20000 1
22737 17265 22735 17267 22733 17269 22731 17271 22729 17273 22727 17275 22725 17277 22723 17279 22721 17281 22719 17283 22717 17285 22715 17287 22713 17289 22711 17291 22709 17293 22707 17295 22705 17297 22703 17299 22701 17301 22699 17303 22697 17305 22695 17307 22693 17309 22691 17311 2268...

output:

100000 

result:

ok single line: '100000 '

Test #76:

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

input:

20000 1
8083 8086 8087 8090 8091 8094 8095 8098 8099 8102 8103 8106 8107 8110 8111 8114 8115 8118 8119 8122 8123 8126 8127 8130 8131 8134 8135 8138 8139 8142 8143 8146 8147 8150 8151 8154 8155 8158 8159 8162 8163 8166 8167 8170 8171 8174 8175 8178 8179 8182 8183 8186 8187 8190 8191 8194 8195 8198 81...

output:

800020000 

result:

ok single line: '800020000 '

Subtask #6:

score: 1
Accepted

Test #77:

score: 1
Accepted
time: 108ms
memory: 112340kb

input:

20000 10
37122 3130 15044 10634 29395 31698 29227 38486 30743 16224 36762 21225 34434 7049 5922 29646 17043 2684 30346 11095 29406 16909 26412 8343 29837 8721 28099 8734 7717 29088 6414 27191 13096 8463 34156 23605 31577 4853 39185 24977 28983 34919 10330 1303 23468 11457 17442 28837 16603 31324 424...

output:

62119 52465 66066 51757 46662 46349 56343 50160 45653 51054 

result:

ok single line: '62119 52465 66066 51757 46662 46349 56343 50160 45653 51054 '

Test #78:

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

input:

20000 10
694 700 698 701 703 708 705 711 712 715 713 719 717 722 721 726 725 731 730 733 736 739 740 741 744 748 747 750 752 755 754 758 760 763 762 767 768 769 771 774 775 779 778 782 783 788 785 791 792 793 795 797 798 803 802 807 805 810 811 815 813 818 820 824 821 828 826 829 832 835 836 837 839...

output:

456983981 295329490 47706033 496 0 0 0 0 0 0 

result:

ok single line: '456983981 295329490 47706033 496 0 0 0 0 0 0 '

Test #79:

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

input:

19998 10
22267 22269 22276 22273 22278 22284 22282 22281 22286 22288 22285 22291 22295 22294 22297 22302 22299 22305 22304 22308 22310 22311 22309 22319 22317 22316 22325 22324 22322 22331 22327 22332 22334 22337 22338 22342 22344 22340 22348 22345 22350 22354 22355 22356 22357 22361 22362 22364 223...

output:

261992010 355993562 156503457 24165199 1205750 28 0 0 0 0 

result:

ok single line: '261992010 355993562 156503457 24165199 1205750 28 0 0 0 0 '

Test #80:

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

input:

20000 10
17531 17532 17536 17548 17547 17542 17545 17541 17554 17553 17560 17559 17556 17570 17563 17562 17568 17567 17579 17573 17580 17577 17575 17590 17585 17584 17581 17589 17598 17600 17594 17591 17599 17610 17602 17607 17605 17601 17615 17619 17613 17620 17612 17628 17621 17630 17623 17627 176...

output:

111528976 243759878 244574912 139867747 48699191 10227559 1272402 86986 2349 0 

result:

ok single line: '111528976 243759878 244574912 ... 10227559 1272402 86986 2349 0 '

Test #81:

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

input:

20000 10
38355 38321 38346 38349 38370 38380 38374 38397 38400 38385 38399 38391 38388 38383 38387 38398 38368 38377 38371 38396 38395 38373 38376 38392 38412 38415 38417 38438 38414 38431 38428 38430 38421 38436 38423 38409 38401 38408 38426 38413 38434 38418 38410 38424 38455 38477 38475 38441 384...

output:

14121329 22335383 29920571 39156321 50160264 64586844 76930851 82907502 81171935 75100873 

result:

ok single line: '14121329 22335383 29920571 391...851 82907502 81171935 75100873 '

Test #82:

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

input:

19881 10
24352 24274 24463 24334 24357 24370 24395 24398 24403 24502 24522 24532 24356 24367 24281 24570 24641 24788 24780 24584 24735 24627 24771 24673 24754 24739 24544 24724 24756 24727 24663 24652 24781 24567 24557 24690 24645 24583 24798 24746 24801 24787 24682 24804 24624 24659 24692 24812 245...

output:

1650057 2094393 2224697 2336563 2440838 2602756 2724701 2875867 2987376 3109198 

result:

ok single line: '1650057 2094393 2224697 233656...724701 2875867 2987376 3109198 '

Test #83:

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

input:

19998 10
5034 5035 5037 5039 5044 5042 5046 5051 5047 5049 5058 5056 5054 5060 5064 5062 5065 5069 5067 5073 5075 5071 5078 5080 5082 5088 5084 5086 5094 5092 5090 5095 5097 5099 5101 5105 5103 5108 5110 5112 5115 5113 5117 5124 5120 5122 5127 5125 5129 5135 5131 5133 5137 5141 5139 5147 5145 5143 5...

output:

197715447 355660972 204209743 39798755 2475053 36 0 0 0 0 

result:

ok single line: '197715447 355660972 204209743 39798755 2475053 36 0 0 0 0 '

Test #84:

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

input:

20000 10
8802 8840 8816 8869 8843 8863 8853 8855 8861 8841 8849 8851 8867 8847 8875 8845 8859 8857 8871 8873 8877 8879 8865 8884 8892 8916 8886 8918 8896 8908 8894 8890 8902 8920 8898 8900 8906 8904 8914 8910 8888 8882 8912 8923 8949 8925 8927 8933 8959 8939 8957 8921 8945 8937 8941 8931 8953 8947 8...

output:

19286506 42737039 75872452 116638968 140695988 137993194 116537785 82403584 44840971 17466208 

result:

ok single line: '19286506 42737039 75872452 116...785 82403584 44840971 17466208 '

Test #85:

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

input:

19881 10
22186 22174 22234 22030 22114 22100 22094 22178 22204 22026 22102 22068 22078 22142 22098 22018 22126 22274 22184 22170 22122 22232 22244 22238 22228 22162 22156 22024 22270 22046 22224 22262 22112 22088 22292 22530 22340 22470 22460 22538 22400 22478 22512 22500 22424 22296 22330 22490 223...

output:

3478592 4519512 5337710 6381637 7037708 7706696 8415918 9269897 10303428 10974986 

result:

ok single line: '3478592 4519512 5337710 638163...5918 9269897 10303428 10974986 '

Test #86:

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

input:

20000 10
23667 23668 23654 23641 23642 23645 23647 23646 23648 23651 23634 23631 23638 23632 23630 23627 23625 23611 23624 23614 23616 23619 23620 23622 23599 23604 23606 23601 23597 23598 23608 23609 23591 23593 23590 23264 23263 23271 23274 23270 23265 23267 23276 23282 23278 23283 23284 23259 233...

output:

245844 1100660 4034708 12511540 31746928 64353677 103694730 134429740 142689435 124367118 

result:

ok single line: '245844 1100660 4034708 1251154... 134429740 142689435 124367118 '

Test #87:

score: 0
Accepted
time: 98ms
memory: 112292kb

input:

20000 10
4966 4968 4967 4898 4897 4890 4887 4891 4892 4885 4893 4881 4902 4900 4909 4905 4914 4911 4906 4904 4959 4954 4960 4956 4962 4948 4951 4952 4935 4945 4936 4941 4946 4943 4916 4932 4928 4926 4929 4925 4920 4923 4919 4924 4825 4822 4824 4821 4820 4830 4832 4846 4839 4836 4843 4838 4835 4848 4...

output:

215172 987707 3559748 10675697 26094340 51917923 84723806 114800810 130190195 124571487 

result:

ok single line: '215172 987707 3559748 10675697... 114800810 130190195 124571487 '

Test #88:

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

input:

20000 10
36246 36234 36227 36233 36231 36226 36229 36224 36219 36228 36220 36256 36265 36262 36268 36271 36257 36269 36263 36270 36295 36284 36289 36294 36281 36297 36282 36287 36279 36291 36273 36277 36275 36412 36410 36391 36394 36395 36401 36399 36393 36404 36384 36383 36387 36385 36408 36406 363...

output:

188325 845440 3200753 10069928 25421934 51200242 83255465 111097392 124325665 119037859 

result:

ok single line: '188325 845440 3200753 10069928... 111097392 124325665 119037859 '

Test #89:

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

input:

20000 10
8675 8667 8740 8729 8731 8732 8733 8753 8730 8745 8752 8739 8742 8738 8751 8756 8776 8755 8777 8759 8775 8771 8758 8762 8760 8768 8778 8784 8782 8788 8787 8786 8785 8658 8662 8661 8657 8659 8656 8469 8496 8479 8482 8503 8504 8497 8471 8484 8480 8502 8493 8495 8498 8494 8475 8490 8478 8489 8...

output:

149982 659643 2449911 7188072 16021957 28134947 41144724 53161987 63119178 70306844 

result:

ok single line: '149982 659643 2449911 7188072 ...724 53161987 63119178 70306844 '

Test #90:

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

input:

19999 10
16414 23584 16416 23582 16418 23580 16420 23578 16422 23576 16424 23574 16426 23572 16428 23570 16430 23568 16432 23566 16434 23564 16436 23562 16438 23560 16440 23558 16442 23556 16444 23554 16446 23552 16448 23550 16450 23548 16452 23546 16454 23544 16456 23542 16458 23540 16460 23538 164...

output:

99995 79990 79986 79982 79978 79974 79970 79966 79962 79958 

result:

ok single line: '99995 79990 79986 79982 79978 79974 79970 79966 79962 79958 '

Test #91:

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

input:

20000 10
13865 26135 13867 26133 13869 26131 13871 26129 13873 26127 13875 26125 13877 26123 13879 26121 13881 26119 13883 26117 13885 26115 13887 26113 13889 26111 13891 26109 13893 26107 13895 26105 13897 26103 13899 26101 13901 26099 13903 26097 13905 26095 13907 26093 13909 26091 13911 26089 139...

output:

100000 79994 79990 79986 79982 79978 79974 79970 79966 79962 

result:

ok single line: '100000 79994 79990 79986 79982 79978 79974 79970 79966 79962 '

Test #92:

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

input:

20000 10
37508 37509 37512 37513 37516 37517 37520 37521 37524 37525 37528 37529 37532 37533 37536 37537 37540 37541 37544 37545 37548 37549 37552 37553 37556 37557 37560 37561 37564 37565 37568 37569 37572 37573 37576 37577 37580 37581 37584 37585 37588 37589 37592 37593 37596 37597 37600 37601 376...

output:

800020000 0 0 0 0 0 0 0 0 0 

result:

ok single line: '800020000 0 0 0 0 0 0 0 0 0 '

Test #93:

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

input:

20000 5
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 17...

output:

399900015 79993 79993 79994 399860011 

result:

ok single line: '399900015 79993 79993 79994 399860011 '

Test #94:

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

input:

20000 8
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 17...

output:

399780046 79987 79987 79987 79987 79987 79988 399740041 

result:

ok single line: '399780046 79987 79987 79987 79987 79987 79988 399740041 '

Test #95:

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

input:

20000 10
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

399700076 79983 79983 79983 79983 79983 79983 79983 79984 399660071 

result:

ok single line: '399700076 79983 79983 79983 79...83 79983 79983 79984 399660071 '

Subtask #7:

score: 1
Accepted

Test #96:

score: 1
Accepted
time: 674ms
memory: 127472kb

input:

100000 1
184488 199575 61547 186158 115443 82615 177342 64604 124208 4012 152444 113522 105138 104715 64740 152490 175932 130353 169948 187430 30884 108488 12761 28267 180529 162418 98945 127768 181574 92995 74927 17992 52128 144406 91892 165442 133627 58061 70318 156100 159695 56046 14083 192791 76...

output:

493945 

result:

ok single line: '493945 '

Test #97:

score: 0
Accepted
time: 517ms
memory: 129280kb

input:

100000 1
30663 30673 30644 30712 30690 30680 30742 30776 30722 30770 30761 30790 30772 30781 30745 30791 30723 30800 30754 30797 30759 30735 30721 30775 30783 30778 30729 30773 30786 30798 30771 30795 30728 30769 30787 30799 30730 30763 30755 30724 30756 30762 30750 30784 30765 30753 30818 30807 308...

output:

167068314 

result:

ok single line: '167068314 '

Test #98:

score: 0
Accepted
time: 516ms
memory: 128408kb

input:

100000 1
170158 170185 170207 170175 170121 170186 170337 170389 170249 170205 170352 170251 170310 170398 170086 170344 170014 170221 170180 170031 170361 170254 170041 170023 170182 170191 170227 170426 170494 170585 170453 170403 170631 170419 170454 170792 170570 170563 170772 170416 170743 1706...

output:

30630186 

result:

ok single line: '30630186 '

Test #99:

score: 0
Accepted
time: 521ms
memory: 129236kb

input:

100000 1
185301 185211 185325 185342 185024 185404 185242 185039 185300 185471 185555 185004 185226 185043 185859 185122 185772 185592 185518 185373 185990 185376 185292 185668 185354 185665 185408 185271 185044 185854 185186 186000 185949 185497 185836 185217 185915 185847 185515 185494 185264 1854...

output:

11406756 

result:

ok single line: '11406756 '

Test #100:

score: 0
Accepted
time: 529ms
memory: 127480kb

input:

100000 1
92325 95633 95202 94037 94865 94273 93232 95499 95549 95201 92282 92378 94782 93627 95227 95493 95209 92698 92334 94212 92859 95883 93481 92254 93613 94003 92837 95330 92197 94388 93839 93792 93861 95159 93226 93752 93705 92101 95458 92866 93545 93066 94906 94946 95619 94817 95251 92083 943...

output:

3278902 

result:

ok single line: '3278902 '

Test #101:

score: 0
Accepted
time: 529ms
memory: 128980kb

input:

100000 1
3701 3703 3705 3789 3791 3793 3795 3797 3799 3801 3803 3805 3807 3809 3811 3813 3815 3817 3819 3821 3823 3825 3827 3829 3831 3833 3835 3837 3839 3761 3763 3765 3767 3769 3771 3773 3775 3777 3779 3781 3783 3785 3787 3868 3870 3872 3874 3876 3878 3880 3882 3884 3886 3888 3890 3892 3894 3896 3...

output:

265143227 

result:

ok single line: '265143227 '

Test #102:

score: 0
Accepted
time: 491ms
memory: 129932kb

input:

100000 1
25649 25651 25653 25655 25657 25659 25661 25663 25665 25667 25669 25671 25673 25675 25677 25679 25681 25683 25685 25687 25689 25691 25693 25695 25697 25699 25701 25703 25705 25890 25892 25894 25896 25898 25900 25902 25904 25906 25908 25910 25912 25914 25916 25918 25920 25922 25924 25926 259...

output:

118013583 

result:

ok single line: '118013583 '

Test #103:

score: 0
Accepted
time: 506ms
memory: 128976kb

input:

100000 1
186450 186452 186454 186456 186458 186460 186462 186464 186466 186468 186470 186472 186474 186476 186478 186480 186482 186484 186486 186488 186490 186492 186494 186496 186498 186500 186502 186504 186506 186508 186510 186512 186514 186516 186518 186520 186522 186524 186526 186528 186530 1865...

output:

28307494 

result:

ok single line: '28307494 '

Test #104:

score: 0
Accepted
time: 536ms
memory: 127604kb

input:

100000 1
77464 77450 77453 77452 77458 77440 77462 77413 77431 77430 77419 77410 77427 77436 77415 77435 77428 77411 77438 77426 77406 77414 77420 77424 77429 77683 77689 77676 77681 77670 77663 77687 77688 77690 77671 77686 77667 77679 77684 77672 77534 77532 77529 77585 77570 77581 77588 77593 775...

output:

686207 

result:

ok single line: '686207 '

Test #105:

score: 0
Accepted
time: 527ms
memory: 127400kb

input:

100000 1
136905 136977 136893 136951 136867 136959 136925 136945 136927 136888 136988 136877 136911 136880 136964 136978 136965 136939 136871 136879 136983 136894 136873 136950 136926 136976 136887 136995 136987 136949 136902 136914 136981 136933 136971 136895 136858 136969 136872 136932 136930 1369...

output:

605507 

result:

ok single line: '605507 '

Test #106:

score: 0
Accepted
time: 519ms
memory: 127536kb

input:

100000 1
71585 71331 71869 71683 71670 71525 71708 71420 71309 71214 71423 71472 71882 71238 71153 71195 71370 71308 71396 71829 71662 71140 71911 71160 71599 71315 71603 71658 71689 71782 71938 71900 71933 71314 71479 71342 71154 71356 71345 71285 71535 71286 71943 71644 71928 71449 71632 71194 718...

output:

572987 

result:

ok single line: '572987 '

Test #107:

score: 0
Accepted
time: 339ms
memory: 133116kb

input:

99999 1
111584 88416 111582 88418 111580 88420 111578 88422 111576 88424 111574 88426 111572 88428 111570 88430 111568 88432 111566 88434 111564 88436 111562 88438 111560 88440 111558 88442 111556 88444 111554 88446 111552 88448 111550 88450 111548 88452 111546 88454 111544 88456 111542 88458 111540...

output:

499995 

result:

ok single line: '499995 '

Test #108:

score: 0
Accepted
time: 336ms
memory: 132284kb

input:

100000 1
57115 142885 57117 142883 57119 142881 57121 142879 57123 142877 57125 142875 57127 142873 57129 142871 57131 142869 57133 142867 57135 142865 57137 142863 57139 142861 57141 142859 57143 142857 57145 142855 57147 142853 57149 142851 57151 142849 57153 142847 57155 142845 57157 142843 57159...

output:

500000 

result:

ok single line: '500000 '

Subtask #8:

score: 1
Accepted

Test #109:

score: 1
Accepted
time: 684ms
memory: 127096kb

input:

100000 10
13763 82869 153448 151170 185611 191283 101826 196257 150421 49313 96588 32246 110056 73755 9887 12523 88212 112364 28378 131033 63099 102930 78232 166326 42025 145005 26580 85545 114549 71238 19865 71364 183284 21738 132799 134266 129286 50677 118977 17635 110174 85984 57815 147687 131631...

output:

353453 235794 271414 264379 233498 254385 242018 240421 239405 231243 

result:

ok single line: '353453 235794 271414 264379 23...85 242018 240421 239405 231243 '

Test #110:

score: 0
Accepted
time: 519ms
memory: 128096kb

input:

100000 10
149393 149478 149508 149453 149492 149490 149511 149443 149494 149520 149477 149510 149471 149451 149462 149502 149475 149479 149509 149481 149519 149442 149468 149518 149489 149482 149450 149484 149487 149483 149469 149512 149457 149452 149472 149465 149441 149506 149500 149449 149513 149...

output:

166100562 224674701 270214813 309637196 352183791 394319979 446857267 504390714 573938006 660341892 

result:

ok single line: '166100562 224674701 270214813 ... 504390714 573938006 660341892 '

Test #111:

score: 0
Accepted
time: 510ms
memory: 127688kb

input:

100000 10
157313 157246 157259 157402 157441 157403 157229 157294 157346 157207 157502 157344 157363 157550 157342 157337 157521 157547 157417 157301 157345 157412 157393 157255 157240 157406 157323 157209 157590 157306 157397 157293 157282 157381 157555 157217 157568 157471 157297 157353 157552 157...

output:

29313856 34357778 37423052 38446459 40752337 43787821 45436289 46190748 48184834 49654550 

result:

ok single line: '29313856 34357778 37423052 384...289 46190748 48184834 49654550 '

Test #112:

score: 0
Accepted
time: 515ms
memory: 126916kb

input:

100000 10
194282 195000 194475 194517 194041 195269 195723 195261 195608 195398 195478 195821 195207 195130 195026 195702 195344 195316 195788 195810 195920 195403 195086 195426 195941 195040 195790 195737 195065 195958 195586 195623 195546 195817 195202 195042 195916 195527 195123 195806 195965 195...

output:

10787975 11870128 13006701 13107038 13718740 14037514 14807098 14752536 15517248 15809601 

result:

ok single line: '10787975 11870128 13006701 131...098 14752536 15517248 15809601 '

Test #113:

score: 0
Accepted
time: 536ms
memory: 127548kb

input:

100000 10
155149 155602 152611 153472 154031 152654 152364 152692 154359 155395 154672 153403 152801 155447 153022 154029 155735 153783 154445 152356 155445 153619 154755 153340 153686 155956 153155 154664 152665 153702 152259 153250 153543 153435 153477 154128 153115 154361 153016 153772 154386 155...

output:

3373237 3486544 3369782 3523300 3849700 3530514 3680154 3365631 3411504 3553536 

result:

ok single line: '3373237 3486544 3369782 352330...680154 3365631 3411504 3553536 '

Test #114:

score: 0
Accepted
time: 518ms
memory: 129360kb

input:

100000 10
20165 20233 20227 20213 20231 20177 20195 20201 20185 20221 20189 20183 20260 20258 20320 20268 20286 20308 20290 20264 20250 20272 20310 20244 20254 20288 20266 20292 20276 20256 20304 20306 20248 20246 20270 20312 20296 20262 20242 20274 20294 20300 20284 20302 20282 20298 20280 20278 20...

output:

273928022 463612551 654256959 892551118 1191538368 1567398275 1929229325 2131274826 2115437845 1980202622 

result:

ok single line: '273928022 463612551 654256959 ...31274826 2115437845 1980202622 '

Test #115:

score: 0
Accepted
time: 526ms
memory: 128956kb

input:

100000 10
92531 92533 92535 92537 92539 92541 92543 92545 92547 92549 92551 92553 92555 92557 92559 92561 92563 92565 92567 92569 92571 92573 92575 92577 92579 92581 92583 92585 92587 92589 92591 92593 92595 92597 92755 92757 92759 92761 92763 92765 92767 92769 92771 92773 92775 92777 92779 92781 92...

output:

122724592 172271420 209798784 253013944 286223174 321705171 357743122 394817643 435981156 485628592 

result:

ok single line: '122724592 172271420 209798784 ... 394817643 435981156 485628592 '

Test #116:

score: 0
Accepted
time: 505ms
memory: 128560kb

input:

100000 10
91716 91896 91120 91664 91674 91998 91168 91980 91324 91530 91108 91012 91350 91622 91554 91986 91516 91266 91320 91594 91112 91434 91006 91142 91388 91066 91326 91470 91612 91952 91352 91058 91180 91808 91340 91870 91928 91766 91600 91898 91362 91172 91872 91748 91740 91730 91394 91370 91...

output:

28300316 32679923 35484153 39329895 40971647 41845474 43371395 45999648 46974764 49312252 

result:

ok single line: '28300316 32679923 35484153 393...395 45999648 46974764 49312252 '

Test #117:

score: 0
Accepted
time: 538ms
memory: 127612kb

input:

100000 10
169328 169324 169366 169358 169363 169364 169371 169370 169369 169367 169352 169355 169361 169354 169368 169375 169377 169381 169476 169487 169460 169486 169496 169465 169469 169491 169478 169485 169480 169483 169481 169482 169464 169488 169479 169468 169466 169432 169454 169430 169447 169...

output:

721848 3077739 11970440 39929038 108211431 239255295 443173464 708194138 1001714552 1284092642 

result:

ok single line: '721848 3077739 11970440 399290...08194138 1001714552 1284092642 '

Test #118:

score: 0
Accepted
time: 527ms
memory: 128696kb

input:

100000 10
17523 17483 17513 17511 17454 17471 17477 17397 17515 17470 17442 17417 17405 17411 17491 17406 17443 17450 17497 17451 17530 17424 17439 17460 17543 17476 17452 17500 17518 17480 17432 17498 17526 17479 17413 17404 17532 17494 17410 17528 17512 17415 17536 17449 17534 17501 17459 17472 17...

output:

592401 2058853 6431925 18284428 44269274 87512155 144463377 205826123 262942721 312449383 

result:

ok single line: '592401 2058853 6431925 1828442... 205826123 262942721 312449383 '

Test #119:

score: 0
Accepted
time: 513ms
memory: 128348kb

input:

100000 10
56357 56640 56394 56172 56378 56137 56494 56342 56460 56742 56111 56542 56128 56140 56091 56370 56701 56426 56530 56375 56480 56198 56200 56133 56602 56215 56232 56669 56751 56238 56509 56168 56616 56406 56312 56475 56560 56499 56418 56061 56337 56204 56354 56446 56512 56189 56164 56371 56...

output:

510833 1568029 4187407 9077850 15178679 20330567 23872610 26339596 28395521 29839591 

result:

ok single line: '510833 1568029 4187407 9077850...610 26339596 28395521 29839591 '

Test #120:

score: 0
Accepted
time: 333ms
memory: 135252kb

input:

99999 10
134038 65962 134036 65964 134034 65966 134032 65968 134030 65970 134028 65972 134026 65974 134024 65976 134022 65978 134020 65980 134018 65982 134016 65984 134014 65986 134012 65988 134010 65990 134008 65992 134006 65994 134004 65996 134002 65998 134000 66000 133998 66002 133996 66004 13399...

output:

499995 399990 399986 399982 399978 399974 399970 399966 399962 399958 

result:

ok single line: '499995 399990 399986 399982 39...74 399970 399966 399962 399958 '

Test #121:

score: 0
Accepted
time: 335ms
memory: 132660kb

input:

100000 10
159194 40808 159192 40810 159190 40812 159188 40814 159186 40816 159184 40818 159182 40820 159180 40822 159178 40824 159176 40826 159174 40828 159172 40830 159170 40832 159168 40834 159166 40836 159164 40838 159162 40840 159160 40842 159158 40844 159156 40846 159154 40848 159152 40850 1591...

output:

500000 399994 399990 399986 399982 399978 399974 399970 399966 399962 

result:

ok single line: '500000 399994 399990 399986 39...78 399974 399970 399966 399962 '

Subtask #9:

score: 1
Accepted

Test #122:

score: 1
Accepted
time: 667ms
memory: 126708kb

input:

100000 1
173206 29172 157020 147149 12220 145352 172784 36710 183091 187710 142752 23844 81586 161419 87210 154300 66402 175548 62953 30212 149421 117646 193418 118516 177795 115642 176042 126287 14433 17937 105013 14605 143898 132929 143591 115108 42509 177469 90041 168554 70665 11736 145789 93906 ...

output:

246499 

result:

ok single line: '246499 '

Test #123:

score: 0
Accepted
time: 455ms
memory: 132648kb

input:

100000 1
141915 141918 141919 141921 141923 141926 141927 141930 141931 141934 141935 141937 141940 141942 141943 141945 141947 141949 141952 141953 141955 141958 141960 141961 141964 141966 141967 141970 141972 141973 141976 141977 141980 141981 141984 141985 141987 141990 141992 141993 141995 1419...

output:

20000050144 

result:

ok single line: '20000050144 '

Test #124:

score: 0
Accepted
time: 454ms
memory: 130560kb

input:

100000 1
152995 152998 152997 153001 153002 153005 153006 153012 153009 153015 153016 153020 153019 153021 153023 153025 153028 153029 153030 153035 153034 153038 153040 153044 153043 153045 153048 153050 153049 153056 153054 153060 153057 153061 153063 153065 153066 153070 153071 153074 153073 1530...

output:

11237293296 

result:

ok single line: '11237293296 '

Test #125:

score: 0
Accepted
time: 472ms
memory: 129816kb

input:

99999 1
50980 50985 50988 50986 50994 50993 50989 50995 50996 50997 51005 51001 51006 51011 51010 51012 51018 51013 51016 51021 51020 51019 51030 51025 51028 51036 51031 51032 51039 51037 51040 51043 51046 51047 51051 51053 51054 51056 51055 51060 51063 51064 51061 51068 51067 51069 51073 51077 5107...

output:

6543304832 

result:

ok single line: '6543304832 '

Test #126:

score: 0
Accepted
time: 476ms
memory: 129728kb

input:

100000 1
184666 184668 184665 184676 184672 184671 184673 184680 184683 184688 184687 184682 184686 184698 184697 184694 184700 184691 184703 184701 184702 184705 184706 184720 184711 184712 184714 184719 184730 184727 184723 184721 184722 184732 184735 184734 184731 184739 184747 184746 184742 1847...

output:

2807773609 

result:

ok single line: '2807773609 '

Test #127:

score: 0
Accepted
time: 514ms
memory: 128340kb

input:

100000 1
53217 53246 53211 53290 53248 53207 53254 53231 53258 53268 53271 53205 53251 53233 53261 53230 53220 53345 53340 53355 53366 53325 53384 53339 53313 53320 53382 53394 53368 53347 53317 53374 53396 53383 53328 53310 53359 53331 53303 53349 53356 53332 53370 53372 53353 53341 53387 53354 533...

output:

128943459 

result:

ok single line: '128943459 '

Test #128:

score: 0
Accepted
time: 514ms
memory: 126872kb

input:

100000 1
104445 104541 104447 104443 104586 104457 104474 104570 104480 104523 104559 104484 104411 104517 104580 104497 104545 104555 104435 104596 104678 104650 104758 104624 104666 104707 104765 104625 104775 104714 104655 104749 104785 104743 104623 104752 104732 104656 104658 104679 104669 1046...

output:

60590806 

result:

ok single line: '60590806 '

Test #129:

score: 0
Accepted
time: 515ms
memory: 131088kb

input:

99856 1
81277 81316 81330 80998 81069 81404 80971 81214 81350 81275 81105 81114 81194 80901 80964 81078 81193 81263 81437 81254 81011 81308 81329 81516 80915 81261 81034 80932 81159 81050 80980 81291 81411 81135 81397 81150 80934 81020 81440 81361 81367 81146 81307 81403 81055 81043 81117 80911 8133...

output:

17403063 

result:

ok single line: '17403063 '

Test #130:

score: 0
Accepted
time: 456ms
memory: 129452kb

input:

100000 1
141813 141818 141820 141824 141822 141826 141828 141832 141830 141835 141833 141840 141838 141843 141841 141847 141845 141849 141851 141854 141856 141857 141859 141862 141864 141865 141867 141870 141872 141874 141876 141877 141879 141884 141882 141885 141887 141892 141890 141895 141893 1418...

output:

9477172506 

result:

ok single line: '9477172506 '

Test #131:

score: 0
Accepted
time: 477ms
memory: 129680kb

input:

100000 1
140945 140947 140949 140951 140958 140960 140954 140956 140966 140968 140962 140964 140970 140972 140974 140976 140978 140980 140982 140984 140988 140990 140992 140986 141000 140994 140996 140998 141005 141007 141001 141003 141012 141014 141016 141010 141022 141024 141018 141020 141031 1410...

output:

3215283920 

result:

ok single line: '3215283920 '

Test #132:

score: 0
Accepted
time: 474ms
memory: 129440kb

input:

100000 1
58296 58292 58288 58284 58315 58317 58313 58305 58309 58301 58303 58307 58311 58319 58328 58340 58334 58332 58324 58336 58330 58322 58326 58338 58350 58346 58356 58342 58360 58358 58344 58348 58352 58354 58364 58374 58362 58376 58366 58368 58372 58370 58380 58378 58400 58388 58390 58384 583...

output:

986725252 

result:

ok single line: '986725252 '

Test #133:

score: 0
Accepted
time: 528ms
memory: 128288kb

input:

100000 1
155567 155581 155569 155563 155589 155579 155599 155614 155638 155618 155622 155650 155634 155642 155636 155604 155646 155616 155644 155626 155620 155610 155640 155628 155632 155608 155606 155602 155612 155648 155624 155630 155691 155683 155667 155671 155659 155687 155653 155675 155677 1556...

output:

417747649 

result:

ok single line: '417747649 '

Test #134:

score: 0
Accepted
time: 495ms
memory: 128628kb

input:

99856 1
45013 45015 45017 45019 45021 45023 45025 45027 45029 45031 45033 45035 45037 45039 45041 45043 45045 45047 45049 45051 45053 45055 45057 45059 45061 45063 45065 45067 45069 45071 45073 45075 45077 45079 45081 45083 45085 45087 45089 45091 45093 45095 45097 45099 45101 45103 45105 45107 4510...

output:

39568641 

result:

ok single line: '39568641 '

Test #135:

score: 0
Accepted
time: 501ms
memory: 127840kb

input:

100000 1
143283 143284 143288 143260 143257 143255 143262 143267 143264 143269 143270 143253 143273 143274 143271 143282 143278 143280 143236 143240 143235 143238 143243 143251 143252 143249 143248 143363 143362 143358 143360 143359 143456 143449 143452 143450 143445 143446 143444 143440 143441 1434...

output:

1218977 

result:

ok single line: '1218977 '

Test #136:

score: 0
Accepted
time: 521ms
memory: 127652kb

input:

100000 1
43276 43267 43264 43279 43283 43261 43259 43175 43181 43179 43177 43174 43182 43163 43162 43157 43155 43166 43172 43171 43165 43159 43145 43152 43142 43153 43139 43154 43147 43138 43148 43141 43133 43100 43119 43117 43113 43105 43116 43109 43110 43101 43102 43106 43123 43128 43127 43130 431...

output:

936460 

result:

ok single line: '936460 '

Test #137:

score: 0
Accepted
time: 533ms
memory: 127624kb

input:

100000 1
55655 55622 55650 55656 55633 55636 55621 55639 55620 55643 55626 55640 55658 55654 55630 55625 55617 55623 55619 55618 55644 55672 55680 55699 55700 55667 55668 55675 55674 55697 55682 55673 55681 55691 55662 55663 55661 55676 55690 55665 55671 55677 55659 55696 55756 55755 55759 55167 551...

output:

691710 

result:

ok single line: '691710 '

Test #138:

score: 0
Accepted
time: 516ms
memory: 126760kb

input:

100000 1
36640 36204 36563 36668 36572 36680 36348 36352 36318 36620 36478 36133 36097 36324 36102 36482 36129 36222 36197 36414 36521 36649 36209 36600 36742 36693 36476 36411 36233 36708 36088 36707 36672 36451 36463 36269 36382 36725 36146 36105 36577 36189 36248 36159 36633 36332 36477 36255 362...

output:

511892 

result:

ok single line: '511892 '

Test #139:

score: 0
Accepted
time: 447ms
memory: 132624kb

input:

100000 1
28964 28965 28968 28969 28972 28973 28976 28977 28980 28981 28984 28985 28988 28989 28992 28993 28996 28997 29000 29001 29004 29005 29008 29009 29012 29013 29016 29017 29020 29021 29024 29025 29028 29029 29032 29033 29036 29037 29040 29041 29044 29045 29048 29049 29052 29053 29056 29057 290...

output:

20000100000 

result:

ok single line: '20000100000 '

Subtask #10:

score: 1
Accepted

Test #140:

score: 1
Accepted
time: 684ms
memory: 127516kb

input:

100000 10
57693 110342 28705 133926 61784 186038 51305 155569 48140 115185 14169 141018 165711 24907 12001 165455 122449 21315 93989 187573 166405 193098 3306 189403 2421 23963 28619 50447 23589 121975 112280 17930 2499 90579 103377 113266 119659 153038 102862 35946 124741 136376 146205 141476 11481...

output:

413064 268881 264857 258053 250706 254166 256016 249141 267637 271386 

result:

ok single line: '413064 268881 264857 258053 25...66 256016 249141 267637 271386 '

Test #141:

score: 0
Accepted
time: 464ms
memory: 132448kb

input:

100000 10
195380 195382 195384 195385 195388 195390 195391 195394 195395 195397 195400 195401 195404 195406 195408 195410 195411 195414 195415 195417 195419 195422 195423 195426 195427 195430 195431 195433 195436 195438 195440 195441 195443 195446 195448 195449 195451 195454 195455 195458 195460 195...

output:

20000049965 50035 0 0 0 0 0 0 0 0 

result:

ok single line: '20000049965 50035 0 0 0 0 0 0 0 0 '

Test #142:

score: 0
Accepted
time: 441ms
memory: 129496kb

input:

100000 10
185116 185118 185119 185124 185121 185125 185128 185129 185130 185135 185133 185139 185138 185142 185143 185148 185147 185152 185150 185153 185156 185157 185159 185164 185162 185165 185167 185170 185172 185175 185176 185177 185178 185183 185182 185186 185187 185192 185190 185193 185195 185...

output:

11309411724 7460366635 1230318811 2830 0 0 0 0 0 0 

result:

ok single line: '11309411724 7460366635 1230318811 2830 0 0 0 0 0 0 '

Test #143:

score: 0
Accepted
time: 478ms
memory: 131596kb

input:

99999 10
32421 32419 32425 32430 32427 32433 32431 32434 32439 32442 32437 32444 32443 32448 32450 32453 32449 32459 32455 32457 32461 32466 32465 32471 32469 32468 32477 32474 32473 32483 32479 32482 32487 32489 32485 32496 32493 32495 32501 32502 32498 32506 32508 32505 32509 32511 32512 32515 325...

output:

6557684489 8889860176 3911916694 609415877 30822584 181 0 0 0 0 

result:

ok single line: '6557684489 8889860176 3911916694 609415877 30822584 181 0 0 0 0 '

Test #144:

score: 0
Accepted
time: 494ms
memory: 129348kb

input:

100000 10
173957 173951 173964 173966 173963 173965 173967 173973 173980 173977 173976 173979 173987 173988 173986 173990 173981 173999 173996 174000 173997 173994 174009 174007 174003 174010 174005 174018 174016 174014 174012 174020 174022 174021 174029 174026 174024 174036 174040 174031 174038 174...

output:

2774835790 6050600530 6119312037 3526456317 1235668759 258806007 32143256 2210603 66701 0 

result:

ok single line: '2774835790 6050600530 61193120...06007 32143256 2210603 66701 0 '

Test #145:

score: 0
Accepted
time: 520ms
memory: 127972kb

input:

100000 10
72257 72232 72288 72287 72219 72237 72265 72233 72214 72276 72296 72217 72229 72284 72278 72206 72268 72202 72286 72244 72211 72283 72236 72285 72208 72213 72228 72210 72216 72245 72246 72224 72366 72390 72359 72310 72337 72398 72351 72363 72321 72341 72370 72396 72375 72328 72387 72338 72...

output:

128180462 167576162 195274644 226698213 251587464 278227717 306070345 336908336 368732640 405666921 

result:

ok single line: '128180462 167576162 195274644 ... 336908336 368732640 405666921 '

Test #146:

score: 0
Accepted
time: 500ms
memory: 127828kb

input:

100000 10
95579 95500 95453 95436 95463 95521 95430 95479 95445 95567 95525 95548 95541 95447 95419 95429 95531 95405 95566 95509 95422 95573 95558 95544 95496 95404 95575 95490 95589 95535 95472 95572 95461 95417 95434 95476 95547 95442 95577 95520 95501 95443 95536 95467 95438 95538 95513 95460 95...

output:

60509055 73576423 83831632 90375919 96964262 104526580 109814936 116460728 123581640 128995847 

result:

ok single line: '60509055 73576423 83831632 903... 116460728 123581640 128995847 '

Test #147:

score: 0
Accepted
time: 503ms
memory: 127624kb

input:

99856 10
84004 83769 83715 83991 83853 83519 83523 83701 83875 83890 83904 83812 83923 84026 83897 83471 84021 83554 83463 83943 83754 83988 83997 83944 83990 83879 83933 83877 83663 83622 83565 83926 83641 83600 83518 83636 83713 83508 83747 84042 83430 83993 83476 83977 83985 83956 83723 83557 840...

output:

18193769 19486016 21425356 23371745 24432677 25021929 25327546 26287497 26610869 27767990 

result:

ok single line: '18193769 19486016 21425356 233...546 26287497 26610869 27767990 '

Test #148:

score: 0
Accepted
time: 471ms
memory: 133800kb

input:

100000 10
28104 28098 28100 28102 28110 28112 28106 28108 28118 28120 28114 28116 28124 28126 28128 28122 28130 28132 28134 28136 28139 28141 28143 28137 28147 28149 28151 28145 28154 28156 28158 28160 28166 28168 28162 28164 28169 28171 28173 28175 28183 28177 28179 28181 28192 28186 28188 28190 28...

output:

3195221624 7587000584 6470164393 2378828704 355101811 13629718 153166 0 0 0 

result:

ok single line: '3195221624 7587000584 64701643...55101811 13629718 153166 0 0 0 '

Test #149:

score: 0
Accepted
time: 484ms
memory: 129708kb

input:

100000 10
134152 134154 134156 134158 134160 134142 134144 134146 134148 134150 134177 134179 134161 134163 134165 134167 134169 134171 134173 134175 134183 134185 134187 134189 134191 134193 134195 134197 134199 134181 134220 134202 134204 134206 134208 134210 134212 134214 134216 134218 134234 134...

output:

974186385 2792705117 4848179792 5217433849 3812252474 1809152922 482483581 60651828 3024229 29739 

result:

ok single line: '974186385 2792705117 484817979...2483581 60651828 3024229 29739 '

Test #150:

score: 0
Accepted
time: 511ms
memory: 128364kb

input:

100000 10
16650 16622 16618 16620 16632 16640 16628 16648 16636 16602 16646 16644 16624 16604 16680 16670 16696 16672 16662 16676 16666 16688 16652 16700 16694 16668 16690 16654 16674 16684 16692 16682 16664 16658 16698 16686 16678 16660 16656 16726 16738 16718 16714 16716 16710 16712 16730 16734 16...

output:

395921559 794673536 1303868858 2025008847 2742620741 3057529581 2935535604 2567984793 1992111403 1271704869 

result:

ok single line: '395921559 794673536 1303868858...67984793 1992111403 1271704869 '

Test #151:

score: 0
Accepted
time: 511ms
memory: 128628kb

input:

99856 10
63047 62769 62627 62957 62621 63065 63139 62783 62985 62667 63013 63069 63137 63115 62739 62711 62853 62907 62805 62591 62921 62913 62681 62725 62889 63055 62879 62927 63101 63119 62601 62835 62617 62707 62593 63017 62747 62781 62935 62597 63125 62811 62919 62585 63063 62777 63161 62959 626...

output:

44327040 52627769 61082940 66710302 70556341 73191609 77303317 80702097 84203428 87775753 

result:

ok single line: '44327040 52627769 61082940 667...317 80702097 84203428 87775753 '

Test #152:

score: 0
Accepted
time: 512ms
memory: 127908kb

input:

100000 10
186979 186984 186985 186988 186987 186989 187024 187031 187036 187033 187038 187037 187026 187030 187027 187045 187044 187046 187048 187360 187355 187359 187356 187351 187322 187324 187326 187328 187337 187335 187331 187329 187330 187345 187342 187344 187348 187339 187349 187171 187179 187...

output:

1209756 5426608 21513293 76148214 228868571 570824672 1174813288 1997628189 2812720029 3294069016 

result:

ok single line: '1209756 5426608 21513293 76148...97628189 2812720029 3294069016 '

Test #153:

score: 0
Accepted
time: 519ms
memory: 129108kb

input:

100000 10
170687 170688 170695 170742 170740 170746 170744 170745 170642 170639 170634 170635 170636 170644 170631 170630 170632 170648 170653 170650 170656 170654 170649 170623 170614 170618 170612 170615 170625 170608 170619 170613 170611 170841 170844 170835 170842 170831 170838 170840 171217 171...

output:

949432 4433618 18020348 62990102 183828222 444420077 895346091 1518121018 2190148323 2716069032 

result:

ok single line: '949432 4433618 18020348 629901...18121018 2190148323 2716069032 '

Test #154:

score: 0
Accepted
time: 546ms
memory: 126668kb

input:

100000 10
172409 172406 172386 172411 172389 172415 172396 172408 172407 172387 172399 172391 172397 172385 172425 172424 172395 172420 172400 172427 172434 172435 172445 172443 172437 172432 172428 172433 172446 172439 172457 172463 172464 172455 172456 172452 172449 172450 172501 172504 172500 172...

output:

702474 2838173 10007054 30692622 79271270 172712742 323537997 532179560 783619058 1051490541 

result:

ok single line: '702474 2838173 10007054 306926...532179560 783619058 1051490541 '

Test #155:

score: 0
Accepted
time: 512ms
memory: 126484kb

input:

100000 10
67138 67110 66985 66816 67099 66952 66640 67102 66512 67019 66609 66622 67092 67133 67135 66730 66684 66943 67043 66732 67085 67114 66668 67145 66605 66555 66519 66558 66726 67069 66893 66760 66921 66945 66983 66683 66643 66515 66600 66915 66750 67088 66797 66936 66534 66550 66727 66982 66...

output:

491104 1473112 3805969 8394170 15791424 24529943 32190338 37546313 41117562 43947654 

result:

ok single line: '491104 1473112 3805969 8394170...338 37546313 41117562 43947654 '

Test #156:

score: 0
Accepted
time: 447ms
memory: 133144kb

input:

100000 10
6535 6538 6539 6542 6543 6546 6547 6550 6551 6554 6555 6558 6559 6562 6563 6566 6567 6570 6571 6574 6575 6578 6579 6582 6583 6586 6587 6590 6591 6594 6595 6598 6599 6602 6603 6606 6607 6610 6611 6614 6615 6618 6619 6622 6623 6626 6627 6630 6631 6634 6635 6638 6639 6642 6643 6646 6647 6650 ...

output:

20000100000 0 0 0 0 0 0 0 0 0 

result:

ok single line: '20000100000 0 0 0 0 0 0 0 0 0 '

Test #157:

score: 0
Accepted
time: 464ms
memory: 131096kb

input:

100000 2
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

10000100005 9999899999 

result:

ok single line: '10000100005 9999899999 '

Test #158:

score: 0
Accepted
time: 462ms
memory: 131312kb

input:

100000 3
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

9999900005 399998 9999700001 

result:

ok single line: '9999900005 399998 9999700001 '

Test #159:

score: 0
Accepted
time: 468ms
memory: 131156kb

input:

100000 4
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

9999700010 399995 399996 9999500005 

result:

ok single line: '9999700010 399995 399996 9999500005 '

Test #160:

score: 0
Accepted
time: 452ms
memory: 130264kb

input:

100000 5
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

9999500015 399993 399993 399994 9999300011 

result:

ok single line: '9999500015 399993 399993 399994 9999300011 '

Test #161:

score: 0
Accepted
time: 458ms
memory: 130756kb

input:

100000 6
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

9999300024 399991 399991 399991 399992 9999100019 

result:

ok single line: '9999300024 399991 399991 399991 399992 9999100019 '

Test #162:

score: 0
Accepted
time: 463ms
memory: 131156kb

input:

100000 7
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

9999100033 399989 399989 399989 399989 399990 9998900029 

result:

ok single line: '9999100033 399989 399989 399989 399989 399990 9998900029 '

Test #163:

score: 0
Accepted
time: 462ms
memory: 132280kb

input:

100000 8
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

9998900046 399987 399987 399987 399987 399987 399988 9998700041 

result:

ok single line: '9998900046 399987 399987 399987 399987 399987 399988 9998700041 '

Test #164:

score: 0
Accepted
time: 458ms
memory: 131148kb

input:

100000 9
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 1...

output:

9998700059 399985 399985 399985 399985 399985 399985 399986 9998500055 

result:

ok single line: '9998700059 399985 399985 39998...99985 399985 399986 9998500055 '

Test #165:

score: 0
Accepted
time: 444ms
memory: 131212kb

input:

100000 10
1 4 5 8 9 12 13 16 17 20 21 24 25 28 29 32 33 36 37 40 41 44 45 48 49 52 53 56 57 60 61 64 65 68 69 72 73 76 77 80 81 84 85 88 89 92 93 96 97 100 101 104 105 108 109 112 113 116 117 120 121 124 125 128 129 132 133 136 137 140 141 144 145 148 149 152 153 156 157 160 161 164 165 168 169 172 ...

output:

9998500076 399983 399983 399983 399983 399983 399983 399983 399984 9998300071 

result:

ok single line: '9998500076 399983 399983 39998...99983 399983 399984 9998300071 '

Extra Test:

score: 0
Extra Test Passed