QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#96027#6301. Minimum Suffixpsc233AC ✓335ms51028kbC++141.7kb2023-04-12 22:09:192023-04-12 22:09:21

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-12 22:09:21]
  • 评测
  • 测评结果:AC
  • 用时:335ms
  • 内存:51028kb
  • [2023-04-12 22:09:19]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int MAXN=2e5+10;
template <typename _Tp>
inline _Tp read(_Tp &x) {
	char ch = getchar(), sgn = 0; x = 0;
	while (ch ^ '-' && !isdigit(ch)) ch = getchar();
	if (ch == '-') ch = getchar(), sgn = 1;
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
	if (sgn) x = -x;
	return x;
}
const int N=3e6+10;
int p[N],a[N],b[N],ans[N],s[N];
int n,T,len,flag;
void solve(int l,int r){
	int k=l;
	if (p[l]!=l){
		flag=0; return;
	}
	for (int i=l+1;i<=r;i++) 
	if (p[i]==l){
		a[i]=k;
		b[i]=1;
		k=l;
	}else{
		if (p[i]<l) {flag=0;return;}
		if ((i-p[i])!=(k-p[k])) {flag=0;return;}
		a[i]=k;
		b[i]=0;
		k++;
	}
	a[l]=l; b[l]=1;
	ans[l]=(len?s[1]:1);
	bool OK=0;
	for (int i=l+1;i<=r;i++){
		if (i-l+1>len||OK){
			if (b[i]) ans[i]=ans[a[i]]+1; else ans[i]=ans[a[i]];
		}else{
			if (b[i]){
				ans[i]=ans[a[i]]+1;
				if (ans[i]>s[i-l+1]) OK=1;
				else if (ans[i]<s[i-l+1]){
					ans[i]=s[i-l+1];
				}
			}else{
				ans[i]=ans[a[i]];
				if (ans[i]>s[i-l+1]) OK=1;
				else if (ans[i]<s[i-l+1]){
					for (int j=i-1;j>=l;j--) if (b[j]){
						ans[j]++;
						i=j; OK=1; break;
					}
				}
			}
		}
	}
	if ((r-l+1<len)&&!OK){
		for (int j=r;j>=l;j--) if (b[j]){
			ans[j]++;
			for (int k=j+1;k<=r;k++) if (b[k]) ans[k]=ans[a[k]]+1; else ans[k]=ans[a[k]];
			break;
		}
	}
	for (int i=l;i<=r;i++) s[i-l+1]=ans[i];
	len=r-l+1;
}
int main(){
	scanf("%d",&T);
	while (T--){
		scanf("%d",&n);
		flag=1;
		for (int i=1;i<=n;i++) read(p[i]);
		len=0;
		int t=n;
		while (t){
			solve(p[t],t);
			if (!flag) break;
			t=p[t]-1;
		}
		if (flag){
			for (int i=1;i<=n;i++) printf("%d ",ans[i]);
			putchar('\n');
		}else puts("-1");
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 4ms
memory: 11760kb

input:

6
3
1 1 1
3
1 1 2
3
1 1 3
3
1 2 1
3
1 2 2
3
1 2 3

output:

1 2 2 
-1
1 2 1 
1 1 2 
2 1 2 
1 1 1 

result:

ok 16 numbers

Test #2:

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

input:

2
2
1 1
2
1 2

output:

1 2 
1 1 

result:

ok 4 number(s): "1 2 1 1"

Test #3:

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

input:

24
4
1 1 1 1
4
1 1 1 2
4
1 1 1 3
4
1 1 1 4
4
1 1 2 1
4
1 1 2 2
4
1 1 2 3
4
1 1 2 4
4
1 1 3 1
4
1 1 3 2
4
1 1 3 3
4
1 1 3 4
4
1 2 1 1
4
1 2 1 2
4
1 2 1 3
4
1 2 1 4
4
1 2 2 1
4
1 2 2 2
4
1 2 2 3
4
1 2 2 4
4
1 2 3 1
4
1 2 3 2
4
1 2 3 3
4
1 2 3 4

output:

1 2 2 2 
-1
-1
1 2 2 1 
-1
-1
-1
-1
1 2 1 3 
-1
1 2 1 2 
1 2 1 1 
1 1 2 2 
-1
-1
1 1 2 1 
-1
2 1 2 2 
-1
2 1 2 1 
1 1 1 2 
2 1 1 2 
2 2 1 2 
1 1 1 1 

result:

ok 63 numbers

Test #4:

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

input:

120
5
1 1 1 1 1
5
1 1 1 1 2
5
1 1 1 1 3
5
1 1 1 1 4
5
1 1 1 1 5
5
1 1 1 2 1
5
1 1 1 2 2
5
1 1 1 2 3
5
1 1 1 2 4
5
1 1 1 2 5
5
1 1 1 3 1
5
1 1 1 3 2
5
1 1 1 3 3
5
1 1 1 3 4
5
1 1 1 3 5
5
1 1 1 4 1
5
1 1 1 4 2
5
1 1 1 4 3
5
1 1 1 4 4
5
1 1 1 4 5
5
1 1 2 1 1
5
1 1 2 1 2
5
1 1 2 1 3
5
1 1 2 1 4
5
1 1 2 ...

output:

1 2 2 2 2 
-1
-1
-1
1 2 2 2 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1 2 2 1 3 
-1
-1
1 2 2 1 2 
1 2 2 1 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1 2 1 3 2 
-1
-1
-1
1 2 1 3 1 
-1
-1
-1
-1
-1
1 2 1 2 2 
-1
1 3 1 2 2 
-1
1 2 1 2 1 
-1
-1
1 2 1 1 2 
2 3 2 1 2 
1 2 1 1 1 
1 1 2 2 2 
-1
-1...

result:

ok 256 numbers

Test #5:

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

input:

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

output:

1 2 2 2 2 2 
-1
-1
-1
-1
1 2 2 2 2 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1 2 2 2 1 3 
-1
-1
-1
1 2 2 2 1 2 
1 2 2 2 1 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-...

result:

ok 1165 numbers

Test #6:

score: 0
Accepted
time: 5ms
memory: 11756kb

input:

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

output:

1 2 2 2 2 2 2 
-1
-1
-1
-1
-1
1 2 2 2 2 2 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1 2 2 2 2 1 3 
-1
-1
-1
-1
1 2 2 2 2 1 2 
1 2 2 2 2 1 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 6438 numbers

Test #7:

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

input:

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

output:

1 2 2 2 2 2 2 2 
-1
-1
-1
-1
-1
-1
1 2 2 2 2 2 2 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1 2 2 2 2 2 1 3 
-1
-1
-1
-1
-1
1 2 2 2 2 2 1 2 
1 2 2 2 2 2 1 1 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1...

result:

ok 44590 numbers

Test #8:

score: 0
Accepted
time: 2ms
memory: 11756kb

input:

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

output:

1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 1 2 
2 2 2 2 2 2 1 1 2 
2 2 2 2 2 1 1 1 2 
2 2 2 2 1 1 1 1 2 
2 2 2 1 1 1 1 1 2 
2 2 1 1 1 1 1 1 2 
2 1 1 1 1 1 1 1 2 
1 1 1 1 1 1 1 1 2 
2 2 2 2 2 2 1 2 1 
2 2 2 2 2 2 1 2 2 
-1
-1
-1
-1
-1
-1
2 2 2 2 2 1 1 2 1 
2 2 2 2 2 1 1 2 2 
-1
-1
-1
-1
-1
2 2 2 2 1 1 1 2 1 
2...

result:

ok 17638 numbers

Test #9:

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

input:

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

output:

1 1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 2 1 2 
2 2 2 2 2 2 2 1 1 2 
2 2 2 2 2 2 1 1 1 2 
2 2 2 2 2 1 1 1 1 2 
2 2 2 2 1 1 1 1 1 2 
2 2 2 1 1 1 1 1 1 2 
2 2 1 1 1 1 1 1 1 2 
2 1 1 1 1 1 1 1 1 2 
1 1 1 1 1 1 1 1 1 2 
2 2 2 2 2 2 2 1 2 1 
2 2 2 2 2 2 2 1 2 2 
-1
-1
-1
-1
-1
-1
-1
2 2 2 2 2 2 1 1 2 1 
2 2 2 ...

result:

ok 54425 numbers

Test #10:

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

input:

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

output:

1 1 1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 2 2 1 2 
2 2 2 2 2 2 2 2 1 1 2 
2 2 2 2 2 2 2 1 1 1 2 
2 2 2 2 2 2 1 1 1 1 2 
2 2 2 2 2 1 1 1 1 1 2 
2 2 2 2 1 1 1 1 1 1 2 
2 2 2 1 1 1 1 1 1 1 2 
2 2 1 1 1 1 1 1 1 1 2 
2 1 1 1 1 1 1 1 1 1 2 
1 1 1 1 1 1 1 1 1 1 2 
2 2 2 2 2 2 2 2 1 2 1 
2 2 2 2 2 2 2 2 1 2 2 
-...

result:

ok 168246 numbers

Test #11:

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

input:

100000
12
1 2 3 4 5 6 7 8 9 10 11 12
12
1 2 3 4 5 6 7 8 9 10 11 11
12
1 2 3 4 5 6 7 8 9 10 11 10
12
1 2 3 4 5 6 7 8 9 10 11 9
12
1 2 3 4 5 6 7 8 9 10 11 8
12
1 2 3 4 5 6 7 8 9 10 11 7
12
1 2 3 4 5 6 7 8 9 10 11 6
12
1 2 3 4 5 6 7 8 9 10 11 5
12
1 2 3 4 5 6 7 8 9 10 11 4
12
1 2 3 4 5 6 7 8 9 10 11 3
...

output:

1 1 1 1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 2 2 2 1 2 
2 2 2 2 2 2 2 2 2 1 1 2 
2 2 2 2 2 2 2 2 1 1 1 2 
2 2 2 2 2 2 2 1 1 1 1 2 
2 2 2 2 2 2 1 1 1 1 1 2 
2 2 2 2 2 1 1 1 1 1 1 2 
2 2 2 2 1 1 1 1 1 1 1 2 
2 2 2 1 1 1 1 1 1 1 1 2 
2 2 1 1 1 1 1 1 1 1 1 2 
2 1 1 1 1 1 1 1 1 1 1 2 
1 1 1 1 1 1 1 1 1 1 1 2 
...

result:

ok 211133 numbers

Test #12:

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

input:

100000
12
1 2 2 4 5 5 2 8 1 1 11 11
12
1 2 2 4 5 5 2 8 1 1 11 1
12
1 2 2 4 5 5 2 8 1 1 1 12
12
1 2 2 4 5 5 2 8 1 1 1 1
12
1 2 2 4 5 5 2 2 9 10 11 12
12
1 2 2 4 5 5 2 2 9 10 11 11
12
1 2 2 4 5 5 2 2 9 10 11 10
12
1 2 2 4 5 5 2 2 9 10 11 9
12
1 2 2 4 5 5 2 2 9 10 11 2
12
1 2 2 4 5 5 2 2 9 10 11 1
12
1...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 272700 numbers

Test #13:

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

input:

8012
12
1 1 1 4 4 6 4 8 4 4 11 4
12
1 1 1 4 4 6 4 8 4 4 11 1
12
1 1 1 4 4 6 4 8 4 4 4 12
12
1 1 1 4 4 6 4 8 4 4 4 4
12
1 1 1 4 4 6 4 8 4 4 4 1
12
1 1 1 4 4 6 4 8 4 4 1 12
12
1 1 1 4 4 6 4 8 4 4 1 1
12
1 1 1 4 4 6 4 8 4 1 11 12
12
1 1 1 4 4 6 4 8 4 1 11 11
12
1 1 1 4 4 6 4 8 4 1 11 1
12
1 1 1 4 4 6 4...

output:

1 2 2 1 2 1 3 1 3 2 1 3 
-1
1 2 2 1 2 1 3 1 3 2 2 1 
1 2 2 1 2 1 3 1 3 2 2 2 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
1 2 2 1 2 1 3 2 1 1 1 1 
2 3 3 2 3 2 4 3 2 2 1 2 
2 3 3 2 3 2 4 3 2 1 1 2 
1 2 2 1 2 1 3 2 1 1 1 2 
-1
-1
2 3 3 2 3 2 4 3 2 1 2 1 
2 3 3 2 3 2 4 3 2 1 2 2 
...

result:

ok 39406 numbers

Test #14:

score: 0
Accepted
time: 24ms
memory: 11792kb

input:

100000
13
1 2 3 4 5 6 7 8 9 10 11 12 13
13
1 2 3 4 5 6 7 8 9 10 11 12 12
13
1 2 3 4 5 6 7 8 9 10 11 12 11
13
1 2 3 4 5 6 7 8 9 10 11 12 10
13
1 2 3 4 5 6 7 8 9 10 11 12 9
13
1 2 3 4 5 6 7 8 9 10 11 12 8
13
1 2 3 4 5 6 7 8 9 10 11 12 7
13
1 2 3 4 5 6 7 8 9 10 11 12 6
13
1 2 3 4 5 6 7 8 9 10 11 12 5
1...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 
2 2 2 2 2 2 2 2 2 2 2 1 2 
2 2 2 2 2 2 2 2 2 2 1 1 2 
2 2 2 2 2 2 2 2 2 1 1 1 2 
2 2 2 2 2 2 2 2 1 1 1 1 2 
2 2 2 2 2 2 2 1 1 1 1 1 2 
2 2 2 2 2 2 1 1 1 1 1 1 2 
2 2 2 2 2 1 1 1 1 1 1 1 2 
2 2 2 2 1 1 1 1 1 1 1 1 2 
2 2 2 1 1 1 1 1 1 1 1 1 2 
2 2 1 1 1 1 1 1 1 1 1 1 2 
2 1...

result:

ok 173800 numbers

Test #15:

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

input:

100000
13
1 2 3 4 4 6 6 6 9 9 11 3 1
13
1 2 3 4 4 6 6 6 9 9 11 2 13
13
1 2 3 4 4 6 6 6 9 9 11 2 2
13
1 2 3 4 4 6 6 6 9 9 11 2 1
13
1 2 3 4 4 6 6 6 9 9 11 1 13
13
1 2 3 4 4 6 6 6 9 9 11 1 1
13
1 2 3 4 4 6 6 6 9 9 9 12 13
13
1 2 3 4 4 6 6 6 9 9 9 12 12
13
1 2 3 4 4 6 6 6 9 9 9 12 9
13
1 2 3 4 4 6 6 6 ...

output:

-1
-1
-1
-1
-1
-1
2 2 2 1 3 1 2 2 1 2 2 1 1 
2 2 2 1 3 1 2 2 1 2 2 1 2 
2 2 2 1 3 1 2 3 1 2 2 1 3 
2 2 2 1 3 1 2 2 1 2 2 1 3 
-1
-1
-1
-1
2 2 2 1 3 1 2 3 1 2 2 2 1 
2 2 2 1 3 1 2 3 1 2 2 2 2 
-1
-1
-1
-1
-1
2 2 2 1 3 1 2 2 1 2 2 2 1 
2 2 2 1 3 1 2 2 1 2 2 2 2 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 181240 numbers

Test #16:

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

input:

100000
13
1 2 3 3 5 6 2 8 2 1 11 1 1
13
1 2 3 3 5 6 2 8 2 1 1 12 13
13
1 2 3 3 5 6 2 8 2 1 1 12 12
13
1 2 3 3 5 6 2 8 2 1 1 12 1
13
1 2 3 3 5 6 2 8 2 1 1 1 13
13
1 2 3 3 5 6 2 8 2 1 1 1 1
13
1 2 3 3 5 6 2 8 1 10 11 12 13
13
1 2 3 3 5 6 2 8 1 10 11 12 12
13
1 2 3 3 5 6 2 8 1 10 11 12 11
13
1 2 3 3 5 ...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 181180 numbers

Test #17:

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

input:

100000
13
1 2 3 2 2 6 1 8 9 10 1 1 13
13
1 2 3 2 2 6 1 8 9 10 1 1 1
13
1 2 3 2 2 6 1 8 9 9 11 12 13
13
1 2 3 2 2 6 1 8 9 9 11 12 12
13
1 2 3 2 2 6 1 8 9 9 11 12 11
13
1 2 3 2 2 6 1 8 9 9 11 12 9
13
1 2 3 2 2 6 1 8 9 9 11 12 8
13
1 2 3 2 2 6 1 8 9 9 11 12 1
13
1 2 3 2 2 6 1 8 9 9 11 11 13
13
1 2 3 2 ...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 219508 numbers

Test #18:

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

input:

100000
13
1 2 2 4 4 1 7 1 9 10 9 1 13
13
1 2 2 4 4 1 7 1 9 10 9 1 1
13
1 2 2 4 4 1 7 1 9 10 1 12 13
13
1 2 2 4 4 1 7 1 9 10 1 12 12
13
1 2 2 4 4 1 7 1 9 10 1 12 1
13
1 2 2 4 4 1 7 1 9 10 1 1 13
13
1 2 2 4 4 1 7 1 9 10 1 1 1
13
1 2 2 4 4 1 7 1 9 9 11 12 13
13
1 2 2 4 4 1 7 1 9 9 11 12 12
13
1 2 2 4 4...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 205408 numbers

Test #19:

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

input:

100000
13
1 2 1 4 5 1 7 8 9 9 11 7 1
13
1 2 1 4 5 1 7 8 9 9 11 1 13
13
1 2 1 4 5 1 7 8 9 9 11 1 1
13
1 2 1 4 5 1 7 8 9 9 9 12 13
13
1 2 1 4 5 1 7 8 9 9 9 12 12
13
1 2 1 4 5 1 7 8 9 9 9 12 9
13
1 2 1 4 5 1 7 8 9 9 9 12 8
13
1 2 1 4 5 1 7 8 9 9 9 12 7
13
1 2 1 4 5 1 7 8 9 9 9 12 1
13
1 2 1 4 5 1 7 8 9...

output:

-1
-1
-1
2 2 3 2 2 4 2 2 1 2 2 1 1 
2 2 3 2 2 4 2 2 1 2 2 1 2 
2 2 3 2 2 4 2 2 1 2 2 1 3 
-1
-1
-1
2 2 3 2 2 4 2 2 1 2 2 2 1 
2 2 3 2 2 4 2 2 1 2 2 2 2 
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2 2 3 2 2 4 2 1 1 2 1 1 1 
...

result:

ok 254500 numbers

Test #20:

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

input:

100000
13
1 1 3 4 4 4 7 3 3 10 10 10 10
13
1 1 3 4 4 4 7 3 3 10 10 10 3
13
1 1 3 4 4 4 7 3 3 10 10 10 1
13
1 1 3 4 4 4 7 3 3 10 10 3 13
13
1 1 3 4 4 4 7 3 3 10 10 3 3
13
1 1 3 4 4 4 7 3 3 10 10 3 1
13
1 1 3 4 4 4 7 3 3 10 10 1 13
13
1 1 3 4 4 4 7 3 3 10 10 1 1
13
1 1 3 4 4 4 7 3 3 10 3 12 13
13
1 1 ...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
...

result:

ok 273136 numbers

Test #21:

score: 0
Accepted
time: 23ms
memory: 11756kb

input:

42900
13
1 1 1 4 5 5 7 7 1 1 11 12 12
13
1 1 1 4 5 5 7 7 1 1 11 12 11
13
1 1 1 4 5 5 7 7 1 1 11 12 1
13
1 1 1 4 5 5 7 7 1 1 11 11 13
13
1 1 1 4 5 5 7 7 1 1 11 11 11
13
1 1 1 4 5 5 7 7 1 1 11 11 1
13
1 1 1 4 5 5 7 7 1 1 11 1 13
13
1 1 1 4 5 5 7 7 1 1 11 1 1
13
1 1 1 4 5 5 7 7 1 1 1 12 13
13
1 1 1 4 5...

output:

-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
2 3 3 2 1 2 1 3 1 1 1 1 1 
3 4 4 3 2 3 2 4 2 2 2 1 2 
3 4 4 3 2 3 2 4 2 2 1 1 2 
3 4 4 3 2 3 2 4 2 1 1 1 2 
2 3 3 2 1 2 1 3 1 1 1 1 2 
-1
-1
-1
3 4 4 3 2 3 2 4 2 2 1 2 1 
3 4 4 3 2 3 2 4 2 2 1 2 2 
-1
-1
-1
-1
-1
3 4 4 3 2 3 2 4 2 1 1 2 1 
3 4 4 3 2 3 2 4 2 1 1...

result:

ok 154428 numbers

Test #22:

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

input:

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

output:

1 1 1 2 2 1 1 1 1 1 2 1 1 2 1 
1 2 1 1 1 1 1 1 2 1 2 1 2 2 1 
1 2 1 2 1 2 2 1 1 2 1 1 1 1 1 
1 1 2 2 2 2 1 1 2 2 1 1 1 1 2 
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
1 2 2 1 1 2 2 1 2 1 2 1 1 2 1 
2 2 1 2 1 2 2 1 1 1 1 2 1 1 1 
2 1 1 2 2 1 1 1 1 2 2 1 1 1 2 
1 2 1 2 2 1 2 2 2 1 1 2 2 1 2 
2 1 1 1 1 2 2 1 1 1 1...

result:

ok 999990 numbers

Test #23:

score: 0
Accepted
time: 78ms
memory: 11768kb

input:

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

output:

1 2 2 1 1 2 2 1 2 2 1 2 2 2 2 
2 2 2 2 2 2 3 2 2 2 1 1 2 2 1 
1 2 1 1 1 2 1 1 2 1 1 2 2 2 2 
2 1 1 2 2 2 1 2 2 2 2 2 2 2 2 
2 1 2 2 2 1 2 2 1 1 2 1 1 1 2 
1 2 2 1 2 3 2 2 2 1 1 2 2 2 1 
2 2 2 1 2 2 2 2 2 1 2 2 2 1 2 
2 1 2 2 2 2 1 1 2 2 2 2 2 2 2 
1 1 2 2 1 2 2 2 2 2 1 1 1 2 2 
1 1 1 2 1 2 1 2 2 2 1...

result:

ok 999990 numbers

Test #24:

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

input:

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

output:

1 1 1 1 1 2 1 2 1 1 1 2 2 1 1 1 
2 1 2 1 2 2 1 2 2 2 1 2 2 1 1 1 
2 1 2 1 2 2 1 1 2 1 1 1 2 2 2 1 
1 1 1 1 2 1 2 2 1 1 1 1 1 1 1 2 
1 2 2 2 1 2 2 1 2 1 1 1 2 2 1 2 
1 1 2 1 2 2 1 2 1 1 1 2 1 2 2 2 
1 1 1 2 1 1 2 1 1 2 2 1 2 2 2 1 
2 2 1 2 2 2 2 2 2 1 1 2 1 2 1 2 
1 2 2 1 2 2 1 1 2 2 1 2 1 1 1 1 
1 1...

result:

ok 1000000 numbers

Test #25:

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

input:

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

output:

2 2 1 2 2 1 1 2 2 2 1 2 2 1 2 2 
1 2 2 1 1 2 1 2 2 2 1 1 2 2 1 2 
2 2 1 1 1 1 2 2 2 1 2 1 2 1 2 1 
1 2 2 1 1 2 1 1 2 1 1 1 2 1 2 1 
2 2 2 2 2 1 2 1 2 2 2 1 3 2 2 1 
2 2 2 2 1 1 2 2 1 2 2 2 2 2 2 2 
2 1 2 2 2 1 2 2 3 2 2 1 1 1 1 1 
2 1 1 1 2 2 2 2 2 1 2 1 2 2 1 1 
2 2 2 2 2 3 3 1 2 1 1 2 1 1 1 2 
2 1...

result:

ok 1000000 numbers

Test #26:

score: 0
Accepted
time: 91ms
memory: 11748kb

input:

58823
17
1 2 3 4 5 3 3 3 3 10 3 3 13 3 15 3 3
17
1 2 3 2 2 6 2 2 2 2 11 2 2 2 15 16 15
17
1 2 1 1 5 6 5 5 1 10 11 12 10 10 10 10 17
17
1 2 3 2 2 2 2 2 9 2 2 2 13 14 15 16 13
17
1 2 3 2 5 6 5 2 9 2 2 2 2 14 15 14 17
17
1 1 1 4 4 4 7 7 7 1 1 12 12 12 1 16 17
17
1 2 1 1 1 6 7 6 6 10 6 6 6 14 6 6 6
17
1...

output:

2 2 1 1 1 2 2 2 2 1 2 2 1 2 1 2 2 
2 1 1 2 2 1 2 2 2 2 1 2 2 2 1 1 2 
1 1 2 2 1 1 2 2 2 1 1 1 2 2 2 2 1 
2 1 1 2 2 2 2 2 1 2 2 2 1 1 1 1 2 
2 1 1 2 1 1 2 2 1 2 2 2 2 1 1 2 1 
1 2 2 1 2 2 1 2 2 2 2 1 2 2 2 1 1 
1 1 2 2 2 1 1 2 2 1 2 2 2 1 2 2 2 
1 2 2 1 1 2 1 2 1 1 2 2 1 1 1 1 1 
1 1 1 2 1 1 2 2 2 1 ...

result:

ok 999991 numbers

Test #27:

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

input:

58823
17
1 2 3 4 2 2 7 2 2 10 2 2 2 14 15 2 17
17
1 2 3 3 3 3 3 8 9 10 8 12 8 8 8 8 8
17
1 2 1 1 5 6 5 5 5 5 11 5 13 5 5 5 5
17
1 2 2 4 4 2 2 2 2 2 2 12 12 14 15 16 14
17
1 2 3 4 3 6 7 8 9 6 6 12 6 6 6 6 6
17
1 1 3 4 5 5 7 7 5 10 10 12 13 12 12 12 12
17
1 2 2 4 4 2 2 2 9 10 11 9 9 9 9 16 9
17
1 2 3 ...

output:

2 1 1 1 2 2 1 2 2 1 2 2 2 1 1 2 1 
2 2 1 2 2 2 2 1 1 1 2 1 2 2 2 2 2 
1 1 2 3 1 1 2 2 2 2 1 2 1 2 2 2 2 
2 1 2 1 2 2 2 2 2 2 2 1 2 1 1 1 2 
2 2 1 1 2 1 1 1 1 2 2 1 2 2 2 2 2 
2 3 2 2 1 2 1 2 2 1 2 1 1 2 2 2 2 
2 1 2 1 2 2 2 2 1 1 1 2 2 2 2 1 2 
2 2 2 1 1 2 2 2 2 1 1 2 2 1 2 2 2 
1 1 1 3 1 1 1 2 2 1 ...

result:

ok 999991 numbers

Test #28:

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

input:

58823
17
1 2 3 2 2 2 2 2 2 2 2 12 2 14 2 2 17
17
1 2 1 1 1 1 1 1 1 1 1 1 1 14 1 1 1
17
1 1 1 4 1 1 1 8 1 1 1 1 1 1 1 1 1
17
1 2 3 3 3 3 3 3 9 10 9 9 13 9 9 9 9
17
1 1 3 3 3 3 3 3 9 9 9 12 13 12 12 12 17
17
1 2 3 3 3 3 3 3 3 3 11 11 11 3 15 15 17
17
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 16 16
17
1 2 3 3 3 3 ...

output:

2 1 1 2 2 2 2 2 2 2 2 1 2 1 2 2 1 
1 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 
1 2 2 1 3 2 2 1 3 2 2 2 2 2 2 2 2 
2 2 1 2 2 2 2 2 1 1 2 2 1 2 2 2 2 
1 3 1 2 2 2 2 2 1 2 2 1 1 2 2 2 1 
2 2 1 2 2 2 2 2 2 2 1 2 2 3 1 2 1 
2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 
2 2 1 2 2 2 2 3 1 2 2 2 2 2 2 2 2 
1 2 2 2 1 3 2 1 1 2 ...

result:

ok 999991 numbers

Test #29:

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

input:

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

output:

1 2 2 2 2 1 1 1 1 2 1 2 2 1 2 2 2 2 
2 1 2 1 1 1 1 2 1 2 1 2 2 2 2 2 2 2 
1 1 2 2 1 1 1 2 2 2 1 1 1 2 2 1 2 2 
2 2 2 2 1 2 1 1 1 1 1 2 1 2 2 2 2 2 
1 1 1 2 1 2 2 1 2 1 1 2 1 1 1 2 2 2 
1 1 1 2 1 2 2 2 2 1 2 1 2 1 1 2 1 1 
1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 1 1 
1 1 1 2 1 1 1 2 2 2 1 1 1 1 2 2 1 2 
1 2 ...

result:

ok 999990 numbers

Test #30:

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

input:

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

output:

2 3 3 2 2 3 2 1 2 2 1 3 1 1 2 2 2 2 
1 2 1 2 1 1 2 2 2 2 2 2 2 2 1 1 1 2 
1 2 2 1 1 1 3 1 1 1 2 1 1 2 2 2 2 2 
2 1 1 1 2 2 1 2 2 1 1 2 2 2 1 2 1 1 
2 1 1 2 2 2 1 1 3 1 1 2 2 3 2 2 1 1 
2 2 1 1 1 2 1 1 1 3 1 2 2 2 2 2 1 2 
1 1 2 1 2 2 1 2 2 2 2 2 2 1 2 2 2 2 
2 1 3 1 2 2 2 1 2 2 2 1 1 2 1 2 2 2 
1 1 ...

result:

ok 999990 numbers

Test #31:

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

input:

55555
18
1 1 1 4 4 6 7 6 6 6 6 6 13 6 15 6 17 6
18
1 2 2 2 2 2 7 7 9 7 7 12 12 7 15 16 15 15
18
1 2 2 2 5 5 5 5 5 10 10 12 10 14 15 14 14 14
18
1 2 2 2 5 5 5 5 5 5 5 5 5 14 14 14 14 18
18
1 1 1 1 5 5 5 5 5 5 5 5 13 5 15 5 17 5
18
1 1 3 3 1 1 1 8 8 1 1 12 1 1 1 1 1 1
18
1 1 3 4 4 4 7 7 4 4 4 4 4 4 4 ...

output:

1 2 2 1 2 1 1 2 2 2 2 2 1 2 1 2 1 2 
2 1 2 2 2 2 1 2 1 3 2 1 2 2 1 1 2 2 
2 1 2 3 1 2 2 2 2 1 2 1 3 1 1 2 2 2 
2 1 2 3 1 2 2 2 2 2 2 2 2 1 2 2 2 1 
1 2 2 3 1 2 2 2 2 2 2 2 1 3 1 3 1 3 
1 2 1 2 2 2 2 1 2 2 2 1 3 2 2 2 2 2 
2 3 2 1 2 2 1 2 3 2 2 2 2 2 2 2 2 2 
3 2 3 3 3 2 1 1 2 2 2 2 2 2 2 2 1 2 
2 2 ...

result:

ok 999990 numbers

Test #32:

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

input:

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

output:

2 2 2 2 1 2 1 2 1 2 2 1 1 2 2 2 1 1 2 
1 1 1 2 1 1 2 1 2 1 1 1 2 1 1 2 1 1 2 
2 1 2 1 1 2 1 1 1 1 2 1 1 2 2 2 2 2 1 
1 1 2 2 1 2 2 2 2 2 2 1 1 1 2 2 1 1 2 
1 2 1 2 1 2 2 1 2 1 2 1 2 2 1 2 1 2 2 
2 2 2 2 1 2 2 2 1 2 2 2 1 1 1 1 2 1 2 
1 2 2 2 1 1 1 2 1 2 1 2 1 1 1 2 1 1 1 
2 2 1 2 2 2 1 2 1 1 1 2 2 1...

result:

ok 999989 numbers

Test #33:

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

input:

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

output:

2 2 1 3 2 2 2 2 2 1 3 1 2 2 2 2 2 1 1 
1 1 1 2 1 2 2 2 2 1 2 1 1 2 1 2 2 1 2 
2 1 1 1 2 2 1 2 1 2 2 2 1 1 2 1 2 2 1 
2 1 2 1 1 1 2 2 1 1 2 2 2 2 1 2 2 2 2 
1 1 1 2 2 1 2 2 2 2 1 1 1 2 1 2 2 2 2 
1 2 3 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 
1 1 2 2 1 1 1 2 1 2 2 1 2 2 2 1 2 2 2 
1 1 2 2 2 3 1 1 2 2 2 2 1 2...

result:

ok 999989 numbers

Test #34:

score: 0
Accepted
time: 82ms
memory: 11796kb

input:

52631
19
1 2 3 4 2 6 2 2 2 10 11 2 2 2 2 2 2 2 2
19
1 2 2 2 2 6 6 8 8 8 8 8 13 8 8 8 8 8 8
19
1 1 1 1 1 6 6 6 1 10 10 10 10 14 15 14 14 14 14
19
1 2 2 2 2 2 2 2 9 9 9 12 13 12 15 12 12 12 12
19
1 1 1 1 1 1 7 8 7 7 7 7 13 7 7 16 7 7 19
19
1 1 1 1 5 5 7 7 9 10 9 9 9 9 9 9 9 9 19
19
1 1 1 1 1 1 1 1 1 1...

output:

2 1 1 1 2 1 2 2 2 1 1 2 2 2 2 2 2 2 2 
2 1 3 2 2 1 3 1 2 2 2 2 1 3 2 2 2 2 2 
1 2 2 2 2 1 2 2 3 1 2 2 2 1 1 2 2 2 2 
2 1 2 2 2 2 2 2 1 2 2 1 1 2 1 2 2 2 2 
1 2 2 2 2 2 1 1 2 2 2 2 1 2 2 1 2 2 1 
1 2 2 2 1 2 1 2 1 1 2 2 2 2 2 2 2 2 1 
1 2 2 2 2 2 2 2 2 2 1 1 2 2 1 2 2 2 2 
2 2 3 3 1 3 1 3 2 1 2 2 2 2...

result:

ok 999989 numbers

Test #35:

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

input:

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

output:

1 2 1 2 1 1 1 2 1 1 1 2 1 1 2 1 1 1 2 2 
1 1 2 1 2 1 1 1 2 1 2 1 1 1 2 2 1 2 1 2 
1 1 1 2 2 1 2 2 1 2 2 2 2 2 2 1 1 1 1 2 
2 1 1 1 1 2 2 2 2 1 2 1 2 2 2 1 2 2 2 1 
1 2 1 2 2 2 1 2 1 1 1 2 2 2 1 2 1 2 1 1 
1 1 1 2 2 2 1 1 1 1 2 2 2 1 1 1 2 1 1 1 
1 2 1 1 1 2 2 1 1 2 1 1 2 1 2 1 1 1 2 2 
1 1 1 1 1 1 2...

result:

ok 1000000 numbers

Test #36:

score: 0
Accepted
time: 76ms
memory: 11796kb

input:

50000
20
1 2 3 4 5 3 3 3 3 3 11 12 3 3 3 3 3 3 3 3
20
1 2 3 3 5 5 7 8 7 10 7 7 7 14 15 14 7 7 7 20
20
1 2 1 1 5 6 5 8 5 10 5 5 5 5 5 5 5 18 19 5
20
1 2 3 2 5 2 7 8 7 10 11 7 7 14 7 7 7 7 19 7
20
1 2 2 2 2 2 7 7 9 9 7 7 7 7 15 7 7 7 7 7
20
1 2 3 4 5 2 2 2 2 2 2 12 2 2 15 2 2 2 2 2
20
1 2 3 4 3 3 3 3 ...

output:

2 2 1 1 1 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 
2 2 1 2 1 2 1 1 2 1 2 2 2 1 1 2 2 2 2 1 
1 1 2 2 1 1 2 1 2 1 2 2 2 2 2 2 2 1 1 3 
2 1 1 2 1 2 1 1 2 1 1 3 2 1 2 2 2 2 1 2 
2 1 2 2 2 2 1 2 1 2 2 2 2 2 1 3 2 2 2 2 
2 1 1 1 1 2 2 2 2 2 2 1 2 2 1 2 2 2 2 2 
2 2 1 1 2 2 2 2 2 1 1 2 2 1 1 3 1 2 2 1 
2 2 1 2 1 1 2...

result:

ok 1000000 numbers

Test #37:

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

input:

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

output:

3 3 3 3 2 3 3 3 3 3 2 2 2 3 3 2 2 1 2 2 
3 2 3 3 2 1 1 1 2 2 1 1 1 2 3 2 1 2 2 1 
1 2 2 1 2 1 1 2 1 1 2 2 1 2 2 2 1 2 2 2 
2 3 2 1 2 2 1 2 3 2 1 1 2 2 1 2 2 2 2 1 
1 3 1 2 2 1 1 2 2 2 1 1 1 2 2 2 1 2 2 1 
2 1 1 2 2 2 2 2 2 1 2 2 2 1 2 1 2 2 2 2 
2 1 2 2 2 2 2 2 2 2 1 1 2 1 2 2 1 2 2 2 
2 1 1 1 2 2 1...

result:

ok 1000000 numbers

Test #38:

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

input:

50000
20
1 2 3 4 4 4 4 4 4 10 10 10 13 10 10 10 10 10 10 10
20
1 1 3 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
20
1 1 1 1 5 6 5 8 9 9 9 9 9 9 9 16 17 16 16 16
20
1 1 3 3 3 3 3 3 3 10 3 3 3 14 3 3 3 3 3 3
20
1 2 3 4 5 6 7 8 6 6 11 6 6 14 6 6 6 6 19 6
20
1 2 2 4 4 4 4 8 9 8 8 8 8 8 8 16 8 8 8 8
20
1 1 1 4 5 4...

output:

2 2 2 1 2 2 2 2 2 1 2 2 1 3 2 2 2 2 2 2 
2 3 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 
2 3 3 3 2 2 3 2 1 2 2 2 2 2 2 1 1 2 2 2 
1 3 1 2 2 2 2 2 2 1 3 2 2 1 3 2 2 2 2 2 
2 2 2 2 2 1 1 1 2 2 1 2 2 1 2 2 2 2 1 2 
2 1 3 1 2 2 2 1 1 2 2 2 2 2 2 1 2 2 2 2 
1 2 2 1 1 2 2 2 2 2 2 1 2 2 1 1 1 2 1 2 
2 2 2 3 2 1 2...

result:

ok 1000000 numbers

Test #39:

score: 0
Accepted
time: 298ms
memory: 42492kb

input:

6414
137
1 2 1 1 1 1 1 1 1 1 1 1 1 14 15 14 14 14 14 14 14 14 14 14 14 14 27 28 27 27 27 27 27 27 27 27 27 27 27 40 41 40 40 40 40 40 40 40 40 40 40 40 53 54 53 53 53 53 53 53 53 53 53 53 53 66 67 68 66 66 71 66 66 74 66 66 77 66 79 80 81 82 80 80 85 80 87 88 89 87 87 92 87 94 95 94 94 94 94 94 101 ...

output:

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

result:

ok 3000000 numbers

Test #40:

score: 0
Accepted
time: 260ms
memory: 11756kb

input:

19787
93
1 1 1 4 4 6 4 4 9 10 9 9 9 9 9 9 17 18 17 17 17 17 23 17 25 26 25 25 25 25 31 25 33 34 33 33 33 33 39 33 41 42 43 44 45 46 47 48 49 50 51 52 53 54 54 56 56 54 59 59 61 61 59 64 64 66 66 64 69 69 71 71 73 74 73 76 76 76 76 76 76 76 83 83 85 86 87 85 89 90 89 92 93
5
1 1 1 4 4
52
1 1 3 3 5 5 ...

output:

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

result:

ok 3000000 numbers

Test #41:

score: 0
Accepted
time: 280ms
memory: 48656kb

input:

3279
174
1 2 1 4 1 1 7 1 1 10 1 12 13 12 15 12 17 12 19 12 12 12 23 24 23 26 23 28 23 30 23 23 23 34 35 34 37 34 39 34 41 34 34 34 45 46 45 48 45 50 45 52 45 45 45 56 57 56 59 56 61 56 63 56 56 56 67 68 67 70 67 72 67 74 67 67 67 78 79 78 81 78 78 78 78 78 78 78 78 90 90 90 90 90 90 90 90 98 98 100 ...

output:

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

result:

ok 3000000 numbers

Test #42:

score: 0
Accepted
time: 294ms
memory: 44604kb

input:

1806
66
1 1 1 1 1 6 6 6 6 6 11 11 11 11 11 16 17 18 16 16 21 22 23 21 21 26 26 26 26 30 26 26 26 26 26 26 26 26 26 26 26 26 43 43 43 43 47 43 43 43 43 43 43 43 43 43 43 43 43 60 61 60 63 60 65 65
161
1 2 1 1 1 6 1 8 9 1 1 1 1 1 15 1 1 1 19 20 19 19 19 24 19 26 27 19 19 19 19 19 33 19 19 19 37 38 37 ...

output:

3 4 4 4 4 3 4 4 4 4 3 4 4 4 4 3 3 3 4 4 3 3 3 4 4 2 3 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 2 2 3 2 3 1 2 
2 2 3 3 3 2 3 2 2 4 3 3 3 3 2 3 3 3 2 2 3 3 3 2 3 2 2 4 3 3 3 3 2 3 3 3 2 2 3 3 3 2 3 2 2 4 3 3 3 3 2 3 3 3 2 2 2 3 2 2 3 3 3 2 2 3 3 2 3 3 2 3 2 2 2 3 2 2 3 3 3 2 2 3...

result:

ok 3000000 numbers

Test #43:

score: 0
Accepted
time: 312ms
memory: 48844kb

input:

1514
77
1 1 1 4 4 4 1 8 1 10 10 10 13 13 13 10 17 10 19 19 19 19 23 19 19 19 19 19 19 19 19 19 33 33 33 33 37 33 33 33 33 33 33 33 33 33 47 47 49 49 47 47 47 47 47 47 47 47 47 60 60 62 60 60 60 60 67 60 60 60 60 60 60 74 74 60 77
223
1 1 1 1 1 1 1 1 1 10 1 12 1 1 1 16 17 16 16 16 16 16 16 16 16 16 1...

output:

1 3 3 1 3 3 2 1 4 1 3 3 1 3 3 2 1 4 1 3 2 2 1 4 2 2 2 2 2 2 2 2 1 3 2 2 1 4 2 2 2 2 2 2 2 2 1 3 1 3 2 2 2 2 2 2 2 2 2 1 2 1 3 2 2 2 1 3 2 2 2 2 2 1 2 2 1 
1 2 2 2 2 2 2 2 2 1 3 1 3 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 1 2 1 1 2 2 2 2 2 2 2 2 2 2 1 2...

result:

ok 3000000 numbers

Test #44:

score: 0
Accepted
time: 299ms
memory: 38460kb

input:

6166
201
1 2 3 1 1 1 7 7 9 9 11 11 13 13 9 9 17 17 19 19 21 21 23 23 19 19 27 28 27 27 31 27 27 27 35 27 37 38 37 37 37 37 43 37 37 37 37 37 49 50 49 49 49 49 55 49 49 49 49 49 61 62 63 61 61 61 61 68 61 61 61 61 61 61 75 76 77 75 75 75 75 82 75 75 75 75 75 75 89 90 91 92 93 94 95 96 97 98 99 100 10...

output:

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

result:

ok 3000000 numbers

Test #45:

score: 0
Accepted
time: 274ms
memory: 42516kb

input:

3578
291
1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 16 1 1 1 1 21 21 21 21 21 21 21 28 21 21 21 21 21 21 21 36 21 21 21 21 41 41 41 41 41 41 41 48 41 41 41 41 41 41 41 56 41 41 41 41 61 61 61 61 61 61 61 68 61 61 61 61 61 61 61 76 61 61 61 61 81 81 81 81 81 81 81 88 81 81 81 81 81 81 81 96 81 81 81 81 101 101 10...

output:

3 4 4 4 4 4 4 3 5 4 4 4 4 4 4 3 5 4 4 4 3 4 4 4 4 4 4 3 5 4 4 4 4 4 4 3 5 4 4 4 3 4 4 4 4 4 4 3 5 4 4 4 4 4 4 3 5 4 4 4 3 4 4 4 4 4 4 3 5 4 4 4 4 4 4 3 5 4 4 4 3 4 4 4 4 4 4 3 5 4 4 4 4 4 4 3 5 4 4 4 3 4 4 4 4 4 4 3 5 4 4 4 4 4 4 3 5 4 4 4 3 3 4 5 3 3 4 6 3 4 3 4 3 4 4 4 3 4 4 4 3 3 4 4 4 3 3 4 4 4 ...

result:

ok 3000000 numbers

Test #46:

score: 0
Accepted
time: 276ms
memory: 30180kb

input:

7672
152
1 2 1 1 5 1 1 1 9 1 1 1 1 1 1 16 1 1 19 1 21 1 1 1 1 1 1 28 28 28 28 28 28 34 28 28 37 28 28 28 28 28 28 44 45 44 44 44 49 44 44 52 53 52 44 56 44 44 59 44 61 44 44 64 65 64 64 64 69 64 64 72 73 72 64 76 64 64 79 64 81 64 64 84 85 86 84 88 84 90 84 84 84 84 84 84 97 84 84 100 84 102 84 104 ...

output:

3 3 4 4 3 4 4 4 3 4 4 4 4 4 4 3 4 4 3 4 3 4 4 4 4 4 4 2 3 3 3 3 3 2 4 3 2 4 3 3 3 3 3 2 2 3 3 3 2 3 3 2 2 3 4 2 3 3 2 3 2 3 3 2 2 3 3 3 2 3 3 2 2 3 4 2 3 3 2 3 2 3 3 2 2 2 3 2 3 2 3 3 3 3 3 3 2 3 3 2 3 2 3 2 2 2 3 2 3 2 3 3 3 3 3 3 2 3 3 2 3 2 3 2 2 2 3 2 3 2 3 3 3 3 3 3 2 3 3 2 3 2 3 2 2 2 2 2 2 2 ...

result:

ok 3000000 numbers

Test #47:

score: 0
Accepted
time: 322ms
memory: 50748kb

input:

1431
240
1 2 1 1 1 1 1 1 1 1 1 1 1 14 1 1 1 1 1 20 20 20 20 24 24 24 24 24 24 24 24 24 24 24 35 35 35 35 35 35 41 41 43 43 43 43 43 43 43 43 51 43 43 43 43 43 43 43 59 43 43 43 43 43 43 66 66 66 66 66 66 66 66 74 66 66 66 66 66 66 66 82 66 66 66 66 66 66 89 90 89 92 89 89 89 89 89 89 89 89 89 89 89 ...

output:

4 4 5 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 3 5 4 5 3 5 4 4 4 4 4 4 4 4 4 3 5 4 4 4 4 3 5 3 4 4 4 4 4 4 4 3 5 4 4 4 4 4 4 3 5 4 4 4 4 4 3 4 4 4 4 4 4 4 3 5 4 4 4 4 4 4 3 5 4 4 4 4 4 3 3 5 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 3 3 4 4 4 4 4 4 3 4 4 4 4 4 4 4 3 4 4 4 4 4 4 3 3 4 4 4 4 4 4 3 4 4 4 4 4 4 4 ...

result:

ok 3000000 numbers

Test #48:

score: 0
Accepted
time: 303ms
memory: 51028kb

input:

970
14
1 2 3 4 5 6 7 8 9 10 11 12 13 14
202
1 2 3 1 1 6 7 8 6 6 11 11 11 11 11 16 17 18 16 16 21 21 21 21 21 21 21 21 21 21 21 21 21 21 35 21 21 21 21 21 21 21 43 21 45 21 21 48 48 48 48 48 48 48 48 48 48 48 48 48 48 62 48 48 48 48 48 48 48 70 48 72 48 48 75 75 75 75 75 75 75 75 75 75 75 75 75 75 89...

output:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 
3 3 3 4 4 3 3 3 4 4 2 3 3 3 3 2 2 2 3 3 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 1 3 1 3 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 1 3 1 3 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 1 3 1 3 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 1 3 1 3 2 1 2 2 2 2 2 2 2...

result:

ok 3000000 numbers

Test #49:

score: 0
Accepted
time: 307ms
memory: 50748kb

input:

1042
58
1 2 2 2 2 6 6 6 6 10 10 10 10 14 15 14 14 18 18 20 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 36 40 36 36 36 36 45 36 36 36 49 49 49 49 49 49 49 49 49 49
55
1 1 3 3 5 5 7 7 9 9 11 11 13 14 15 16 15 15 19 15 21 15 15 24 15 15 15 15 15 30 31 30 30 34 30 36 30 30 39 30 30 30 30 30 45...

output:

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

result:

ok 3000000 numbers

Test #50:

score: 0
Accepted
time: 279ms
memory: 46576kb

input:

4220
101
1 2 3 1 1 1 7 1 1 10 1 1 13 1 1 1 17 1 19 1 21 22 23 21 21 21 27 21 21 30 21 21 33 21 21 21 37 21 39 21 41 42 43 41 41 41 47 41 41 50 41 41 53 41 41 41 57 41 59 41 61 62 63 61 61 61 67 61 61 70 61 61 73 61 61 61 77 61 79 61 81 81 81 81 81 81 81 81 81 81 81 81 81 81 95 95 95 81 81 81 101
251...

output:

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

result:

ok 3000000 numbers

Test #51:

score: 0
Accepted
time: 267ms
memory: 32172kb

input:

1974
45
1 2 1 1 1 6 7 1 1 10 1 1 13 1 1 1 1 18 1 1 1 1 1 1 25 25 27 25 25 25 25 25 25 34 25 25 25 25 25 25 25 42 25 25 45
258
1 2 1 1 5 1 7 1 1 10 11 10 10 14 10 16 10 10 19 20 19 19 23 19 25 19 19 28 29 28 28 28 28 28 35 28 28 38 28 40 28 28 28 28 45 46 45 45 45 45 45 52 45 45 55 45 57 45 45 45 45 ...

output:

2 2 3 3 3 2 2 4 3 2 3 3 2 3 3 3 3 2 3 3 3 3 3 3 1 2 1 3 2 2 2 2 2 1 3 2 2 2 2 2 2 1 3 2 1 
1 1 2 3 1 2 1 2 2 1 1 2 3 1 2 1 2 2 1 1 2 3 1 2 1 2 2 1 1 2 2 2 2 3 1 2 2 1 2 1 2 2 2 2 1 1 2 2 2 2 3 1 2 2 1 2 1 2 2 2 2 1 1 2 2 2 2 3 1 2 2 1 2 1 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2...

result:

ok 3000000 numbers

Test #52:

score: 0
Accepted
time: 275ms
memory: 42468kb

input:

3802
181
1 2 3 1 5 1 1 1 1 1 1 1 1 1 15 1 1 1 19 1 1 1 1 1 1 1 1 28 1 1 1 32 33 34 32 36 32 32 32 32 32 32 32 32 32 46 32 32 32 50 32 32 32 32 32 32 32 32 59 32 32 32 63 64 65 63 67 63 63 63 63 63 63 63 63 63 77 63 63 63 81 63 63 63 63 63 63 63 63 90 63 63 63 94 95 96 94 98 94 94 94 94 94 94 94 94 9...

output:

2 2 2 3 2 3 3 3 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 2 3 3 3 2 2 2 3 2 3 3 3 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 2 3 3 3 2 2 2 3 2 3 3 3 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 2 3 3 3 2 2 2 3 2 3 3 3 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 2 3 3 3 2 2 2 3 2 3 3 3 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 ...

result:

ok 3000000 numbers

Test #53:

score: 0
Accepted
time: 283ms
memory: 26176kb

input:

10893
178
1 2 3 4 1 1 1 1 9 1 11 1 13 14 15 16 13 13 13 13 21 13 23 13 25 26 27 28 25 25 25 25 33 25 35 25 37 38 39 37 41 42 37 37 37 37 47 37 49 50 51 49 53 54 49 49 49 49 59 49 61 61 63 61 61 61 61 68 61 61 61 61 61 74 61 76 77 76 76 76 81 82 81 76 85 86 85 76 89 90 89 89 89 94 95 94 89 98 99 98 8...

output:

3 3 3 3 4 4 4 4 3 4 3 4 3 3 3 3 4 4 4 4 3 4 3 4 3 3 3 3 4 4 4 4 3 4 3 4 2 2 2 3 2 2 3 3 3 3 2 3 2 2 2 3 2 2 3 3 3 3 2 3 1 2 1 3 2 2 2 1 3 2 2 2 2 1 3 1 1 2 2 2 1 1 2 3 1 1 2 3 1 1 2 2 2 1 1 2 3 1 1 2 3 1 1 2 2 2 1 1 2 3 1 1 2 3 1 1 1 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 1 1 2 2 1 2 1 2 2 2 1 1 1 2 1 2 ...

result:

ok 3000000 numbers

Test #54:

score: 0
Accepted
time: 251ms
memory: 24100kb

input:

9514
59
1 2 3 1 1 1 1 1 1 1 1 1 1 1 15 1 1 1 1 1 1 1 1 1 1 1 1 28 29 30 28 28 28 28 28 28 28 28 28 28 28 42 28 28 28 28 28 28 28 28 28 28 28 28 55 56 55 58 58
61
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 18 1 1 21 1 1 1 1 1 27 28 29 30 31 30 33 34 33 36 37 38 39 40 41 42 43 44 45 45 45 48 48 48 51 51 51 54 ...

output:

3 3 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 4 3 3 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 4 2 2 3 1 2 
3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 3 4 4 4 4 4 3 3 3 2 2 3 2 2 3 2 2 2 2 2 2 2 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1 2 2 1 1 
1 1 
2 2 2 4 2 2 3 3 3 2 2 3 3 2 2 2 4 2 2 3 3 3 2 2 3 3 2...

result:

ok 3000000 numbers

Test #55:

score: 0
Accepted
time: 277ms
memory: 36580kb

input:

4645
288
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 27 1 1 30 1 1 1 1 1 1 1 1 39 1 41 42 41 44 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 41 81 81 81 81 81 81 81 81 89 89 89 92 92 92 92 92 92 92 92 100 100 100 103 104 105 103 103...

output:

5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 7 6 5 7 6 6 6 6 6 6 6 5 7 5 5 6 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 4 5 6 5 5 5 5 5 4 5 6 4 5 5 5 5 5 5 5 4 5 5 4 4 4 5 5 5 5 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 4 5 5 3 3 4 4 4 4 3 4 4 4 3 4 ...

result:

ok 3000000 numbers

Test #56:

score: 0
Accepted
time: 306ms
memory: 40596kb

input:

3324
23
1 1 1 1 1 1 1 1 1 1 1 1 1 14 15 16 14 18 14 20 21 22 23
3
1 2 1
61
1 1 3 4 5 3 7 3 3 3 3 12 12 12 15 12 12 12 19 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 36 36 36 39 36 36 36 43 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 60 61
200
1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 16 1 18 1 20 1 1 1 ...

output:

1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 1 2 1 1 1 1 
1 1 2 
2 3 2 2 2 3 2 3 3 3 3 1 2 2 1 3 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 1 3 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 
3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 3 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 3 4 3 4 3 4 4 4 4 4...

result:

ok 3000000 numbers

Test #57:

score: 0
Accepted
time: 287ms
memory: 28080kb

input:

7013
248
1 2 1 1 1 1 1 1 1 1 11 1 1 1 1 1 17 1 1 1 1 1 1 24 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 44 45 44 44 44 44 44 44 44 44 54 44 44 44 44 44 60 44 44 44 44 44 44 67 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 87 87 87 87 91 87 87 87 87 96 87 98 87 87 87 87 87 87 87 106 87 87 87 87 ...

output:

6 6 7 7 7 7 7 7 7 7 6 7 7 7 7 7 6 7 7 7 7 7 7 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 6 6 7 7 7 7 7 7 7 7 6 7 7 7 7 7 6 7 7 7 7 7 7 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 5 6 6 6 5 7 6 6 6 5 7 5 7 6 6 6 6 6 6 5 7 6 6 6 6 6 5 7 5 7 6 6 6 6 6 6 5 7 6 6 5 5 6 6 5 6 5 5 6 6 5 6 5 5 6 6 5 6 4 5 5 4 5 5 ...

result:

ok 3000000 numbers

Test #58:

score: 0
Accepted
time: 264ms
memory: 32232kb

input:

9208
106
1 1 1 4 1 1 7 1 1 1 1 12 1 1 1 1 1 1 1 1 1 1 1 24 24 26 24 24 24 30 24 24 24 34 35 34 34 34 34 34 41 34 34 34 34 34 34 34 49 34 34 34 34 34 55 56 55 55 55 55 55 55 55 55 55 55 55 55 69 55 55 55 55 55 55 76 77 76 76 76 76 76 76 76 76 76 76 76 76 90 76 76 76 76 76 76 97 97 97 97 97 102 102 10...

output:

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

result:

ok 3000000 numbers

Test #59:

score: 0
Accepted
time: 292ms
memory: 31484kb

input:

7898
83
1 2 3 4 1 1 7 1 1 1 1 12 13 12 15 12 12 12 12 20 12 12 23 24 23 26 23 23 23 23 31 23 23 34 35 34 37 34 34 34 34 42 34 34 45 46 45 48 45 45 45 45 53 45 45 56 57 56 59 56 56 56 56 64 56 56 67 68 67 70 67 67 67 67 75 67 67 78 79 80 81 82 83
275
1 1 3 1 1 1 1 1 9 9 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

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

result:

ok 3000000 numbers

Test #60:

score: 0
Accepted
time: 288ms
memory: 48424kb

input:

22
85
1 1 1 4 1 1 1 1 1 10 1 1 1 1 1 1 17 18 17 17 17 17 17 17 17 17 17 17 17 17 31 17 33 17 17 36 37 36 36 36 36 36 36 36 36 46 36 36 36 36 36 36 36 36 55 56 55 55 55 55 55 55 55 55 65 55 55 55 55 55 55 55 55 74 75 76 77 78 79 80 81 82 81 84 85
29
1 2 1 4 1 6 1 1 9 1 11 1 13 14 13 16 13 18 13 13 21...

output:

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

result:

ok 3000000 numbers

Test #61:

score: 0
Accepted
time: 311ms
memory: 50036kb

input:

629
242
1 2 1 1 5 1 1 1 9 1 1 1 1 1 1 16 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 34 1 36 1 1 1 1 1 1 43 1 1 1 1 1 1 1 51 1 53 54 53 53 57 53 53 53 53 53 53 53 53 53 53 53 53 53 53 72 53 74 75 74 74 74 74 74 74 82 74 74 74 86 74 74 74 74 74 74 74 74 74 74 97 74 99 100 99 99 99 99 99 99 107 99 99 99 111 99 ...

output:

2 2 3 4 2 3 3 4 2 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 2 3 3 3 3 3 3 2 3 3 3 3 3 3 3 2 3 2 2 3 4 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 2 2 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 3 3 2 3 2 2 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 3 3 2 3 2 2 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 3 3 2 3 1 2 ...

result:

ok 3000000 numbers

Test #62:

score: 0
Accepted
time: 302ms
memory: 35580kb

input:

7983
121
1 2 1 1 5 1 1 1 1 1 1 1 1 1 1 1 17 1 1 1 1 22 1 1 1 26 27 26 26 1 1 1 33 1 1 1 1 1 1 1 1 1 1 1 1 46 47 46 46 50 46 46 46 46 46 46 46 46 46 46 46 62 46 46 46 46 67 46 46 46 71 72 71 71 46 46 46 78 46 46 46 46 46 46 46 46 46 46 46 46 91 92 91 91 91 91 91 91 99 91 91 91 91 91 91 91 91 91 91 91...

output:

1 1 2 3 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 1 2 2 2 1 1 2 3 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 3 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 1 2 2 2 1 1 2 3 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 1 2 2 1 2 2 1 1 1 
2 2 3 2 3 3 3 3 3 3 2 2 3 1 2 
3 3 3 4 4 4 3 3 3 4 4 4 3 ...

result:

ok 3000000 numbers

Test #63:

score: 0
Accepted
time: 292ms
memory: 33164kb

input:

933
51
1 1 3 3 5 1 1 1 1 1 1 1 1 14 14 1 17 17 19 19 21 17 17 17 17 17 17 17 17 30 30 17 33 33 33 36 33 33 33 33 33 33 33 33 33 33 33 33 49 50 51
203
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 18 19 18 18 18 18 18 18 18 27 18 18 30 18 18 18 18 18 18 18 18 18 18 18 18 43 18 18 18 18 18 18 18 18 52 53 52 52 52...

output:

1 3 1 3 1 4 2 2 2 2 2 2 2 1 3 2 1 3 1 3 1 4 2 2 2 2 2 2 2 1 3 2 1 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 1 1 1 
2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 3 3 3 3 3 3 3 2 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 2 2 3 3 3 3 3 2 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 2 3 2 3 2 3 3 3 3 3 2 3 3 1 2 3 1 2 3 2 2 1 3...

result:

ok 3000000 numbers

Test #64:

score: 0
Accepted
time: 257ms
memory: 21636kb

input:

5874
77
1 2 1 1 5 1 1 1 1 1 1 12 13 1 1 16 1 1 19 1 1 1 1 24 1 1 1 1 1 1 31 1 1 1 1 1 1 38 38 38 41 41 41 41 41 41 41 41 41 50 41 41 41 41 41 41 57 41 41 41 41 62 62 41 41 41 41 41 69 41 41 41 41 41 41 76 76
281
1 1 1 1 1 1 1 1 9 9 9 9 9 9 9 9 17 17 17 17 17 17 17 17 25 25 25 25 25 25 25 25 33 34 33...

output:

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

result:

ok 3000000 numbers

Test #65:

score: 0
Accepted
time: 286ms
memory: 8380kb

input:

17607
275
1 2 1 4 1 1 1 8 1 1 1 12 1 1 1 16 1 18 1 1 1 1 1 1 25 26 25 28 25 25 25 32 25 25 25 36 25 25 25 40 25 42 25 25 25 25 25 25 49 50 49 52 49 49 49 56 49 49 49 60 49 49 49 64 49 66 49 49 49 49 49 49 73 74 73 73 77 73 73 73 73 73 83 73 73 73 73 73 89 73 73 73 73 73 73 73 73 73 73 73 73 73 73 73...

output:

2 2 4 2 3 3 3 2 3 3 3 2 3 3 3 2 3 2 3 3 3 3 3 3 2 2 4 2 3 3 3 2 3 3 3 2 3 3 3 2 3 2 3 3 3 3 3 3 2 2 4 2 3 3 3 2 3 3 3 2 3 3 3 2 3 2 3 3 3 3 3 3 2 2 3 3 2 3 3 3 3 3 2 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 3 3 2 3 3 3 3 3 2 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 ...

result:

ok 3000000 numbers

Test #66:

score: 0
Accepted
time: 278ms
memory: 26008kb

input:

9250
142
1 2 3 1 1 6 1 1 9 1 1 1 1 1 15 1 1 1 1 1 1 1 1 1 1 1 1 28 1 1 1 1 1 1 1 36 1 1 1 1 1 1 1 1 1 46 47 48 46 46 51 46 46 54 46 46 46 46 46 60 46 46 46 46 46 46 46 46 46 46 46 46 73 46 46 46 46 46 46 46 81 46 46 46 46 46 46 46 46 46 91 92 93 91 91 96 91 91 99 91 91 91 91 91 105 91 91 91 91 91 91...

output:

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

result:

ok 3000000 numbers

Test #67:

score: 0
Accepted
time: 284ms
memory: 39052kb

input:

941
299
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 16 16 19 20 19 22 23 22 25 26 25 28 28 30 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 28 54 28 28 28 28 28 28 28 28 28 28 65 28 28 28 28 28 28 72 72 28 28 28 28 28 28 80 80 82 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 8...

output:

5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 4 5 5 4 4 5 4 4 5 4 4 5 3 4 3 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 5 4 4 4 4 4 4 4 4 4 3 5 4 4 4 4 4 3 4 4 4 4 4 4 4 3 4 3 5 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 5 4 4 4 4 4 4 4 4 4 3 5 4 4 4 4 4 3 4 4 4 4 4 4 4 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ...

result:

ok 3000000 numbers

Test #68:

score: 0
Accepted
time: 291ms
memory: 34992kb

input:

5947
167
1 1 3 1 1 1 1 1 9 1 1 1 13 13 15 13 13 13 13 13 21 13 13 13 25 25 25 25 25 30 25 25 25 25 25 25 25 25 25 40 25 25 43 25 25 25 25 25 49 25 51 51 25 25 55 25 25 58 25 25 25 25 25 25 65 25 25 25 25 25 25 72 25 74 25 25 25 25 25 25 81 81 81 81 81 86 81 81 81 81 81 81 81 81 81 96 81 81 99 81 81 ...

output:

2 4 2 5 3 3 3 3 2 5 3 3 2 4 2 5 3 3 3 3 2 5 3 3 2 3 3 3 3 2 4 3 3 3 3 3 3 3 3 2 4 3 2 4 3 3 3 3 2 4 2 3 4 3 2 4 3 2 4 3 3 3 3 3 2 4 3 3 3 3 3 2 4 2 4 3 3 3 3 3 2 3 3 3 3 2 4 3 3 3 3 3 3 3 3 2 4 3 2 4 3 3 3 3 2 4 2 3 4 3 2 4 3 2 4 3 3 3 3 3 2 4 3 3 3 3 3 2 4 2 4 3 3 3 3 3 2 2 2 3 2 3 3 3 3 3 3 3 3 3 ...

result:

ok 3000000 numbers

Test #69:

score: 0
Accepted
time: 261ms
memory: 36720kb

input:

5573
50
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 16 16 16 19 19 19 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 44 45 44 47 44 49 49
160
1 1 1 1 1 6 6 8 8 10 6 6 6 6 6 6 6 6 19 19 19 19 19 24 24 26 26 28 24 24 24 24 24 24 24 24 37 37 37 37 37 42 42 44 44 46 42 42 42 42 42 42 42 42 55 55 55...

output:

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

result:

ok 3000000 numbers

Test #70:

score: 0
Accepted
time: 274ms
memory: 23172kb

input:

10516
139
1 1 1 1 1 6 6 6 1 10 10 10 10 10 15 15 15 10 19 19 19 22 19 19 19 26 19 19 19 19 19 19 19 19 19 19 19 19 19 19 41 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19 59 19 19 19 19 19 19 19 19 19 19 19 19 19 73 73 73 76 73 73 73 80 73 73 73 73 73 73 73 73 73 73 73 73 73 73 95 73 73 73 73 73...

output:

1 2 2 2 2 1 2 2 3 1 2 2 2 2 1 2 2 3 1 2 2 1 3 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 1 2 2 1 3 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 1 2 2 2 1 1 
1 2 2 2 2 2 2 1 3 2 2...

result:

ok 3000000 numbers

Test #71:

score: 0
Accepted
time: 242ms
memory: 20168kb

input:

10974
153
1 2 1 1 1 6 1 1 1 1 11 1 1 1 1 16 1 1 1 1 1 1 1 1 1 26 27 1 1 1 1 32 33 32 32 32 37 32 32 32 32 42 32 32 32 32 47 32 32 32 32 32 32 32 32 32 57 58 32 32 32 32 63 64 63 63 67 68 67 67 71 72 71 71 75 76 75 75 79 80 79 79 83 79 79 79 87 79 89 79 79 92 93 92 79 79 79 79 79 100 79 79 79 104 105...

output:

1 1 2 3 2 1 2 2 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 1 3 2 2 2 1 1 2 3 2 1 2 2 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 1 3 2 2 2 1 1 2 3 1 1 2 3 1 1 2 3 1 1 2 3 1 1 2 2 1 2 2 2 1 2 1 2 2 1 1 2 3 2 2 2 2 1 2 2 2 1 1 3 2 1 2 2 2 2 2 1 2 1 1 3 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 1 1 1 2 1 1 1 2 1 1 1 2 1 1 1 2 1 ...

result:

ok 3000000 numbers

Test #72:

score: 0
Accepted
time: 277ms
memory: 40620kb

input:

2675
272
1 1 1 1 1 1 1 8 1 10 1 1 1 1 15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 40 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 59 1 1 62 62 62 62 62 62 62 69 62 71 62 62 62 62 76 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62 101 62 62 62 62 62 62 62 62 62 62 62 62 62 62 62...

output:

2 3 3 3 3 3 3 2 4 2 4 3 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 4 3 2 3 3 3 3 3 3 2 4 2 4 3 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 4 3 2 3 3 3 3 3 3 2 4 2 4 3 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 3 ...

result:

ok 3000000 numbers

Test #73:

score: 0
Accepted
time: 264ms
memory: 26344kb

input:

7414
31
1 2 1 4 1 1 1 1 1 1 1 12 1 14 1 16 1 18 18 18 21 21 23 24 23 26 27 28 29 30 26
33
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
11
1 2 2 2 5 5 5 8 9 10 11
154
1 1 1 1 1 1 1 1 1 10 1 1 1 1 1 1 17 1 1 1 21 1 1 1 25 25 25 25 25 25 25 25 25 34 25 25 25...

output:

2 2 3 2 3 3 3 3 3 3 3 2 3 2 3 2 3 1 2 2 1 2 1 1 2 1 1 1 1 1 2 
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 
2 1 2 2 1 2 2 1 1 1 1 
1 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 1 3 2 2 1 3 2 2 1 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 1 3 2 2 1 3 2 2 1 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 1 3 2 2 1 3 2 2 1 2...

result:

ok 3000000 numbers

Test #74:

score: 0
Accepted
time: 278ms
memory: 34940kb

input:

3064
252
1 2 1 1 1 1 1 8 1 1 1 1 1 1 1 1 17 18 1 20 1 1 23 1 1 26 1 1 1 1 1 1 1 1 1 36 37 1 39 1 41 1 1 44 1 46 1 1 1 50 1 1 53 1 55 1 1 58 59 60 58 58 58 58 58 58 67 58 58 58 58 58 58 58 58 58 58 58 58 80 81 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 58 5...

output:

1 1 2 2 2 2 2 1 2 2 2 2 2 2 2 2 1 1 3 1 2 2 1 2 2 1 2 2 2 2 2 2 2 2 2 1 1 3 1 2 1 2 2 1 2 1 2 2 2 1 2 2 1 2 1 2 2 1 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 ...

result:

ok 3000000 numbers

Test #75:

score: 0
Accepted
time: 282ms
memory: 32624kb

input:

3382
99
1 2 1 1 1 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 22 1 1 1 1 1 1 1 1 31 32 31 31 31 36 31 31 31 31 31 31 31 31 31 31 31 31 31 31 31 52 31 31 31 31 31 31 31 31 61 61 61 61 61 66 61 61 61 61 61 61 61 61 61 76 61 61 61 61 61 61 61 61 85 85 87 87 85 90 90 92 92 90 95 95 95 95 99
53
1 1 1 1 1 1 1 1 1 10 ...

output:

2 2 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 2 2 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 1 3 2 2 2 1 4 2 2 2 2 2 2 2 2 1 4 2 2 2 2 2 2 2 1 3 1 3 2 1 3 1 3 2 1 2 2 2 1 
2 3 3 4 3 3 3 3 3 2 3 3 4 2 4 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 2 3 4 2 4 3 3 2 2 2 2 2 1 2 2...

result:

ok 3000000 numbers

Test #76:

score: 0
Accepted
time: 258ms
memory: 36044kb

input:

1048
91
1 2 1 1 1 6 1 1 1 10 1 1 1 1 1 1 1 1 19 20 19 19 19 24 19 19 19 28 19 19 19 19 19 19 19 19 37 38 37 37 37 42 37 37 37 46 37 37 37 37 37 37 37 37 55 55 55 55 55 55 55 55 55 55 65 55 55 55 55 55 55 55 73 73 73 73 73 73 73 73 73 73 83 73 73 73 73 73 73 73 91
46
1 1 1 1 1 1 1 8 1 1 1 1 1 1 1 1 1...

output:

2 2 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 2 2 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 2 2 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 1 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 2 1 
1 2 2 2 2 2 2 1 3 2 2 2 2 2 2 2 2 2 1 2 2 3 2 2 2 1 2 2 2 2 2 2 1 1 2 2 2 2 1 2 2 2 2 2 2 1 
2 2 3 3 3 3 2 2 4 2 3 3 ...

result:

ok 3000000 numbers

Test #77:

score: 0
Accepted
time: 292ms
memory: 32260kb

input:

4549
119
1 2 1 1 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 24 25 26 27 24 24 24 31 32 24 24 24 24 37 24 39 24 24 24 43 24 24 46 24 24 49 24 24 24 24 24 24 24 24 24 24 24 24 24 63 64 63 66 63 68 63 70 63 72 63 63 63 63 63 63 63 63 81 82 81 84 81 86 81 88 81 90 81 81 81 81 81 81 81 81 99 100 99 102 99 104...

output:

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

result:

ok 3000000 numbers

Test #78:

score: 0
Accepted
time: 287ms
memory: 44280kb

input:

2504
74
1 2 1 1 1 1 1 1 1 10 1 1 1 1 1 1 1 1 1 1 1 1 1 24 1 26 27 26 26 30 26 26 33 26 35 26 26 26 39 26 26 26 26 26 45 26 26 48 26 26 51 51 51 54 51 56 51 51 59 59 59 51 51 51 51 51 51 51 69 69 69 69 69 74
178
1 2 1 1 5 1 1 1 9 10 9 9 13 9 9 9 17 18 17 17 21 17 17 17 25 26 25 25 29 25 25 25 33 34 3...

output:

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

result:

ok 3000000 numbers

Test #79:

score: 0
Accepted
time: 319ms
memory: 29944kb

input:

373
279
1 2 3 1 1 6 7 8 1 1 11 1 1 1 1 1 1 1 1 20 1 1 1 1 1 1 1 28 1 1 1 32 1 34 35 34 34 34 39 34 41 34 34 34 34 34 34 34 34 34 34 34 34 54 34 56 34 58 34 34 34 62 34 34 34 34 67 68 69 67 71 72 73 71 75 76 77 75 75 75 81 75 83 75 75 75 75 75 75 75 75 75 75 75 75 96 75 75 75 75 75 75 75 75 75 75 75 ...

output:

4 4 4 5 5 4 4 4 6 5 4 5 5 5 5 5 5 5 5 4 5 5 5 5 5 5 5 4 5 5 5 4 5 3 3 4 4 4 3 4 3 4 4 4 4 4 4 4 4 4 4 4 4 3 4 3 4 3 4 4 4 3 4 4 4 4 3 3 3 5 3 3 3 5 3 3 3 4 4 4 3 4 3 4 4 4 4 4 4 4 4 4 4 4 4 3 4 4 4 4 4 4 4 4 4 4 4 3 4 4 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ...

result:

ok 3000000 numbers

Test #80:

score: 0
Accepted
time: 282ms
memory: 38396kb

input:

96
36
1 1 1 1 1 1 7 1 1 1 1 1 1 1 1 16 16 16 16 16 21 22 23 21 25 26 27 28 29 30 31 32 33 34 35 36
133
1 1 1 4 1 6 1 1 9 10 9 12 13 12 12 16 12 18 12 12 12 12 12 12 12 12 27 12 12 12 12 32 33 32 32 36 32 38 32 32 32 32 32 32 32 32 47 32 32 32 32 52 53 52 52 56 52 58 52 52 52 52 52 52 52 52 67 52 52 ...

output:

1 2 2 2 2 2 1 3 2 2 2 2 2 2 2 1 2 2 2 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 
2 3 3 2 4 2 4 3 2 2 4 2 2 3 4 2 3 2 3 3 3 3 3 3 3 3 2 3 3 3 3 2 2 3 4 2 3 2 3 3 3 3 3 3 3 3 2 3 3 3 3 2 2 3 4 2 3 2 3 3 3 3 3 3 3 3 2 3 3 3 3 2 2 3 4 2 3 2 3 3 3 3 3 3 3 3 2 3 3 3 3 2 2 3 3 3 3 3 3 3 3 3 3 2 3 3 2 3 3 3 3 1 2 2...

result:

ok 3000000 numbers

Test #81:

score: 0
Accepted
time: 307ms
memory: 17436kb

input:

10158
55
1 2 1 1 5 1 1 1 1 10 1 1 13 1 15 1 1 1 1 1 1 1 1 1 1 1 27 1 1 1 1 1 1 1 1 1 37 38 37 37 37 37 37 37 45 37 37 37 37 50 37 52 37 37 37
27
1 2 3 1 1 1 7 8 1 1 11 1 1 1 15 1 1 1 1 1 1 1 23 24 25 26 27
48
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 3...

output:

1 1 2 3 1 2 2 2 2 1 2 2 1 2 1 2 2 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 1 2 2 2 2 2 2 1 2 2 2 2 1 2 1 2 2 2 
1 1 1 2 2 2 1 1 2 2 1 2 2 2 1 2 2 2 2 2 2 2 1 1 1 1 1 
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 2 3 2 2 2 3 1 2 1 
2 2 2 3 3 3 2 3 2 3 3 3 2 3 3 3 2 3 2...

result:

ok 3000000 numbers

Test #82:

score: 0
Accepted
time: 297ms
memory: 49988kb

input:

176
1
1
2970070
1 2 1 1 1 1 1 1 1 1 1 1 1 14 1 1 1 1 1 1 21 1 1 1 1 1 1 28 1 1 1 1 1 1 1 1 1 1 1 40 1 1 1 1 1 1 47 1 1 1 1 1 1 1 1 1 1 58 1 1 61 1 1 1 1 1 1 1 1 70 1 1 73 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 89 1 91 1 1 1 1 1 1 1 1 100 1 1 1 1 1 1 1 1 1 1 111 1 1 1 1 1 117 1 1 1 1 1 1 1 1 1 1 128 1 1 1 1 1...

output:

1 
5071 5071 5072 5072 5072 5072 5072 5072 5072 5072 5072 5072 5072 5071 5072 5072 5072 5072 5072 5072 5071 5072 5072 5072 5072 5072 5072 5071 5072 5072 5072 5072 5072 5072 5072 5072 5072 5072 5072 5071 5072 5072 5072 5072 5072 5072 5071 5072 5072 5072 5072 5072 5072 5072 5072 5072 5072 5071 5072 50...

result:

ok 3000000 numbers

Test #83:

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

input:

1333
173
1 1 1 1 1 1 1 1 1 1 11 11 11 11 15 11 17 11 11 11 11 22 22 11 11 26 11 11 11 11 11 11 11 11 11 11 11 38 38 40 38 38 38 38 38 38 38 38 38 50 50 38 38 38 38 38 57 38 38 38 61 38 38 38 38 38 38 38 69 38 38 38 38 38 75 76 77 78 79 75 75 75 75 75 75 75 75 75 75 75 91 75 75 94 95 75 75 75 99 100 ...

output:

2 3 3 3 3 3 3 3 3 3 2 3 3 3 2 4 2 4 3 3 3 2 3 4 3 2 4 3 3 3 3 3 3 3 3 3 3 2 3 2 4 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 2 4 3 3 2 4 3 3 3 3 3 3 2 4 3 3 3 3 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 2 3 3 2 2 3 3 3 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 2 3 3 2 2 3 3 3 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 2 3 3 2 2 3 3 3 2 2 2 2 ...

result:

ok 3000000 numbers

Test #84:

score: 0
Accepted
time: 264ms
memory: 21352kb

input:

11390
78
1 1 1 1 1 1 1 8 1 1 11 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 27 27 1 30 1 1 1 34 1 1 1 1 1 1 1 1 1 1 1 1 47 1 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 49 67 68 67 70 70 70 70 74 75 76 77 78
183
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 18 1 1 21 21 1 1 1 1 1 28 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

2 3 3 3 3 3 4 2 4 3 2 3 4 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 4 2 4 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 2 4 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 2 3 1 2 2 2 1 1 1 1 1 
1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 1 2 3 2 2 2 2 1 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3 2 2 2 2 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 3...

result:

ok 3000000 numbers

Test #85:

score: 0
Accepted
time: 321ms
memory: 29752kb

input:

527
5
1 2 1 4 5
238
1 2 1 1 1 1 1 1 1 1 11 1 1 1 1 1 1 1 1 1 21 1 1 1 25 1 1 1 1 1 1 1 1 34 1 1 1 1 39 1 1 1 1 1 1 1 47 1 49 1 1 1 1 1 55 1 1 1 1 1 1 1 1 1 1 1 1 68 1 1 1 1 73 74 1 1 1 1 1 1 1 82 83 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 82 108 82 82 82 112 82 114 82 82...

output:

1 1 2 1 1 
2 2 3 3 3 3 3 3 3 4 2 3 3 3 3 3 3 3 3 3 2 3 3 3 2 3 3 3 3 3 3 3 3 2 3 3 3 3 2 3 3 3 3 3 3 3 2 3 2 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 2 2 4 3 3 3 3 3 3 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 2 3 2 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 2 2 3 4 3 3 3 2 3 3 3 3...

result:

ok 3000000 numbers

Test #86:

score: 0
Accepted
time: 275ms
memory: 24904kb

input:

6526
76
1 1 1 4 4 4 7 8 7 10 7 7 13 14 13 16 13 13 19 20 19 22 19 19 25 25 25 25 25 25 31 31 31 31 31 31 31 31 31 40 31 31 43 31 31 31 47 31 49 31 31 31 53 31 31 31 31 58 31 31 31 31 31 31 65 31 31 31 31 31 31 31 31 74 75 76
299
1 2 1 1 1 1 1 1 1 1 1 12 1 1 1 1 1 18 1 1 1 1 23 1 1 1 27 28 1 1 1 1 33...

output:

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

result:

ok 3000000 numbers

Test #87:

score: 0
Accepted
time: 319ms
memory: 41392kb

input:

2889
204
1 2 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 33 1 1 1 1 38 1 1 1 1 1 44 1 1 1 1 1 1 1 1 1 1 1 1 1 1 59 1 1 62 1 1 1 1 1 1 69 70 71 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 69 101 69 69 69 69 106 69 69 69 69 69 112 69 69 69 69 69 ...

output:

2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 2 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 2 3 3 3 3 3 3 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 2 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 3 3 2 3 3 3 3 3 3 1 1 2 2 2 2 2 1 2 2 2 2 2 2 ...

result:

ok 3000000 numbers

Test #88:

score: 0
Accepted
time: 305ms
memory: 37540kb

input:

1885
139
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 30 31 30 30 30 30 30 30 30 30 30 30 30 43 30 45 30 30 30 30 30 30 30 30 30 55 30 30 30 30 30 30 30 30 30 30 30 30 30 69 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 96 30 30 30 30 30 102 30 30 30 30 3...

output:

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

result:

ok 3000000 numbers

Test #89:

score: 0
Accepted
time: 289ms
memory: 50688kb

input:

1
3000000
1 2 1 4 4 6 7 6 9 9 11 12 11 14 14 16 17 16 19 19 21 22 21 24 24 26 27 26 29 29 31 32 31 34 34 36 37 36 39 39 41 42 41 44 44 46 47 46 49 49 51 52 51 54 54 56 57 56 59 59 61 62 61 64 64 66 67 66 69 69 71 72 71 74 74 76 77 76 79 79 81 82 81 84 84 86 87 86 89 89 91 92 91 94 94 96 97 96 99 99 ...

output:

600001 600001 600002 600000 600001 600000 600000 600001 599999 600000 599999 599999 600000 599998 599999 599998 599998 599999 599997 599998 599997 599997 599998 599996 599997 599996 599996 599997 599995 599996 599995 599995 599996 599994 599995 599994 599994 599995 599993 599994 599993 599993 599994...

result:

ok 3000000 numbers