QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#822865#9907. 最大匹配 2 LiWenX100 ✓1814ms260276kbC++205.4kb2024-12-20 17:05:442024-12-20 17:05:45

Judging History

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

  • [2024-12-20 17:05:45]
  • 评测
  • 测评结果:100
  • 用时:1814ms
  • 内存:260276kb
  • [2024-12-20 17:05:44]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int a[200005],b[200005];
struct SGT1{
	int s1[200005<<2],s2[200005<<2],tree[200005<<2];
	#define ls (now<<1)
	#define rs (now<<1|1)
	#define mid ((l+r)>>1)
	void pushup(int now){
		tree[now]=tree[ls]+tree[rs]+min(s2[ls],s1[rs]);
		s1[now]=s1[ls],s2[now]=s2[rs];
		if(s2[ls]>s1[rs]){
			s2[now]+=s2[ls]-s1[rs];
		}
		else{
			s1[now]+=s1[rs]-s2[ls];
		}
	}
	void add(int now,int l,int r,int x){
		if(l==r){
			if(b[l]){
				s1[now]=1;
				s2[now]=0;
				tree[now]=0;
			}
			else{
				s1[now]=0;
				s2[now]=1;
				tree[now]=0;
			}
			return ;
		}
		if(mid>=x) add(ls,l,mid,x);
		else add(rs,mid+1,r,x);
		pushup(now);
	}
	void del(int now,int l,int r,int x){
		if(l==r){
			s1[now]=s2[now]=tree[now]=0;
			return ;
		}
		if(mid>=x) del(ls,l,mid,x);
		else del(rs,mid+1,r,x);
		pushup(now);
	}
	int ask(){return tree[1];}
	#undef ls
	#undef rs
	#undef mid
}TT;
int root[200005];
struct SGT2{
	int tree[200005*80],ls[200005*80],rs[200005*80];
	int cnt;
	int tag[200005*80];
	#define mid ((l+r)>>1)
	int build(){
		int now=++cnt;
		return now;
	}
	void pushtag(int now,int k){
		tree[now]+=k;
		tag[now]+=k;
	}
	void pushdown(int now){
		if(!ls[now]) ls[now]=build();
		if(!rs[now]) rs[now]=build();
		if(tag[now]){
			pushtag(ls[now],tag[now]);
			pushtag(rs[now],tag[now]);
			tag[now]=0;
		}
	}
	int add(int now,int l,int r,int x,int y,int k){
		if(!now) now=build();
		if(l>=x&&r<=y){
			pushtag(now,k);
			return now;
		}pushdown(now);
		if(mid>=x) ls[now]=add(ls[now],l,mid,x,y,k);
		if(mid<y) rs[now]=add(rs[now],mid+1,r,x,y,k);
		tree[now]=min(tree[ls[now]],tree[rs[now]]);
		return now;
	}
	int Askl(int now,int l,int r){
		if(!now) return 1e9;
		if(l==r) return l;
		pushdown(now);
		if(tree[ls[now]]==0) return Askl(ls[now],l,mid);
		return Askl(rs[now],mid+1,r);
	}
	int Askr(int now,int l,int r){
		if(!now) return 0;
		if(l==r) return l;
		pushdown(now);
		if(tree[rs[now]]==0) return Askr(rs[now],mid+1,r);
		return Askr(ls[now],l,mid);
	}
	vector<pair<int,pair<int,int> > > vec;
	void get(int now,int l,int r,int x,int y){
		if(l>=x&&r<=y){
			vec.push_back({now,{l,r}});
			return ;
		}
		pushdown(now);
		if(mid>=x) get(ls[now],l,mid,x,y);
		if(mid<y) get(rs[now],mid+1,r,x,y);
	}
	int askl(int now,int l,int r,int x,int y){
		if(x>y) return 1e9;
		vec.clear();get(now,l,r,x,y);
		for(auto u:vec){
			if(tree[u.first]==0) return Askl(u.first,u.second.first,u.second.second);
		}
		return 1e9;
	}
	int askr(int now,int l,int r,int x,int y){
		if(x>y) return 0;
		vec.clear();get(now,l,r,x,y);
		reverse(vec.begin(),vec.end());
		for(auto u:vec){
			if(tree[u.first]==0) return Askr(u.first,u.second.first,u.second.second);
		}
		return 0;
	}
	#undef mid
}T;
int n,m;
int askpre(set<int> &s,int x){
	return (*--s.lower_bound(x));
}
int asknxt(set<int> &s,int x){
	return *s.upper_bound(x);
}
set<int> s[200005][2];
bool in[200005];
void rev(int x){
	int col=a[x];
	if(in[x]){
		TT.add(1,1,n,x);
		if(!b[x]) root[col]=T.add(root[col],1,n,x,n,-1);
		else root[col]=T.add(root[col],1,n,x,n,1);
		s[a[x]][b[x]].insert(x);
		in[x]=0;
	}
	else{
		TT.del(1,1,n,x);
		if(!b[x]) root[col]=T.add(root[col],1,n,x,n,1);
		else root[col]=T.add(root[col],1,n,x,n,-1);
		s[a[x]][b[x]].erase(x);
		in[x]=1;
	}
}
int ans=0;
void ins(int x,bool lf=0){
	int col=a[x];
	if(!b[x]){
		int p=asknxt(s[col][1],x);
		if(1<=p&&p<=n){
			T.add(root[col],1,n,x,n,1);
			in[x]=1;
			rev(p);
			ans++;
			return ;
		}
		int l=T.askr(root[col],1,n,1,x)+1;
		int r=T.askl(root[col],1,n,x,n);
		if(l>=r){
			in[x]=0;
			s[a[x]][b[x]].insert(x);
			TT.add(1,1,n,x);
			return ;
		}
		else{
			T.add(root[col],1,n,x,n,1);
			in[x]=1;
			rev(l);
			return ;
		}
	}
	else{
		int p=askpre(s[col][0],x);
		if(1<=p&&p<=n){
			T.add(root[col],1,n,x,n,-1);
			in[x]=1;
			rev(p);
			ans++;
			return ;
		}
		int l=T.askr(root[col],1,n,1,x)+1;
		int r=T.askl(root[col],1,n,x,n);
		if(l>=r){
			in[x]=0;
			s[a[x]][b[x]].insert(x);
			TT.add(1,1,n,x);
			return ;
		}
		else{
			T.add(root[col],1,n,x,n,-1);
			in[x]=1;
			rev(r);
			return ;
		}
	}
}
void del(int x,bool lf=0){
	int col=a[x];
	if(!b[x]){
		if(!in[x]){
			TT.del(1,1,n,x);
			s[a[x]][b[x]].erase(x);
			return ;
		}
		int l=T.askr(root[col],1,n,1,x-1)+1;
		int r=T.askl(root[col],1,n,x+1,n);
		in[x]=0;
		T.add(root[col],1,n,x,n,-1);
		
		in[r]=0;
		T.add(root[col],1,n,r,n,1);
		ans--;
		
		ins(r);
	}
	else{
		if(!in[x]){
			TT.del(1,1,n,x);
			s[a[x]][b[x]].erase(x);
			return ;
		}
		int l=T.askr(root[col],1,n,1,x-1)+1;
		int r=T.askl(root[col],1,n,x+1,n);
		in[x]=0;
		T.add(root[col],1,n,x,n,1);
		
		in[l]=0;
		T.add(root[col],1,n,l,n,-1);
//		if(lf){
//			cout<<l<<'\n';
//			exit(0);
//		}
		ans--;
		
		ins(l);
	}
}
mt19937 rd(time(NULL));
int main(){
	cin>>n>>m;
	for(int i=1;i<=n;i++) root[i]=T.build();
	for(int i=1;i<=n;i++) cin>>a[i];
	for(int i=1;i<=n;i++) cin>>b[i];
	for(int i=1;i<=n;i++) for(int j=0;j<2;j++) s[i][j].insert(0),s[i][j].insert(n+1);
	for(int i=1;i<=n;i++) ins(i);
	cout<<ans+TT.ask()<<'\n';
	while(m--){
		int x,A,B;cin>>x>>A>>B;
		if(!m){
			del(x,1);
		}
		else{
			del(x);
		}
		a[x]=A,b[x]=B;
		ins(x,1);
		cout<<ans+TT.ask()<<"\n";
	}
}
/*
11 1
1 2 1 1 1 2 1 2 2 2 2 
1 0 0 1 1 1 1 0 0 1 1 
11 2 1

11 0
1 0 0 1 1 1 1 0 0 1 1 
1 2 1 1 1 2 1 2 2 2 2 

2 1
0 1
1 1
2 1 1
*/

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

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

input:

100 0
1 1 2 1 2 2 2 2 2 1 2 1 1 2 2 1 2 2 2 2 2 1 1 2 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 2 2 1 2 2 2 2 2 2 1 1 2 1 2 1 1 1 2 2 2 2 2 2 1 1 1 2 1 1 1 1 1 2 2 1 1 2 1 1 2 1 1 2 2 2 1 2 2 2 1 2 1 2 1 2 1 1 2 1 1 2
1 1 0 1 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 1 0 1 1 0 0 0 0 1 1 1 1 1 ...

output:

45

result:

ok "45"

Test #2:

score: 10
Accepted
time: 4ms
memory: 33528kb

input:

100 0
2 1 1 2 1 2 1 2 1 1 1 2 1 1 2 1 1 2 2 1 2 1 2 2 1 1 2 2 1 1 1 2 1 1 1 2 2 1 2 1 1 2 2 2 2 2 1 2 1 2 2 1 1 2 1 2 2 1 1 2 2 1 1 1 2 2 1 2 1 2 1 2 2 2 1 2 1 1 2 2 2 2 1 1 1 1 1 1 1 2 2 1 2 1 2 2 2 2 1 2
0 0 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 1 1 0 0 1 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 1 0 1 1 0 1 1 1 1 0 ...

output:

43

result:

ok "43"

Test #3:

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

input:

100 0
2 2 3 3 4 4 3 2 4 4 1 2 3 4 3 4 4 3 3 2 3 1 2 4 1 3 1 4 3 3 4 4 3 3 1 4 1 1 2 2 1 3 4 3 3 4 3 3 4 3 4 3 4 4 1 1 1 4 3 1 2 1 2 3 3 3 2 1 1 1 1 3 3 2 4 2 3 4 1 4 1 4 1 1 2 1 1 1 1 1 4 4 2 3 2 1 2 3 1 4
1 1 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 0 1 0 0 0 1 0 1 1 0 0 1 0 1 1 1 1 0 1 1 1 0 1 0 1 1 1 0 0 1 ...

output:

37

result:

ok "37"

Test #4:

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

input:

100 0
3 1 2 4 3 2 2 1 4 2 2 3 2 1 1 2 3 3 2 3 1 1 3 4 3 2 1 2 4 3 4 2 2 1 2 4 2 2 1 1 3 3 1 2 3 4 3 2 3 2 2 1 3 3 1 2 3 2 2 3 3 4 2 2 1 4 1 3 2 3 3 4 4 3 2 1 4 2 2 3 4 2 3 2 3 4 3 3 1 2 3 4 3 1 4 1 2 2 2 3
1 0 1 1 0 1 1 0 0 0 0 0 0 1 1 1 0 1 1 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 1 1 0 0 1 1 1 0 0 0 0 0 0 ...

output:

44

result:

ok "44"

Test #5:

score: 10
Accepted
time: 2ms
memory: 33068kb

input:

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

output:

37

result:

ok "37"

Test #6:

score: 10
Accepted
time: 3ms
memory: 31664kb

input:

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

output:

39

result:

ok "39"

Test #7:

score: 10
Accepted
time: 4ms
memory: 32244kb

input:

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

output:

37

result:

ok "37"

Test #8:

score: 10
Accepted
time: 4ms
memory: 33120kb

input:

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

output:

35

result:

ok "35"

Test #9:

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

input:

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

output:

38

result:

ok "38"

Test #10:

score: 10
Accepted
time: 4ms
memory: 32052kb

input:

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

output:

44

result:

ok "44"

Subtask #2:

score: 15
Accepted

Test #11:

score: 15
Accepted
time: 3ms
memory: 30704kb

input:

2000 0
2 2 1 1 2 1 2 2 2 1 1 1 2 1 2 2 1 2 2 1 2 1 2 1 1 2 1 2 2 1 2 2 2 1 1 1 1 1 1 2 1 1 2 2 1 2 1 2 2 2 1 1 2 1 1 1 2 2 2 2 2 2 1 1 2 1 1 2 2 1 2 1 1 1 1 2 1 1 1 1 1 2 2 2 2 1 2 2 1 2 2 2 2 2 1 2 1 2 1 1 2 1 1 2 2 1 1 1 1 1 1 1 1 2 2 1 2 2 2 2 2 1 1 2 2 2 2 1 2 2 2 1 1 1 2 1 2 1 1 1 2 2 1 2 1 1 1...

output:

954

result:

ok "954"

Test #12:

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

input:

2000 0
2 1 1 1 1 1 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 2 2 1 2 1 1 1 1 1 1 1 2 2 1 2 2 1 1 2 2 2 2 1 2 2 2 2 1 1 2 2 1 1 1 2 2 1 2 1 2 2 2 1 2 2 1 2 2 2 2 2 1 2 1 2 2 1 2 2 1 1 1 1 1 2 2 1 2 1 2 1 2 1 1 1 2 2 2 1 2 1 1 2 1 2 1 1 1 1 1 2 1 2 1 2 2 2 2 1 2 1 1 2 2 2 2 1 1 2 2 1 1 2 1 2 2 2...

output:

958

result:

ok "958"

Test #13:

score: 15
Accepted
time: 7ms
memory: 32428kb

input:

2000 0
4 3 4 4 2 2 2 2 3 1 1 3 1 3 3 3 1 4 2 2 2 4 4 3 3 3 1 1 3 1 2 1 2 1 1 4 1 2 2 4 3 3 1 3 2 2 1 3 2 1 3 4 3 2 3 4 3 1 3 2 2 1 4 2 4 4 3 4 1 3 3 1 3 1 3 1 4 3 4 4 4 3 4 1 3 2 4 3 4 3 1 3 2 4 1 4 2 1 2 2 4 4 1 4 2 4 1 1 1 2 1 1 4 1 1 2 2 1 4 2 2 3 4 2 2 3 1 4 1 1 2 2 1 3 2 1 3 2 3 3 1 1 2 4 1 1 4...

output:

946

result:

ok "946"

Test #14:

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

input:

2000 0
1 2 4 3 3 3 2 3 1 4 4 1 4 4 1 2 3 4 2 3 1 2 1 4 3 4 3 3 4 3 4 4 1 4 4 2 4 4 2 1 2 3 2 3 2 4 2 2 3 4 3 3 4 3 4 4 4 4 2 2 4 3 4 3 1 3 3 2 2 2 4 3 1 1 2 1 2 2 2 1 1 2 1 4 2 3 4 1 4 1 1 4 1 2 1 1 4 4 3 2 4 1 2 1 1 1 1 2 4 2 2 3 4 1 1 4 2 2 4 3 3 1 2 3 2 1 4 2 2 1 4 2 2 4 3 3 1 2 2 3 4 3 1 4 3 1 1...

output:

945

result:

ok "945"

Test #15:

score: 15
Accepted
time: 7ms
memory: 33280kb

input:

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

output:

947

result:

ok "947"

Test #16:

score: 15
Accepted
time: 3ms
memory: 32896kb

input:

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

output:

948

result:

ok "948"

Test #17:

score: 15
Accepted
time: 3ms
memory: 32908kb

input:

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

output:

949

result:

ok "949"

Test #18:

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

input:

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

output:

928

result:

ok "928"

Test #19:

score: 15
Accepted
time: 3ms
memory: 31028kb

input:

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

output:

950

result:

ok "950"

Test #20:

score: 15
Accepted
time: 3ms
memory: 31064kb

input:

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

output:

918

result:

ok "918"

Test #21:

score: 15
Accepted
time: 5ms
memory: 34244kb

input:

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

output:

909

result:

ok "909"

Test #22:

score: 15
Accepted
time: 3ms
memory: 33712kb

input:

2000 0
28 13 36 62 2 58 55 9 2 14 56 45 12 61 21 52 29 6 12 48 20 43 37 41 7 47 64 23 15 12 7 42 15 31 43 7 64 30 11 3 7 17 13 46 49 6 47 10 55 17 33 37 9 52 63 28 45 27 25 53 55 51 34 23 41 31 18 11 31 37 18 45 45 31 27 58 29 12 16 44 19 45 64 55 7 20 31 27 34 35 11 63 57 17 2 34 1 54 20 37 55 4 11...

output:

900

result:

ok "900"

Test #23:

score: 15
Accepted
time: 7ms
memory: 32380kb

input:

2000 0
31 104 15 67 66 31 37 55 12 115 95 50 47 3 115 11 25 8 40 43 117 107 99 3 9 75 111 115 74 97 24 8 16 86 71 59 43 25 63 121 125 19 109 83 105 62 20 65 17 57 47 51 69 18 114 18 97 96 114 5 68 74 125 5 33 85 75 73 110 75 95 104 104 28 127 89 22 30 88 9 69 43 110 32 104 1 116 52 127 121 35 15 85 ...

output:

872

result:

ok "872"

Test #24:

score: 15
Accepted
time: 5ms
memory: 31136kb

input:

2000 0
11 44 53 57 20 98 36 75 12 56 9 94 7 128 42 27 3 95 19 97 109 35 114 115 4 9 34 104 63 29 65 60 50 36 98 53 67 12 117 75 116 78 45 36 78 48 63 23 121 16 126 12 112 78 100 60 44 48 85 108 3 38 94 21 67 54 14 116 27 50 114 68 17 3 81 64 96 5 50 65 33 122 102 100 33 101 44 114 66 80 99 44 121 11...

output:

883

result:

ok "883"

Test #25:

score: 15
Accepted
time: 4ms
memory: 31340kb

input:

2000 0
212 40 232 87 79 203 233 171 143 9 124 97 47 54 250 185 169 100 244 253 120 131 85 195 8 234 73 7 171 247 118 184 64 132 82 42 64 116 53 137 155 33 87 164 160 6 168 102 125 31 63 39 229 76 16 65 100 244 26 83 73 232 85 146 135 196 233 175 96 240 214 248 208 164 128 8 29 60 103 140 214 151 114...

output:

852

result:

ok "852"

Test #26:

score: 15
Accepted
time: 7ms
memory: 32928kb

input:

2000 0
228 227 120 56 250 38 238 224 14 1 239 70 20 90 235 248 114 33 47 210 111 244 218 72 51 144 243 191 168 149 165 105 89 224 147 217 17 46 79 207 48 94 182 80 209 145 45 40 47 255 3 118 55 96 6 172 35 130 26 116 40 68 68 102 184 92 10 94 52 66 53 237 6 189 28 16 106 208 50 33 68 24 249 191 102 ...

output:

863

result:

ok "863"

Test #27:

score: 15
Accepted
time: 3ms
memory: 34228kb

input:

2000 0
510 427 155 433 37 348 174 418 481 8 170 485 274 110 187 213 285 60 125 460 135 101 299 75 83 33 268 169 125 472 46 363 60 155 232 365 4 213 384 468 6 404 133 201 483 251 129 319 129 505 71 261 251 76 460 122 65 387 507 149 432 372 200 243 499 394 440 239 284 93 298 154 35 416 156 474 494 116...

output:

866

result:

ok "866"

Test #28:

score: 15
Accepted
time: 5ms
memory: 32520kb

input:

2000 0
354 297 56 124 319 256 97 329 474 344 18 227 225 116 272 259 287 6 411 222 281 145 104 62 84 239 320 231 424 262 323 232 278 142 84 288 11 323 322 482 405 108 223 168 381 137 191 8 15 466 220 360 450 109 109 243 226 340 504 102 371 197 219 6 174 248 314 401 4 396 69 179 158 18 294 197 412 498...

output:

864

result:

ok "864"

Test #29:

score: 15
Accepted
time: 6ms
memory: 31492kb

input:

2000 0
393 713 332 785 736 132 371 355 885 858 647 475 461 236 796 95 786 256 736 260 862 1020 895 868 364 1018 75 856 217 269 567 759 553 133 647 397 651 167 171 651 1006 5 833 305 300 578 438 242 790 902 810 973 625 232 838 205 231 796 453 274 851 632 111 269 885 482 875 156 558 218 384 382 110 75...

output:

859

result:

ok "859"

Test #30:

score: 15
Accepted
time: 5ms
memory: 32536kb

input:

2000 0
836 681 896 743 896 179 455 358 975 7 681 109 434 847 226 878 352 835 665 569 694 543 35 103 719 764 921 671 739 70 972 467 1001 835 613 209 593 617 940 69 170 622 651 981 309 191 492 513 811 909 74 527 511 222 565 304 415 17 695 332 474 237 519 568 118 86 22 185 174 690 977 404 502 600 965 6...

output:

889

result:

ok "889"

Subtask #3:

score: 20
Accepted

Test #31:

score: 20
Accepted
time: 146ms
memory: 84124kb

input:

200000 0
1 2 2 2 2 2 2 1 1 2 2 1 1 1 2 1 1 1 2 1 2 1 1 1 2 1 1 1 1 2 2 2 2 2 1 2 2 1 2 1 1 2 2 2 2 1 2 2 1 2 1 1 2 1 1 2 1 2 2 1 2 2 2 1 1 2 1 1 1 2 2 2 2 1 1 2 2 1 1 2 1 2 2 2 2 2 1 1 2 2 2 2 1 2 1 2 2 2 1 2 2 2 2 1 2 2 2 1 1 1 2 2 1 2 2 2 1 1 1 1 1 2 1 2 1 2 1 2 1 2 1 2 2 1 2 2 2 1 1 1 2 1 2 1 1 1...

output:

99478

result:

ok "99478"

Test #32:

score: 20
Accepted
time: 154ms
memory: 85728kb

input:

200000 0
1 2 2 2 2 2 1 1 2 1 2 1 1 1 2 2 2 2 2 1 1 1 2 2 2 1 1 2 2 1 2 2 2 2 1 2 1 1 2 1 1 2 2 2 2 2 1 2 1 2 1 2 1 1 2 1 1 2 1 2 1 2 2 1 1 1 1 1 1 1 1 2 2 1 2 2 1 1 2 2 2 2 2 2 2 1 2 1 1 1 2 2 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1 1 1 2 1 1 1 1 1 2 1 2 1 2 2 2 1 1 2 1 2 1 2 2 2 2 1 1 1 1 2 1 1 2 2 1 1...

output:

99594

result:

ok "99594"

Test #33:

score: 20
Accepted
time: 145ms
memory: 87340kb

input:

200000 0
2 4 1 2 1 3 3 1 3 1 4 4 4 3 3 4 1 3 2 2 3 1 4 2 2 2 3 2 4 2 2 1 3 1 1 1 1 3 1 2 2 3 3 1 2 1 4 4 1 1 2 1 3 4 3 4 4 3 1 3 4 2 4 3 3 2 4 4 1 2 1 4 2 1 1 2 2 3 2 2 1 4 2 3 3 1 3 1 2 3 4 3 4 1 2 2 1 3 3 2 1 2 3 1 2 1 3 3 2 1 3 1 3 3 3 4 4 3 3 2 2 3 2 2 1 2 3 1 3 4 1 1 4 2 1 4 4 3 3 3 2 2 3 4 1 2...

output:

99667

result:

ok "99667"

Test #34:

score: 20
Accepted
time: 154ms
memory: 89012kb

input:

200000 0
3 4 3 3 3 3 2 3 2 1 4 2 2 1 3 2 1 3 4 4 4 4 2 1 4 4 3 3 4 3 4 4 4 3 4 4 1 1 2 1 1 1 4 1 1 1 3 4 2 4 1 2 4 1 2 2 3 1 1 4 4 2 3 1 3 2 4 3 1 4 4 4 2 4 4 1 4 4 3 3 4 1 1 1 1 2 3 4 1 2 1 4 2 2 2 2 1 2 1 1 2 2 2 2 2 1 4 1 2 3 3 2 2 1 1 4 2 2 2 1 4 2 2 2 3 2 2 4 1 1 1 3 4 4 4 2 2 4 3 3 3 4 4 2 3 2...

output:

99643

result:

ok "99643"

Test #35:

score: 20
Accepted
time: 169ms
memory: 94388kb

input:

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

output:

99389

result:

ok "99389"

Test #36:

score: 20
Accepted
time: 156ms
memory: 92784kb

input:

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

output:

99441

result:

ok "99441"

Test #37:

score: 20
Accepted
time: 165ms
memory: 98448kb

input:

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

output:

99045

result:

ok "99045"

Test #38:

score: 20
Accepted
time: 168ms
memory: 98704kb

input:

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

output:

99156

result:

ok "99156"

Test #39:

score: 20
Accepted
time: 173ms
memory: 103320kb

input:

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

output:

98956

result:

ok "98956"

Test #40:

score: 20
Accepted
time: 190ms
memory: 104112kb

input:

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

output:

98991

result:

ok "98991"

Test #41:

score: 20
Accepted
time: 171ms
memory: 110184kb

input:

200000 0
18 41 7 17 44 19 29 6 33 4 47 6 6 20 62 61 62 11 26 30 7 40 64 10 16 3 36 4 58 14 63 34 56 47 17 30 7 51 41 47 51 49 3 25 55 31 11 47 64 24 19 20 35 20 59 55 63 11 9 38 57 44 44 43 1 12 34 38 61 26 54 55 31 6 50 56 23 52 22 48 61 17 41 15 56 51 40 6 49 63 36 23 49 33 1 16 39 52 53 62 46 58 ...

output:

98641

result:

ok "98641"

Test #42:

score: 20
Accepted
time: 179ms
memory: 110420kb

input:

200000 0
43 22 32 51 60 34 58 47 26 19 5 37 4 13 24 31 61 57 28 29 41 3 8 41 35 22 54 43 62 47 59 51 56 4 27 64 31 9 52 34 11 26 52 10 61 54 57 34 4 50 6 42 33 27 12 31 32 23 23 34 11 46 7 38 50 54 45 42 5 43 49 51 29 26 32 38 59 10 26 52 47 23 42 8 5 32 26 34 43 34 4 58 25 49 10 10 13 21 34 28 21 3...

output:

98919

result:

ok "98919"

Test #43:

score: 20
Accepted
time: 204ms
memory: 118384kb

input:

200000 0
98 94 35 1 96 18 110 109 11 50 90 115 51 92 66 28 122 92 100 66 24 3 83 62 82 58 7 14 91 42 78 127 94 53 41 60 9 78 119 52 49 77 72 102 45 116 105 33 7 15 73 77 111 120 16 54 43 31 83 58 51 82 99 94 90 113 5 5 117 44 9 51 122 16 122 78 6 62 95 22 73 34 13 61 67 64 100 2 79 17 114 104 29 90 ...

output:

98081

result:

ok "98081"

Test #44:

score: 20
Accepted
time: 182ms
memory: 116676kb

input:

200000 0
126 5 109 42 49 64 125 115 1 9 126 93 109 32 14 49 128 33 89 85 57 32 83 68 50 71 126 127 100 61 96 46 60 35 16 40 94 20 120 114 71 94 5 48 17 9 11 109 98 22 91 46 51 48 14 24 125 74 66 35 89 30 45 66 32 56 36 99 65 7 49 127 58 94 26 50 45 84 84 125 72 38 106 76 99 6 10 80 33 40 113 57 49 1...

output:

98265

result:

ok "98265"

Test #45:

score: 20
Accepted
time: 215ms
memory: 125124kb

input:

200000 0
185 162 150 140 42 147 34 92 222 116 202 249 98 69 37 118 84 184 191 153 172 191 233 209 81 228 247 148 141 130 218 215 122 138 73 248 224 31 25 99 182 243 202 17 166 45 106 2 1 240 137 32 217 67 18 58 233 166 111 83 42 225 64 12 128 173 143 144 218 166 188 218 140 191 136 184 201 86 173 72...

output:

97671

result:

ok "97671"

Test #46:

score: 20
Accepted
time: 212ms
memory: 120904kb

input:

200000 0
159 14 60 165 77 36 205 90 212 219 236 207 192 83 166 52 196 42 245 11 214 189 206 242 70 190 13 93 2 83 31 114 157 38 97 79 1 16 203 53 40 208 108 242 214 191 237 160 77 214 130 228 171 235 24 154 228 196 96 26 72 52 30 233 249 60 150 219 111 24 131 243 255 73 124 180 175 57 111 196 131 18...

output:

97706

result:

ok "97706"

Test #47:

score: 20
Accepted
time: 211ms
memory: 129144kb

input:

200000 0
232 360 98 161 71 183 249 330 303 263 492 137 124 415 353 376 421 135 128 31 342 510 225 233 371 279 312 37 396 59 382 43 20 206 307 338 311 423 454 478 241 204 389 65 35 512 503 357 95 258 490 63 299 39 371 105 230 181 456 343 453 476 389 3 40 291 335 11 366 201 58 19 221 185 21 381 322 25...

output:

96826

result:

ok "96826"

Test #48:

score: 20
Accepted
time: 225ms
memory: 129796kb

input:

200000 0
341 444 28 12 172 427 315 420 447 449 401 134 473 397 180 63 272 127 287 230 174 175 481 27 388 394 70 146 481 100 483 44 282 292 81 266 432 265 433 507 216 436 442 50 173 216 59 284 385 285 100 137 240 407 298 482 234 455 246 231 428 6 441 471 29 305 285 494 228 395 463 203 238 404 16 119 ...

output:

97015

result:

ok "97015"

Test #49:

score: 20
Accepted
time: 244ms
memory: 135044kb

input:

200000 0
278 461 46 824 614 834 662 290 378 214 72 575 616 29 696 513 704 78 554 776 991 152 221 21 278 284 920 163 867 70 602 248 250 932 671 975 950 226 957 437 767 205 396 480 304 562 993 785 1000 276 861 263 250 737 958 185 723 627 615 142 739 761 7 653 209 1021 400 14 655 600 347 954 694 394 55...

output:

95590

result:

ok "95590"

Test #50:

score: 20
Accepted
time: 241ms
memory: 135776kb

input:

200000 0
629 413 500 592 649 1 867 473 342 620 330 785 772 562 524 777 146 497 192 603 362 267 122 554 328 183 572 786 794 142 822 908 168 432 858 504 64 628 319 893 628 211 57 709 384 597 193 316 66 699 79 418 458 999 477 288 138 133 254 213 1005 930 79 273 771 572 400 995 395 348 217 88 959 743 50...

output:

96057

result:

ok "96057"

Test #51:

score: 20
Accepted
time: 275ms
memory: 142072kb

input:

200000 0
1477 526 106 494 1384 558 275 1285 209 1640 1182 685 679 828 209 1783 1560 1884 1316 421 702 682 1918 896 260 1410 888 513 983 581 393 1803 1358 237 840 26 1523 21 1358 522 272 1613 804 336 1919 10 65 326 1451 558 1267 1643 1008 1802 509 31 1008 1574 651 1155 599 92 360 1857 1942 1935 1347 ...

output:

94244

result:

ok "94244"

Test #52:

score: 20
Accepted
time: 270ms
memory: 141476kb

input:

200000 0
1972 147 127 1715 994 210 685 994 1863 61 65 1196 1496 840 1675 1323 1552 1721 348 41 1646 1128 397 1666 975 623 518 1011 1235 1197 1210 1441 1613 860 712 1702 656 878 452 973 846 648 1033 730 91 1892 26 1051 1143 1600 1978 1108 1057 1962 1134 84 965 167 1554 1141 1048 721 1638 1343 6 1787 ...

output:

94161

result:

ok "94161"

Test #53:

score: 20
Accepted
time: 303ms
memory: 151580kb

input:

200000 0
1341 3309 846 1742 2279 501 870 3994 900 359 1640 899 1137 1514 2428 933 2132 1202 3324 2831 2359 2774 1776 589 1472 2620 2121 1852 3332 757 1899 3476 3817 528 1403 3473 3234 1128 79 3366 270 2322 3162 2354 1936 2082 2061 787 1127 798 837 463 235 4009 3391 2454 2757 2387 64 299 1117 1521 39...

output:

92483

result:

ok "92483"

Test #54:

score: 20
Accepted
time: 298ms
memory: 149536kb

input:

200000 0
524 1074 2931 859 4003 903 1408 3112 2455 3158 763 3145 1321 862 2824 603 3491 1934 212 2171 2524 2533 975 1290 274 2166 2457 2726 1348 4041 10 2208 2507 2793 3797 3157 3132 3315 1289 989 108 212 1564 648 61 3207 2816 2478 1133 3178 3303 673 2571 1055 3739 2320 2352 4094 3476 4043 2551 9 29...

output:

92515

result:

ok "92515"

Test #55:

score: 20
Accepted
time: 349ms
memory: 155472kb

input:

200000 0
545 3440 3256 3758 169 3124 2814 4446 3673 5414 475 5479 3246 2916 3951 4150 2321 2017 2945 2278 5856 3340 455 7121 1836 1876 1778 5051 3282 8108 4203 1450 4688 2434 8127 2303 2310 2303 3639 1484 26 7206 7214 2498 590 4579 5272 2407 1778 2178 3582 6928 1422 5358 7241 7561 6296 5747 1532 414...

output:

90478

result:

ok "90478"

Test #56:

score: 20
Accepted
time: 340ms
memory: 157228kb

input:

200000 0
6555 2777 2744 7295 2924 6368 1886 1851 2093 5717 4801 5701 3270 2251 5794 6999 5703 5578 6020 4169 4239 4308 4068 5224 4947 1069 4747 7042 7795 3072 6182 7255 7319 3156 1722 7259 4459 4209 6242 2297 3466 5187 266 1167 7259 5306 1933 740 4523 7351 4140 3236 319 7455 5441 5910 2421 3385 3049...

output:

90139

result:

ok "90139"

Test #57:

score: 20
Accepted
time: 315ms
memory: 163980kb

input:

200000 0
8063 263 211 10655 6078 16190 11348 15618 15841 15503 5228 15536 1674 184 10629 3793 8682 3529 10848 1082 7710 15012 11017 7292 10042 7252 6827 1388 11919 5302 15713 2175 311 11563 10017 2292 5914 13507 1758 2342 15046 11356 12337 7545 913 13694 7374 13226 3085 10510 10329 10155 13450 12212...

output:

88332

result:

ok "88332"

Test #58:

score: 20
Accepted
time: 332ms
memory: 161952kb

input:

200000 0
13676 14198 4693 26 9041 13446 1372 13510 10505 10043 6790 4772 2349 6519 13876 14237 5677 8286 12193 1912 926 8000 5417 11187 5042 9760 11205 6126 3216 2135 6306 1476 4694 8236 12713 1207 10323 870 9751 14673 6411 2064 3558 8546 3876 13806 7748 1410 12978 14692 9117 6835 8228 14796 3467 19...

output:

88288

result:

ok "88288"

Test #59:

score: 20
Accepted
time: 317ms
memory: 170892kb

input:

200000 0
11707 279 29710 31692 7327 27020 27139 26667 14285 10895 2965 29687 32472 30371 16878 3950 16110 11936 3228 9071 1938 3785 29761 28253 15272 23413 20810 30353 27762 18758 12319 26764 14537 21575 26159 11228 19728 9233 10574 18689 25272 12290 24921 23837 30846 13492 26143 13558 32711 5386 45...

output:

87066

result:

ok "87066"

Test #60:

score: 20
Accepted
time: 339ms
memory: 171328kb

input:

200000 0
27565 17854 31918 27205 20203 25256 15105 14527 13413 22977 8391 15770 25761 24288 20546 12881 19836 23937 15369 8830 21571 7779 802 18843 14742 4989 14113 22588 6888 23713 15581 28362 24083 15056 10222 21968 30609 364 29418 1745 18131 17998 12522 22441 15536 28816 25141 23127 25364 17780 3...

output:

87022

result:

ok "87022"

Subtask #4:

score: 15
Accepted

Test #61:

score: 15
Accepted
time: 866ms
memory: 84256kb

input:

200000 200000
1 2 1 2 2 1 2 1 2 1 1 2 1 1 2 1 1 2 1 2 2 1 2 2 2 1 2 2 2 2 2 1 2 1 2 1 1 2 1 1 2 2 2 1 1 2 2 1 2 1 2 1 1 2 1 2 2 2 1 2 1 2 1 1 1 1 2 1 1 1 1 1 1 1 2 2 2 2 2 2 2 1 1 2 2 1 2 2 2 2 2 1 1 1 2 2 2 1 1 1 1 1 1 1 2 2 1 2 2 1 1 1 1 1 2 2 2 2 2 2 1 1 2 2 2 1 2 2 2 2 1 1 1 2 2 1 2 2 2 1 1 1 2 ...

output:

99575
99575
99575
99575
99574
99573
99573
99574
99575
99575
99575
99575
99576
99575
99575
99574
99574
99574
99575
99576
99576
99575
99574
99573
99574
99575
99575
99576
99575
99574
99573
99573
99573
99572
99572
99571
99572
99571
99571
99571
99572
99572
99571
99572
99572
99572
99572
99572
99571
99571
...

result:

ok 200001 tokens

Test #62:

score: 15
Accepted
time: 892ms
memory: 88520kb

input:

200000 200000
2 2 1 1 1 2 1 2 1 2 2 1 2 2 1 1 2 1 1 2 1 2 2 2 2 1 2 2 2 2 1 1 2 1 2 2 1 1 1 1 1 1 1 1 2 1 2 2 2 1 1 2 2 2 2 1 1 2 2 1 2 2 2 2 1 1 1 1 2 2 2 1 1 2 2 2 1 1 2 1 2 2 2 2 1 2 1 1 2 2 2 2 2 2 2 1 2 1 2 2 2 2 1 1 2 2 2 1 1 2 2 2 2 1 2 1 2 2 1 2 2 2 2 1 2 1 2 1 1 1 2 2 2 2 1 1 1 1 1 2 1 1 2 ...

output:

99732
99733
99734
99733
99732
99732
99732
99732
99732
99732
99731
99730
99731
99731
99731
99731
99731
99730
99731
99731
99731
99731
99732
99733
99732
99732
99733
99733
99733
99733
99733
99733
99733
99733
99733
99732
99733
99732
99731
99730
99731
99732
99733
99733
99733
99733
99732
99732
99732
99731
...

result:

ok 200001 tokens

Test #63:

score: 15
Accepted
time: 849ms
memory: 87744kb

input:

200000 200000
2 1 1 2 2 1 1 1 1 2 1 2 2 2 1 2 2 1 2 2 1 1 1 2 1 1 1 1 1 2 1 1 2 2 2 2 2 1 2 2 2 1 1 1 2 1 1 1 2 1 1 1 2 2 1 2 1 2 1 1 1 2 1 1 2 1 1 2 2 2 1 1 1 1 1 1 1 1 2 1 2 1 2 2 2 1 2 1 1 2 1 1 2 1 1 2 1 1 1 1 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2 2 1 2 2 2 1 1 1 2 2 1 2 1 2 2 1 2 1 1 2 2 1 2 1 1 2 1 1 ...

output:

99568
99568
99568
99567
99567
99568
99569
99569
99568
99568
99567
99567
99566
99565
99564
99564
99563
99564
99564
99565
99566
99567
99567
99568
99567
99567
99566
99565
99566
99565
99566
99567
99567
99567
99567
99567
99566
99567
99566
99566
99566
99566
99565
99566
99566
99566
99565
99564
99565
99565
...

result:

ok 200001 tokens

Test #64:

score: 15
Accepted
time: 890ms
memory: 84688kb

input:

200000 200000
2 1 1 2 2 1 1 2 2 1 2 1 2 1 1 2 1 1 1 2 1 1 2 1 2 1 1 1 1 1 1 2 1 1 2 1 1 1 1 1 2 1 2 2 1 2 1 1 2 2 1 2 1 1 2 2 1 1 2 1 1 2 1 2 1 1 2 2 1 2 2 1 1 2 2 2 2 1 1 2 2 2 1 2 1 2 1 1 2 2 2 2 1 2 2 1 2 1 2 1 1 2 1 1 1 1 2 2 2 2 1 1 1 2 2 1 1 2 2 2 1 2 1 1 1 2 2 1 1 1 2 2 1 2 2 2 2 1 2 1 2 2 1 ...

output:

99437
99437
99436
99435
99434
99434
99435
99434
99433
99433
99434
99435
99434
99435
99435
99435
99434
99434
99434
99434
99435
99436
99437
99438
99438
99438
99439
99440
99441
99442
99443
99442
99441
99440
99439
99438
99437
99438
99438
99438
99439
99438
99437
99437
99437
99438
99437
99437
99438
99437
...

result:

ok 200001 tokens

Test #65:

score: 15
Accepted
time: 887ms
memory: 87108kb

input:

200000 200000
2 1 2 2 2 2 2 2 1 1 1 1 1 1 1 1 2 2 1 1 2 1 1 1 1 2 2 1 2 1 1 2 2 2 1 1 2 1 1 1 1 2 1 2 2 2 2 2 2 1 2 2 2 2 1 2 2 2 2 1 1 2 1 1 1 2 1 2 1 1 2 2 2 2 1 1 1 2 1 2 1 2 2 1 1 2 1 2 2 2 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1 1 2 2 2 1 2 1 2 2 1 2 1 2 2 2 2 1 2 2 2 2 1 1 2 2 1 1 2 1 2 1 2 1 1 1 1 2 1 ...

output:

99598
99597
99597
99597
99596
99596
99595
99594
99594
99593
99593
99593
99593
99593
99593
99592
99592
99592
99591
99592
99591
99592
99592
99592
99592
99592
99592
99593
99593
99594
99593
99593
99592
99592
99593
99594
99594
99595
99594
99594
99595
99596
99596
99596
99596
99596
99597
99598
99598
99598
...

result:

ok 200001 tokens

Test #66:

score: 15
Accepted
time: 910ms
memory: 85660kb

input:

200000 200000
1 2 1 2 2 2 2 1 2 2 2 1 1 2 2 2 1 2 2 1 2 2 2 1 1 1 2 2 1 2 1 2 2 1 1 2 1 2 1 1 1 1 2 2 2 2 1 2 2 1 2 2 1 1 2 1 1 2 2 2 2 2 2 2 1 2 1 2 2 2 2 1 1 2 2 2 2 1 2 1 2 1 1 2 1 1 2 1 1 1 1 1 2 2 2 2 1 2 1 1 1 2 2 2 2 2 1 1 1 2 2 2 2 2 2 1 1 1 2 1 2 1 2 2 1 1 2 2 1 2 2 1 1 1 1 1 2 1 2 2 1 2 1 ...

output:

99829
99828
99829
99829
99830
99831
99831
99831
99830
99829
99830
99830
99830
99831
99831
99831
99832
99832
99832
99832
99833
99833
99832
99831
99831
99831
99831
99831
99831
99830
99830
99830
99830
99829
99830
99829
99829
99829
99828
99828
99828
99827
99828
99828
99827
99827
99826
99826
99826
99827
...

result:

ok 200001 tokens

Test #67:

score: 15
Accepted
time: 858ms
memory: 86608kb

input:

200000 200000
2 1 2 2 1 1 1 1 2 2 1 2 1 2 2 2 1 2 2 2 1 2 1 1 1 1 2 1 1 2 2 1 1 1 1 2 1 1 1 1 1 2 1 1 2 2 2 1 2 1 2 1 2 2 1 1 1 1 2 1 1 2 2 2 2 2 2 1 2 1 1 2 1 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 1 2 2 2 1 2 2 2 2 2 1 2 1 2 2 1 2 1 1 2 2 2 1 2 2 2 1 1 2 1 1 1 2 2 1 2 2 1 2 2 2 2 2 1 2 2 1 1 ...

output:

99690
99690
99689
99689
99689
99688
99687
99687
99687
99688
99688
99688
99688
99687
99687
99688
99688
99688
99688
99687
99687
99687
99688
99688
99687
99687
99687
99687
99687
99688
99689
99688
99688
99688
99689
99690
99691
99691
99692
99692
99691
99691
99690
99690
99691
99690
99690
99691
99691
99691
...

result:

ok 200001 tokens

Test #68:

score: 15
Accepted
time: 868ms
memory: 84548kb

input:

200000 200000
2 1 2 2 2 1 1 1 2 2 1 2 2 2 2 2 2 2 2 2 1 1 2 1 1 1 2 1 2 1 1 1 2 2 2 2 2 1 2 1 1 1 2 2 2 2 2 1 2 2 1 2 2 2 1 2 1 2 1 2 1 1 1 2 1 2 2 1 2 1 1 1 2 1 1 1 1 2 1 2 2 1 1 1 1 2 2 2 1 1 1 2 1 2 1 2 2 2 2 1 2 1 1 1 2 2 2 1 1 2 1 1 1 2 1 1 1 2 1 2 1 1 1 1 2 1 2 1 1 2 2 1 2 1 2 1 2 1 1 1 1 1 1 ...

output:

99504
99505
99506
99507
99507
99507
99508
99509
99508
99509
99509
99510
99511
99511
99511
99512
99512
99512
99511
99510
99510
99511
99510
99509
99509
99509
99509
99509
99508
99509
99509
99509
99510
99510
99509
99509
99509
99509
99508
99507
99506
99506
99506
99506
99506
99507
99508
99508
99508
99508
...

result:

ok 200001 tokens

Test #69:

score: 15
Accepted
time: 819ms
memory: 87048kb

input:

200000 200000
2 1 1 2 2 1 1 1 1 1 2 1 2 2 1 1 2 2 2 1 1 1 1 1 1 2 2 2 2 1 1 2 1 2 2 1 1 1 2 1 2 2 2 1 2 1 2 2 1 1 2 2 1 2 2 2 2 1 2 1 1 2 1 2 1 1 2 2 2 1 2 1 2 2 2 2 2 1 1 1 1 2 2 2 2 2 1 2 1 1 1 1 2 2 2 2 1 2 2 1 2 1 1 1 1 1 2 1 2 1 1 2 1 2 1 2 1 2 2 2 2 2 2 2 2 2 1 1 2 1 1 1 1 1 2 1 2 2 2 1 1 2 2 ...

output:

99681
99682
99682
99682
99681
99681
99682
99682
99682
99682
99681
99682
99681
99681
99682
99682
99682
99683
99684
99683
99683
99684
99685
99686
99686
99686
99686
99685
99685
99685
99686
99687
99686
99685
99685
99685
99686
99686
99685
99685
99685
99684
99684
99683
99683
99684
99684
99685
99686
99686
...

result:

ok 200001 tokens

Test #70:

score: 15
Accepted
time: 863ms
memory: 87060kb

input:

200000 200000
1 1 2 2 1 1 1 2 1 2 1 1 1 1 2 2 1 2 1 2 2 2 1 1 1 2 2 2 1 1 1 2 2 2 1 2 1 2 2 2 2 2 2 1 1 2 1 2 2 2 2 1 2 1 2 1 1 1 1 1 2 1 1 1 2 2 1 2 1 2 2 1 1 2 2 2 1 2 2 2 1 2 2 2 1 1 1 2 2 2 2 2 1 2 1 1 1 2 2 1 1 1 1 2 1 2 2 2 2 2 2 1 2 2 1 1 2 2 2 2 2 2 1 1 1 1 1 2 1 1 2 2 2 2 2 1 1 2 1 1 2 1 1 ...

output:

99505
99504
99503
99503
99504
99505
99505
99505
99505
99505
99506
99507
99506
99506
99505
99505
99505
99505
99506
99506
99505
99506
99506
99506
99507
99507
99507
99507
99508
99509
99510
99510
99509
99509
99509
99509
99509
99509
99508
99509
99508
99508
99507
99507
99507
99506
99506
99506
99507
99507
...

result:

ok 200001 tokens

Subtask #5:

score: 20
Accepted

Test #71:

score: 20
Accepted
time: 382ms
memory: 63136kb

input:

100000 100000
2 1 1 1 1 1 1 2 2 2 2 1 2 1 1 1 2 2 1 2 1 2 2 2 2 2 2 2 1 2 2 2 1 1 1 1 1 2 2 2 2 1 1 2 2 2 1 2 2 1 2 1 2 2 2 2 1 2 1 1 1 2 2 2 1 1 2 1 1 1 2 1 2 2 2 1 1 2 1 1 2 1 1 1 1 1 1 1 2 2 1 1 2 1 2 1 2 1 2 2 2 2 2 2 2 1 1 1 1 2 1 2 1 1 1 1 2 2 2 1 2 1 1 1 2 2 2 1 1 2 1 2 2 2 2 2 1 1 2 1 1 1 1 ...

output:

49860
49859
49859
49859
49858
49858
49858
49859
49858
49858
49857
49858
49858
49857
49856
49855
49854
49854
49854
49854
49854
49854
49854
49854
49853
49853
49854
49854
49855
49855
49854
49854
49853
49852
49852
49852
49852
49851
49851
49852
49852
49851
49850
49849
49849
49849
49849
49848
49848
49848
...

result:

ok 100001 tokens

Test #72:

score: 20
Accepted
time: 370ms
memory: 61432kb

input:

100000 100000
2 2 1 1 1 2 2 2 1 2 1 2 2 2 2 1 2 2 1 2 2 2 1 1 1 1 2 2 1 2 1 1 2 1 2 1 2 2 1 2 1 2 1 1 2 2 2 1 2 1 1 1 1 1 2 1 2 2 1 1 1 1 2 2 2 2 1 2 2 1 1 2 2 1 2 2 2 1 1 1 2 2 2 2 1 2 2 1 2 2 1 1 1 2 1 1 2 1 2 2 2 1 1 1 2 1 1 2 2 1 1 1 1 2 2 1 2 1 1 1 2 2 1 1 1 2 2 1 1 1 2 2 2 1 2 1 2 2 2 2 1 2 1 ...

output:

49869
49870
49871
49871
49872
49872
49871
49872
49872
49871
49871
49870
49870
49871
49871
49870
49869
49870
49870
49870
49871
49871
49871
49872
49873
49872
49873
49873
49873
49873
49873
49874
49874
49874
49874
49875
49874
49875
49876
49875
49876
49876
49876
49876
49876
49876
49876
49876
49875
49874
...

result:

ok 100001 tokens

Test #73:

score: 20
Accepted
time: 463ms
memory: 64104kb

input:

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

output:

49452
49452
49452
49451
49451
49452
49451
49451
49451
49450
49450
49451
49450
49449
49449
49449
49450
49449
49448
49448
49447
49446
49446
49446
49447
49447
49448
49448
49448
49448
49448
49449
49449
49450
49451
49451
49451
49451
49451
49451
49451
49452
49453
49454
49455
49456
49456
49456
49455
49455
...

result:

ok 100001 tokens

Test #74:

score: 20
Accepted
time: 459ms
memory: 66148kb

input:

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

output:

49676
49675
49675
49675
49675
49676
49676
49677
49677
49677
49676
49677
49678
49678
49678
49677
49677
49677
49677
49677
49678
49679
49679
49679
49679
49680
49680
49680
49680
49680
49680
49680
49681
49682
49683
49683
49684
49685
49685
49684
49683
49683
49684
49684
49684
49684
49685
49685
49686
49686
...

result:

ok 100001 tokens

Test #75:

score: 20
Accepted
time: 486ms
memory: 71880kb

input:

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

output:

49692
49691
49691
49690
49690
49690
49690
49690
49690
49689
49690
49690
49690
49690
49691
49691
49691
49690
49690
49689
49688
49688
49688
49687
49686
49685
49684
49684
49683
49682
49683
49682
49682
49682
49682
49681
49680
49681
49681
49682
49682
49682
49682
49682
49682
49682
49683
49684
49685
49685
...

result:

ok 100001 tokens

Test #76:

score: 20
Accepted
time: 487ms
memory: 70008kb

input:

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

output:

49666
49666
49667
49666
49667
49668
49667
49666
49667
49667
49668
49668
49668
49668
49668
49669
49668
49668
49667
49668
49667
49668
49668
49668
49668
49667
49668
49669
49670
49671
49671
49671
49671
49671
49672
49673
49673
49673
49673
49672
49672
49672
49671
49671
49672
49672
49672
49671
49671
49672
...

result:

ok 100001 tokens

Test #77:

score: 20
Accepted
time: 539ms
memory: 76180kb

input:

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

output:

49442
49442
49441
49440
49441
49441
49440
49439
49440
49440
49439
49438
49438
49437
49436
49436
49436
49436
49435
49434
49434
49434
49434
49433
49434
49435
49434
49434
49434
49434
49433
49433
49433
49433
49432
49432
49432
49432
49432
49432
49433
49432
49432
49432
49432
49432
49433
49432
49432
49433
...

result:

ok 100001 tokens

Test #78:

score: 20
Accepted
time: 557ms
memory: 77676kb

input:

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

output:

49476
49477
49478
49477
49478
49478
49479
49480
49479
49479
49479
49479
49479
49480
49480
49479
49480
49479
49480
49481
49482
49482
49481
49480
49480
49479
49479
49479
49479
49478
49478
49479
49479
49479
49479
49479
49478
49479
49479
49479
49479
49479
49479
49480
49481
49481
49481
49481
49481
49480
...

result:

ok 100001 tokens

Test #79:

score: 20
Accepted
time: 568ms
memory: 82448kb

input:

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

output:

49517
49516
49516
49516
49516
49516
49516
49516
49517
49518
49518
49518
49519
49520
49521
49522
49522
49523
49523
49523
49524
49524
49523
49523
49523
49523
49522
49523
49523
49522
49522
49521
49522
49522
49522
49521
49521
49521
49520
49520
49520
49520
49520
49520
49520
49520
49520
49521
49521
49522
...

result:

ok 100001 tokens

Test #80:

score: 20
Accepted
time: 592ms
memory: 80712kb

input:

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

output:

49276
49276
49275
49275
49275
49276
49277
49277
49277
49278
49277
49277
49278
49278
49279
49278
49277
49276
49277
49278
49279
49280
49280
49281
49280
49280
49279
49279
49278
49279
49279
49279
49278
49279
49280
49279
49280
49280
49280
49279
49280
49281
49280
49280
49280
49281
49280
49281
49280
49280
...

result:

ok 100001 tokens

Test #81:

score: 20
Accepted
time: 606ms
memory: 85332kb

input:

100000 100000
19 34 10 55 34 8 41 25 38 1 64 28 56 39 61 44 12 42 53 47 33 58 9 21 52 7 49 19 29 57 53 39 15 8 46 60 61 30 56 6 54 53 25 58 51 28 10 14 53 13 16 16 18 36 37 54 21 13 29 57 36 2 1 5 18 46 1 59 28 47 37 27 31 26 15 50 30 60 19 4 2 18 44 46 45 34 17 6 39 14 7 33 40 62 59 18 17 36 15 11 ...

output:

49064
49063
49062
49062
49062
49061
49061
49060
49060
49060
49060
49060
49060
49060
49059
49059
49059
49059
49060
49059
49060
49061
49060
49061
49061
49061
49062
49062
49063
49062
49062
49063
49062
49062
49061
49062
49061
49061
49061
49062
49062
49063
49063
49062
49062
49063
49062
49062
49063
49064
...

result:

ok 100001 tokens

Test #82:

score: 20
Accepted
time: 644ms
memory: 89660kb

input:

100000 100000
20 56 8 35 5 20 5 33 6 46 52 6 10 15 19 40 38 23 40 50 26 27 25 34 45 46 58 51 18 29 44 16 7 39 32 30 28 55 34 11 36 46 39 11 10 15 55 8 25 57 60 11 4 35 12 31 31 64 40 9 24 48 39 23 11 52 44 2 45 27 13 2 9 33 30 28 61 18 6 35 46 6 29 42 34 42 51 58 39 14 16 56 46 11 17 49 47 11 6 25 4...

output:

49123
49122
49122
49122
49122
49123
49124
49125
49125
49124
49124
49124
49124
49125
49125
49124
49124
49123
49124
49124
49123
49123
49123
49122
49122
49123
49124
49123
49124
49123
49122
49122
49121
49122
49121
49120
49120
49120
49120
49120
49119
49120
49120
49120
49119
49119
49118
49118
49118
49118
...

result:

ok 100001 tokens

Test #83:

score: 20
Accepted
time: 631ms
memory: 90668kb

input:

100000 100000
48 13 113 16 50 126 25 5 16 41 9 85 68 76 39 114 44 52 88 21 39 60 124 96 33 96 53 7 54 38 117 43 71 9 89 94 94 63 13 121 107 10 49 22 65 15 125 13 31 60 100 113 61 88 51 30 108 90 20 21 75 10 107 91 74 12 75 116 52 69 15 103 62 122 23 61 12 36 88 96 5 69 95 35 124 48 80 65 68 70 103 1...

output:

48724
48724
48724
48724
48724
48724
48725
48725
48725
48726
48727
48728
48728
48727
48728
48729
48728
48729
48728
48729
48728
48728
48729
48728
48727
48728
48728
48727
48727
48727
48727
48726
48725
48725
48725
48726
48727
48728
48728
48728
48729
48728
48729
48728
48728
48728
48727
48727
48728
48729
...

result:

ok 100001 tokens

Test #84:

score: 20
Accepted
time: 673ms
memory: 94448kb

input:

100000 100000
100 113 33 10 61 96 68 19 114 4 75 63 90 31 40 49 6 42 98 50 83 107 16 123 80 70 73 37 69 22 24 5 75 55 21 22 96 76 100 126 119 18 76 123 67 63 50 13 74 31 116 89 104 73 100 31 49 82 8 114 26 25 79 59 19 90 115 15 12 18 52 19 61 25 55 49 67 65 109 70 72 45 76 123 32 59 75 93 117 49 107...

output:

48763
48764
48764
48763
48763
48764
48764
48764
48764
48764
48765
48764
48764
48764
48764
48765
48765
48765
48764
48763
48764
48765
48764
48763
48762
48762
48762
48763
48764
48763
48762
48762
48762
48763
48763
48763
48763
48763
48763
48762
48762
48763
48763
48763
48763
48762
48761
48761
48760
48761
...

result:

ok 100001 tokens

Test #85:

score: 20
Accepted
time: 703ms
memory: 100228kb

input:

100000 100000
175 25 142 240 193 61 252 60 221 64 125 143 41 142 64 77 196 178 42 250 13 125 25 182 61 107 212 75 146 39 234 210 151 79 219 5 160 51 34 196 86 124 107 10 238 8 247 127 109 6 114 29 251 159 202 11 225 69 7 145 256 175 126 49 195 42 178 117 48 108 119 79 154 137 25 95 91 165 73 227 122...

output:

48301
48301
48302
48302
48302
48303
48303
48304
48303
48303
48303
48303
48302
48303
48303
48303
48302
48302
48301
48301
48301
48300
48300
48301
48301
48301
48300
48300
48300
48300
48300
48301
48300
48300
48300
48301
48301
48301
48300
48300
48299
48299
48300
48300
48301
48302
48301
48301
48301
48302
...

result:

ok 100001 tokens

Test #86:

score: 20
Accepted
time: 703ms
memory: 101324kb

input:

100000 100000
107 75 230 30 149 43 171 147 169 235 147 168 132 231 125 12 12 23 32 252 143 161 133 68 123 154 111 117 164 89 48 164 109 44 151 179 26 9 230 92 114 83 199 137 27 26 106 52 192 120 17 159 13 12 225 26 117 225 96 180 125 66 83 97 169 84 222 208 147 7 28 228 247 190 17 156 41 26 116 6 20...

output:

48305
48306
48307
48308
48308
48307
48306
48306
48306
48306
48305
48305
48305
48305
48306
48306
48306
48307
48307
48306
48306
48306
48306
48306
48305
48305
48305
48304
48304
48305
48305
48304
48304
48304
48303
48303
48304
48304
48304
48305
48305
48304
48304
48304
48303
48303
48304
48305
48306
48306
...

result:

ok 100001 tokens

Test #87:

score: 20
Accepted
time: 742ms
memory: 105548kb

input:

100000 100000
158 184 26 364 149 502 96 204 25 81 177 112 273 447 69 92 287 34 439 132 32 261 319 258 158 345 492 418 293 103 415 231 12 150 407 490 86 411 407 48 216 423 203 86 105 128 502 432 486 491 258 393 304 279 56 286 239 375 280 403 442 225 418 33 191 169 227 342 397 201 216 127 193 217 281 ...

output:

47479
47479
47479
47479
47478
47479
47479
47479
47479
47480
47480
47480
47480
47480
47480
47479
47479
47478
47479
47479
47479
47479
47479
47479
47479
47480
47480
47479
47479
47478
47478
47478
47477
47477
47476
47476
47476
47476
47476
47476
47476
47476
47476
47476
47476
47477
47476
47476
47477
47476
...

result:

ok 100001 tokens

Test #88:

score: 20
Accepted
time: 718ms
memory: 107924kb

input:

100000 100000
162 2 113 232 80 339 53 323 211 251 276 371 314 26 280 510 253 264 442 371 205 289 218 216 28 434 495 156 213 493 231 455 254 336 436 160 419 55 451 311 140 288 48 280 257 186 48 427 5 67 425 301 299 128 480 245 66 480 511 336 105 44 5 222 241 343 303 143 37 491 152 198 334 104 76 434 ...

output:

47782
47782
47782
47783
47782
47782
47783
47783
47782
47783
47784
47785
47784
47784
47783
47783
47783
47784
47784
47783
47783
47783
47783
47783
47782
47782
47782
47781
47781
47781
47781
47781
47781
47780
47780
47780
47780
47779
47779
47778
47777
47777
47777
47777
47777
47777
47776
47776
47777
47777
...

result:

ok 100001 tokens

Test #89:

score: 20
Accepted
time: 779ms
memory: 115976kb

input:

100000 100000
394 530 447 794 760 152 774 216 616 750 397 648 672 17 773 303 414 89 524 484 661 523 693 965 927 995 1007 656 901 358 252 412 949 1012 61 548 64 392 784 538 626 479 955 258 993 852 255 689 884 415 418 691 165 34 335 338 474 680 530 964 538 874 119 988 230 87 926 52 847 912 297 131 278...

output:

47211
47212
47213
47213
47213
47214
47214
47215
47215
47215
47215
47214
47214
47215
47214
47215
47214
47215
47215
47215
47215
47215
47215
47215
47215
47215
47215
47215
47216
47215
47214
47214
47215
47214
47213
47214
47213
47213
47212
47211
47210
47210
47211
47210
47211
47212
47212
47211
47210
47210
...

result:

ok 100001 tokens

Test #90:

score: 20
Accepted
time: 747ms
memory: 115108kb

input:

100000 100000
569 255 794 198 622 989 820 175 732 390 617 484 977 607 165 453 133 290 432 360 947 324 121 367 602 266 101 793 427 460 532 697 215 533 731 207 248 97 11 637 885 791 919 91 445 657 748 1015 419 846 11 22 133 276 581 968 52 687 192 10 977 84 900 655 826 304 527 554 314 725 786 173 679 2...

output:

47148
47148
47148
47147
47146
47146
47146
47145
47145
47145
47144
47144
47143
47142
47142
47142
47141
47140
47139
47138
47139
47139
47140
47141
47142
47143
47144
47144
47144
47144
47144
47145
47145
47145
47145
47145
47145
47146
47146
47146
47146
47147
47146
47145
47145
47145
47145
47145
47145
47146
...

result:

ok 100001 tokens

Test #91:

score: 20
Accepted
time: 776ms
memory: 120064kb

input:

100000 100000
1714 990 329 1800 1539 1676 318 1021 425 1292 1212 1146 238 1420 1335 1335 570 157 1025 62 1289 862 548 640 1741 1423 927 1109 1897 409 73 67 191 1880 1182 1434 963 1662 29 10 858 101 1635 626 589 248 1557 1564 1706 1429 1208 246 924 218 261 1249 816 25 724 1611 3 1433 807 1162 544 984...

output:

45929
45930
45930
45930
45930
45930
45930
45929
45929
45929
45928
45927
45928
45928
45928
45927
45926
45926
45926
45925
45924
45925
45925
45926
45927
45927
45926
45927
45928
45929
45929
45928
45927
45927
45926
45926
45926
45926
45927
45928
45928
45928
45929
45928
45928
45928
45929
45930
45931
45932
...

result:

ok 100001 tokens

Test #92:

score: 20
Accepted
time: 704ms
memory: 118864kb

input:

100000 100000
42 742 213 2039 1816 921 1040 816 667 940 299 1847 388 523 109 1849 588 967 474 676 1027 1306 1873 356 781 975 1655 671 511 1412 759 1872 990 1892 896 96 603 831 397 1282 235 470 365 277 457 566 368 1681 1282 793 1082 339 785 762 1243 1837 1095 110 1210 212 1167 857 1245 202 770 1406 1...

output:

46025
46025
46024
46024
46024
46023
46023
46024
46024
46025
46025
46025
46026
46025
46026
46026
46027
46026
46026
46027
46028
46029
46030
46030
46031
46030
46030
46031
46032
46032
46032
46031
46031
46032
46032
46033
46033
46032
46033
46033
46033
46033
46032
46032
46031
46032
46033
46032
46031
46030
...

result:

ok 100001 tokens

Test #93:

score: 20
Accepted
time: 670ms
memory: 129320kb

input:

100000 100000
3459 1322 3376 1761 1317 416 92 2336 2759 766 182 3929 3010 263 465 1994 1872 3928 15 762 3777 2430 3937 2504 790 2821 1113 3391 2959 3903 2100 3084 435 1214 447 2911 697 797 2647 630 2376 2699 3453 751 1625 3794 2601 3536 471 1775 1466 2257 1614 2090 3456 1393 2390 3158 734 441 1292 3...

output:

45274
45274
45274
45273
45273
45274
45274
45274
45274
45274
45275
45275
45276
45276
45275
45275
45275
45276
45276
45276
45276
45276
45276
45276
45276
45277
45278
45279
45278
45278
45279
45279
45279
45278
45278
45279
45279
45279
45279
45278
45278
45277
45276
45277
45278
45279
45279
45278
45277
45276
...

result:

ok 100001 tokens

Test #94:

score: 20
Accepted
time: 709ms
memory: 127712kb

input:

100000 100000
1273 2756 2907 3489 1762 1707 820 1350 3912 3398 868 1867 3555 3275 134 1168 2880 1205 3581 1520 2922 3869 2553 462 555 4018 2212 925 257 1140 1290 991 2559 2620 2794 3570 2131 3624 2061 2433 781 981 236 2596 618 3853 3646 2127 1122 1180 528 2026 497 3187 3642 1120 1901 2307 1814 1012 ...

output:

45126
45125
45125
45126
45126
45125
45125
45125
45125
45124
45124
45124
45123
45123
45122
45122
45122
45122
45122
45122
45122
45123
45123
45122
45122
45122
45121
45120
45119
45119
45119
45119
45118
45118
45118
45119
45119
45119
45118
45117
45117
45117
45116
45116
45115
45116
45117
45117
45116
45116
...

result:

ok 100001 tokens

Test #95:

score: 20
Accepted
time: 631ms
memory: 133940kb

input:

100000 100000
918 1374 2569 1511 7013 2288 7022 2226 6822 1197 5432 3986 8161 846 3311 8033 8121 7388 2061 3868 6971 3114 5150 7868 7460 3131 6754 1314 5445 6135 7111 6949 4806 6477 976 5459 1947 2414 6682 1986 7925 2606 3118 3458 4912 113 7865 429 511 5190 2905 3823 7938 7421 5208 6241 2002 1935 75...

output:

44272
44273
44272
44273
44273
44273
44272
44272
44272
44273
44273
44274
44274
44275
44275
44275
44275
44276
44276
44275
44275
44275
44275
44274
44274
44274
44275
44275
44276
44275
44275
44275
44275
44275
44276
44276
44276
44276
44276
44276
44275
44274
44274
44273
44274
44275
44276
44275
44275
44275
...

result:

ok 100001 tokens

Test #96:

score: 20
Accepted
time: 632ms
memory: 134496kb

input:

100000 100000
1556 3900 1939 2875 5195 2979 3826 3024 124 5230 534 8182 4618 7309 6899 2408 5660 6971 3185 5427 4699 3682 6177 4882 3546 2599 3267 2826 1559 2712 3530 612 6601 6394 7331 3707 4500 598 7578 6604 35 2588 1726 1862 5040 6871 677 3975 482 3292 6253 8069 224 4171 3966 6734 4697 217 4044 8...

output:

44290
44291
44292
44293
44293
44293
44294
44294
44294
44295
44294
44294
44294
44293
44293
44294
44295
44294
44295
44296
44297
44297
44297
44296
44297
44297
44298
44299
44299
44300
44300
44300
44301
44301
44301
44301
44301
44302
44301
44302
44302
44301
44301
44300
44300
44300
44300
44300
44300
44300
...

result:

ok 100001 tokens

Test #97:

score: 20
Accepted
time: 584ms
memory: 141364kb

input:

100000 100000
1038 4530 2112 9479 3907 2419 9927 2503 6132 7792 432 14664 14841 11977 3043 15054 9166 3764 274 6283 1776 13289 51 6986 12078 13989 4648 3951 3957 9978 7049 6624 1352 7544 6657 11628 10189 1022 9907 5160 7886 15175 5107 2858 11839 5411 2016 4759 921 1778 14214 13833 8879 8101 10692 61...

output:

43456
43456
43456
43456
43456
43457
43458
43458
43459
43458
43457
43456
43456
43457
43457
43457
43457
43456
43456
43456
43456
43456
43457
43456
43456
43456
43456
43456
43457
43456
43456
43455
43455
43455
43454
43454
43454
43454
43453
43453
43453
43453
43452
43453
43453
43453
43453
43452
43452
43452
...

result:

ok 100001 tokens

Test #98:

score: 20
Accepted
time: 583ms
memory: 140000kb

input:

100000 100000
9331 1848 15611 14825 12931 9775 6841 1224 10627 5383 246 15594 10189 629 12013 7534 9507 10595 12245 1957 14491 5932 5538 5739 15059 10900 1072 15523 9446 10028 10328 14341 11195 13135 14882 113 9872 14258 6382 5559 15459 15192 8323 8225 10696 12368 6940 233 13678 3387 3514 4594 622 1...

output:

43491
43491
43491
43490
43491
43492
43491
43490
43489
43489
43489
43489
43489
43490
43490
43489
43489
43490
43490
43489
43489
43489
43489
43488
43488
43489
43489
43489
43488
43487
43487
43487
43486
43486
43487
43488
43488
43487
43488
43488
43488
43489
43490
43490
43490
43490
43491
43492
43492
43492
...

result:

ok 100001 tokens

Test #99:

score: 20
Accepted
time: 564ms
memory: 147492kb

input:

100000 100000
17896 4044 6759 20664 30428 25108 7597 24899 22842 20930 25158 23548 10625 4413 17599 188 19568 3602 28473 26036 470 10417 4327 4284 10463 29534 4725 8396 12390 4484 29657 6212 18345 13920 2294 23761 1756 3847 9243 29115 2255 2009 24516 21815 10784 32159 254 25713 14932 8626 4880 12416...

output:

43843
43844
43845
43844
43845
43844
43843
43843
43843
43844
43844
43844
43845
43846
43846
43846
43846
43846
43845
43845
43845
43845
43844
43843
43842
43842
43843
43843
43844
43844
43845
43846
43846
43845
43845
43845
43845
43845
43845
43846
43845
43844
43844
43843
43844
43844
43844
43844
43845
43846
...

result:

ok 100001 tokens

Test #100:

score: 20
Accepted
time: 539ms
memory: 146276kb

input:

100000 100000
31117 4043 256 21783 29960 26507 21852 27162 28851 9573 29069 19689 22079 31545 9439 1461 23038 6220 466 2411 29331 26896 5825 19812 19037 23156 21878 7393 17730 5849 1334 11379 13332 4496 17056 4109 25866 2909 13561 31909 9583 16706 19029 5467 19649 17579 11001 32700 15407 12683 14521...

output:

43712
43712
43712
43713
43712
43711
43710
43709
43709
43709
43709
43709
43709
43708
43708
43708
43707
43707
43707
43706
43707
43706
43707
43708
43709
43710
43709
43710
43710
43710
43710
43711
43711
43712
43712
43712
43713
43714
43713
43712
43712
43711
43711
43710
43711
43711
43711
43711
43710
43711
...

result:

ok 100001 tokens

Subtask #6:

score: 20
Accepted

Test #101:

score: 20
Accepted
time: 897ms
memory: 87012kb

input:

200000 200000
1 2 1 1 2 1 1 1 2 1 2 2 2 1 2 1 1 2 2 2 1 2 2 2 2 1 2 1 1 1 1 2 1 2 2 1 2 2 2 2 1 1 1 2 1 1 1 2 2 1 1 1 2 1 1 2 1 1 2 2 1 1 2 2 2 1 1 1 1 1 1 2 1 1 2 1 2 2 1 2 2 2 1 2 2 1 2 2 1 1 1 1 1 2 2 2 1 1 2 2 1 1 1 2 2 1 1 2 2 2 2 2 2 1 2 1 1 2 2 2 1 1 1 2 1 2 1 1 1 1 1 2 1 1 2 2 1 1 2 2 1 2 1 ...

output:

99491
99491
99492
99493
99494
99493
99493
99493
99493
99493
99494
99494
99495
99495
99495
99494
99494
99493
99494
99494
99495
99495
99495
99494
99494
99494
99493
99492
99492
99492
99492
99492
99493
99493
99493
99492
99491
99491
99492
99491
99492
99492
99491
99491
99492
99492
99491
99490
99490
99490
...

result:

ok 200001 tokens

Test #102:

score: 20
Accepted
time: 845ms
memory: 85848kb

input:

200000 200000
1 2 2 1 1 1 1 1 1 1 1 2 2 1 1 2 2 1 2 2 2 2 1 2 1 2 1 1 1 2 2 1 1 2 1 1 2 1 1 1 2 1 1 1 1 1 2 2 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 2 2 1 1 2 2 1 2 1 2 1 2 2 2 2 1 1 1 1 1 2 1 2 2 1 2 1 1 2 1 1 2 1 2 1 1 2 2 1 1 2 1 1 2 2 2 2 1 2 2 2 2 2 1 1 2 1 2 2 1 1 1 1 1 2 2 2 2 2 1 2 2 2 1 ...

output:

99886
99887
99887
99886
99886
99885
99886
99885
99885
99886
99885
99885
99885
99884
99885
99885
99885
99884
99885
99886
99886
99886
99885
99884
99885
99884
99883
99882
99883
99884
99884
99885
99886
99887
99887
99887
99888
99888
99889
99889
99889
99889
99889
99889
99889
99888
99888
99888
99889
99889
...

result:

ok 200001 tokens

Test #103:

score: 20
Accepted
time: 972ms
memory: 95096kb

input:

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

output:

99539
99539
99539
99539
99539
99539
99539
99540
99540
99539
99539
99538
99539
99540
99539
99540
99539
99540
99541
99541
99541
99542
99542
99542
99542
99542
99543
99543
99544
99543
99542
99542
99542
99542
99542
99541
99540
99539
99539
99539
99539
99539
99540
99540
99541
99541
99541
99541
99542
99543
...

result:

ok 200001 tokens

Test #104:

score: 20
Accepted
time: 916ms
memory: 96320kb

input:

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

output:

99577
99577
99576
99577
99576
99576
99577
99576
99577
99576
99577
99577
99577
99576
99576
99576
99576
99575
99574
99575
99574
99574
99573
99572
99573
99572
99571
99572
99572
99573
99573
99574
99575
99575
99575
99575
99576
99576
99576
99576
99576
99576
99577
99577
99576
99576
99576
99576
99576
99576
...

result:

ok 200001 tokens

Test #105:

score: 20
Accepted
time: 1128ms
memory: 106292kb

input:

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

output:

99371
99371
99371
99372
99372
99373
99373
99374
99373
99373
99373
99373
99373
99372
99373
99372
99373
99373
99372
99372
99373
99373
99372
99371
99372
99372
99372
99371
99372
99372
99372
99373
99373
99373
99373
99372
99372
99372
99372
99373
99374
99373
99373
99373
99373
99372
99372
99372
99372
99373
...

result:

ok 200001 tokens

Test #106:

score: 20
Accepted
time: 1119ms
memory: 105972kb

input:

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

output:

99283
99283
99283
99283
99283
99283
99284
99284
99284
99285
99284
99284
99285
99284
99284
99284
99283
99284
99285
99284
99285
99284
99284
99284
99284
99285
99285
99286
99286
99286
99285
99285
99286
99287
99288
99289
99288
99289
99289
99289
99290
99291
99290
99291
99291
99291
99291
99291
99290
99290
...

result:

ok 200001 tokens

Test #107:

score: 20
Accepted
time: 1201ms
memory: 116240kb

input:

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

output:

99587
99588
99588
99587
99586
99586
99587
99587
99587
99588
99587
99587
99587
99586
99585
99585
99585
99584
99583
99584
99584
99584
99585
99585
99584
99584
99585
99584
99584
99584
99584
99585
99585
99584
99584
99584
99585
99586
99586
99586
99587
99588
99588
99589
99589
99589
99588
99589
99589
99588
...

result:

ok 200001 tokens

Test #108:

score: 20
Accepted
time: 1188ms
memory: 116136kb

input:

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

output:

99375
99374
99375
99374
99374
99373
99372
99371
99371
99372
99372
99373
99372
99371
99372
99372
99373
99373
99374
99374
99373
99374
99373
99373
99374
99374
99374
99373
99373
99374
99374
99375
99376
99377
99378
99378
99377
99377
99377
99378
99379
99378
99379
99380
99380
99380
99381
99381
99382
99381
...

result:

ok 200001 tokens

Test #109:

score: 20
Accepted
time: 1299ms
memory: 128700kb

input:

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

output:

99085
99085
99086
99086
99085
99084
99083
99084
99084
99084
99084
99085
99086
99086
99087
99086
99087
99088
99088
99087
99087
99088
99087
99087
99087
99086
99085
99084
99084
99085
99086
99085
99084
99083
99083
99082
99083
99082
99082
99082
99082
99082
99083
99083
99082
99083
99083
99083
99084
99084
...

result:

ok 200001 tokens

Test #110:

score: 20
Accepted
time: 1412ms
memory: 126792kb

input:

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

output:

99007
99007
99006
99006
99006
99006
99006
99005
99005
99006
99006
99006
99005
99005
99004
99004
99004
99004
99003
99003
99003
99003
99003
99003
99004
99003
99004
99003
99004
99005
99005
99004
99004
99003
99004
99004
99003
99002
99002
99002
99001
99001
99001
99002
99002
99001
99002
99002
99001
99002
...

result:

ok 200001 tokens

Test #111:

score: 20
Accepted
time: 1400ms
memory: 139712kb

input:

200000 200000
13 49 31 11 61 16 3 9 35 20 55 62 26 49 23 54 30 27 30 41 21 15 17 38 23 62 63 15 55 40 40 40 13 40 59 32 42 17 43 11 13 18 40 60 14 40 22 19 14 30 21 41 48 26 10 31 26 48 27 42 28 1 64 55 33 51 8 54 47 11 33 63 55 2 58 4 35 45 38 55 59 10 62 39 38 59 57 31 31 56 53 41 63 7 54 53 6 60 ...

output:

98890
98890
98891
98891
98891
98890
98890
98890
98890
98890
98889
98888
98887
98887
98887
98888
98888
98888
98888
98888
98887
98886
98885
98886
98886
98886
98886
98886
98886
98887
98886
98886
98887
98886
98885
98885
98886
98886
98885
98885
98886
98886
98886
98885
98885
98886
98887
98887
98887
98888
...

result:

ok 200001 tokens

Test #112:

score: 20
Accepted
time: 1437ms
memory: 138484kb

input:

200000 200000
52 16 1 62 38 35 56 11 51 29 2 22 41 4 25 22 40 5 23 55 37 20 41 6 46 62 7 16 7 9 50 21 37 29 56 9 52 30 10 60 47 41 29 36 33 37 50 11 31 15 63 48 10 44 1 64 54 15 46 39 14 41 23 12 27 39 44 36 60 36 43 12 40 45 43 44 49 45 42 58 20 39 31 37 30 13 29 61 9 2 22 35 14 56 41 26 59 14 44 6...

output:

98499
98499
98498
98497
98498
98497
98497
98498
98498
98499
98500
98501
98500
98500
98500
98500
98500
98501
98501
98500
98501
98501
98502
98501
98501
98501
98502
98501
98500
98499
98500
98499
98499
98499
98499
98500
98500
98500
98500
98501
98502
98502
98503
98503
98503
98503
98503
98503
98504
98504
...

result:

ok 200001 tokens

Test #113:

score: 20
Accepted
time: 1480ms
memory: 153172kb

input:

200000 200000
67 25 75 53 64 87 60 49 104 124 116 42 109 88 81 53 10 101 45 109 17 94 27 115 121 31 123 70 96 14 80 89 128 21 67 81 111 56 126 48 51 103 19 49 14 15 62 107 41 49 23 71 61 69 5 12 20 78 82 64 14 55 67 20 54 87 94 19 45 104 31 101 44 17 48 114 31 123 74 70 64 76 52 11 50 96 95 71 57 1 ...

output:

98246
98245
98245
98245
98246
98245
98245
98244
98243
98243
98242
98242
98242
98242
98241
98242
98242
98241
98242
98242
98241
98241
98241
98241
98242
98242
98242
98242
98242
98241
98240
98241
98240
98240
98240
98240
98239
98238
98237
98238
98239
98239
98238
98238
98239
98240
98239
98240
98240
98241
...

result:

ok 200001 tokens

Test #114:

score: 20
Accepted
time: 1584ms
memory: 151496kb

input:

200000 200000
9 24 125 49 46 52 74 11 50 112 2 10 119 100 88 78 77 35 108 84 88 60 120 64 125 71 99 128 101 5 10 35 112 76 76 3 38 70 126 22 122 39 113 73 96 46 22 23 20 120 126 108 125 47 80 57 48 34 121 33 66 45 113 42 128 85 29 126 126 44 93 96 93 91 110 81 16 53 119 74 22 55 107 98 126 121 34 77...

output:

98286
98285
98285
98285
98286
98287
98287
98288
98288
98289
98288
98288
98288
98288
98288
98287
98286
98286
98285
98285
98285
98284
98284
98285
98284
98284
98284
98284
98283
98283
98283
98283
98284
98283
98284
98284
98284
98285
98285
98284
98283
98283
98284
98283
98283
98282
98283
98283
98282
98283
...

result:

ok 200001 tokens

Test #115:

score: 20
Accepted
time: 1776ms
memory: 165640kb

input:

200000 200000
250 181 222 222 191 157 2 100 130 172 37 5 158 160 122 243 229 177 135 84 18 111 1 105 234 209 231 73 220 117 229 80 56 222 63 72 113 180 244 254 164 251 254 58 213 126 95 132 208 72 219 102 227 126 172 74 11 192 24 33 255 48 183 25 17 175 91 145 236 58 20 190 233 168 42 232 43 227 92 ...

output:

97629
97630
97630
97629
97629
97629
97629
97629
97629
97629
97629
97630
97630
97631
97631
97632
97632
97631
97631
97631
97632
97632
97633
97632
97632
97632
97632
97632
97632
97632
97633
97633
97633
97634
97635
97635
97635
97634
97635
97634
97633
97634
97634
97634
97635
97636
97635
97634
97633
97634
...

result:

ok 200001 tokens

Test #116:

score: 20
Accepted
time: 1715ms
memory: 165716kb

input:

200000 200000
200 112 179 195 90 171 141 201 252 250 1 235 135 180 3 10 73 201 97 20 15 251 71 194 81 29 47 231 140 98 185 214 218 166 229 221 200 108 72 94 233 14 10 58 4 204 65 20 181 123 61 207 197 151 233 42 196 112 165 224 121 91 161 120 14 237 14 86 27 251 133 48 178 105 92 165 216 25 164 9 21...

output:

97841
97841
97841
97841
97841
97840
97840
97839
97840
97839
97839
97839
97838
97839
97838
97838
97838
97837
97837
97838
97839
97838
97839
97840
97841
97842
97842
97841
97841
97841
97840
97841
97842
97842
97842
97842
97843
97844
97843
97843
97843
97842
97843
97844
97844
97843
97843
97844
97843
97843
...

result:

ok 200001 tokens

Test #117:

score: 20
Accepted
time: 1742ms
memory: 178748kb

input:

200000 200000
129 365 50 88 276 235 83 42 105 124 101 402 494 496 464 150 130 107 333 303 469 439 36 40 42 48 274 120 385 38 443 235 401 392 508 305 357 189 456 512 56 82 343 82 336 448 309 293 169 483 101 455 335 269 364 336 241 433 457 453 150 72 244 241 469 74 248 37 134 133 226 97 167 217 25 325...

output:

97036
97036
97035
97034
97034
97034
97034
97034
97033
97033
97034
97035
97036
97035
97035
97034
97033
97034
97034
97035
97036
97037
97037
97038
97039
97039
97040
97040
97039
97038
97037
97038
97038
97039
97040
97040
97039
97038
97037
97037
97037
97037
97038
97037
97037
97038
97037
97037
97036
97035
...

result:

ok 200001 tokens

Test #118:

score: 20
Accepted
time: 1814ms
memory: 179976kb

input:

200000 200000
423 61 79 9 474 146 188 320 334 481 110 167 122 146 11 82 65 26 349 120 480 417 97 350 139 19 198 183 95 343 207 175 175 402 100 460 489 229 332 296 90 117 334 106 349 331 446 363 512 92 52 105 116 27 121 498 123 141 457 283 411 136 220 256 94 145 88 200 193 111 56 421 152 194 121 237 ...

output:

96891
96892
96893
96894
96895
96895
96896
96896
96895
96895
96896
96896
96896
96897
96898
96899
96899
96900
96900
96901
96901
96901
96900
96901
96901
96900
96901
96902
96902
96903
96903
96903
96903
96902
96903
96903
96903
96903
96903
96902
96903
96903
96903
96903
96902
96902
96902
96901
96900
96901
...

result:

ok 200001 tokens

Test #119:

score: 20
Accepted
time: 1778ms
memory: 191308kb

input:

200000 200000
297 291 653 353 40 218 753 11 227 667 262 582 926 531 722 598 447 429 131 18 473 619 800 559 519 783 409 228 989 927 727 383 250 410 490 603 615 289 853 364 810 61 697 679 255 424 552 33 911 663 435 525 274 1003 1020 687 19 694 61 797 171 318 256 919 294 971 345 838 890 289 618 218 872...

output:

95720
95719
95719
95720
95719
95719
95719
95718
95717
95717
95717
95716
95716
95716
95717
95717
95718
95717
95717
95717
95718
95718
95717
95718
95717
95717
95718
95718
95717
95718
95719
95719
95720
95719
95720
95721
95720
95720
95719
95719
95720
95721
95721
95721
95721
95721
95720
95720
95720
95719
...

result:

ok 200001 tokens

Test #120:

score: 20
Accepted
time: 1804ms
memory: 193088kb

input:

200000 200000
11 748 742 423 217 9 744 446 733 424 698 222 504 62 776 846 191 432 1023 441 946 763 276 478 260 57 1005 829 187 511 652 946 555 95 694 684 625 46 670 753 300 827 460 389 297 305 195 845 235 346 275 993 618 497 73 770 137 86 969 873 744 668 545 253 897 672 1009 429 861 386 475 498 378 ...

output:

95495
95494
95494
95493
95493
95493
95492
95491
95491
95491
95490
95491
95491
95491
95492
95492
95492
95492
95493
95494
95494
95493
95493
95492
95491
95491
95490
95490
95491
95491
95492
95491
95492
95493
95493
95494
95493
95493
95494
95494
95495
95494
95493
95493
95494
95495
95494
95494
95493
95493
...

result:

ok 200001 tokens

Test #121:

score: 20
Accepted
time: 1805ms
memory: 205288kb

input:

200000 200000
685 183 1433 1356 1502 1016 1091 616 208 1819 1294 909 966 1943 595 593 1621 2007 1383 1886 418 632 75 1546 606 408 308 1315 1103 43 1343 1490 382 858 348 200 1031 1469 268 1232 1878 1525 225 1184 1673 142 1711 1767 4 758 1911 28 1917 1036 876 1927 861 1133 1169 1880 744 185 1710 691 1...

output:

94331
94330
94329
94328
94329
94328
94328
94328
94328
94327
94327
94327
94328
94327
94327
94326
94326
94327
94328
94328
94329
94328
94327
94328
94329
94329
94328
94327
94327
94327
94327
94328
94328
94327
94327
94328
94328
94328
94327
94326
94326
94326
94326
94325
94325
94324
94324
94323
94323
94322
...

result:

ok 200001 tokens

Test #122:

score: 20
Accepted
time: 1784ms
memory: 204304kb

input:

200000 200000
1938 873 173 432 1117 1779 1373 618 1365 638 1444 825 1323 483 1616 566 1198 872 1911 607 299 780 435 1761 1175 444 1120 509 572 242 1589 1470 1894 1840 1174 1822 658 1266 843 2004 1662 915 1199 1268 1723 1640 118 1099 1462 447 1934 1822 259 1019 496 1413 2031 1622 341 1714 197 523 149...

output:

94285
94285
94285
94285
94285
94284
94284
94284
94283
94283
94282
94282
94282
94282
94282
94282
94282
94282
94281
94280
94281
94281
94281
94280
94279
94278
94278
94279
94279
94279
94279
94279
94280
94281
94280
94279
94279
94279
94279
94279
94279
94279
94279
94279
94279
94279
94279
94279
94278
94278
...

result:

ok 200001 tokens

Test #123:

score: 20
Accepted
time: 1709ms
memory: 218332kb

input:

200000 200000
2799 2562 102 3634 3708 756 3584 3051 3901 2706 1140 2495 3960 1825 2863 3577 3937 999 2840 2216 3427 588 819 2498 2664 1103 4032 1269 2869 2855 382 2117 8 3437 2167 3706 3952 2288 1547 1942 104 3242 475 722 3991 3439 2895 4071 2243 650 1076 379 2825 3141 1793 3641 2206 2899 2177 3550 ...

output:

92699
92699
92698
92698
92697
92697
92697
92696
92696
92697
92697
92697
92697
92697
92698
92698
92698
92698
92698
92699
92700
92700
92699
92699
92699
92699
92699
92699
92699
92699
92699
92698
92698
92698
92698
92697
92698
92697
92697
92696
92697
92697
92698
92697
92697
92697
92697
92698
92699
92699
...

result:

ok 200001 tokens

Test #124:

score: 20
Accepted
time: 1739ms
memory: 218992kb

input:

200000 200000
3751 172 466 2336 3863 1887 3935 4050 3635 3398 3005 993 2078 2774 671 63 123 685 3419 834 630 2926 723 1694 3378 1238 2144 2937 2681 642 137 2138 2185 2301 2920 1554 608 2458 3064 2531 2453 1835 3972 1182 1561 203 1281 3803 153 4091 275 3689 1671 2685 107 2663 1127 2227 38 4060 233 82...

output:

92604
92604
92604
92604
92603
92602
92603
92602
92603
92603
92602
92601
92601
92600
92600
92600
92599
92599
92599
92598
92597
92597
92597
92596
92596
92596
92595
92594
92595
92594
92595
92595
92595
92595
92595
92596
92596
92596
92595
92595
92595
92595
92594
92594
92593
92593
92594
92593
92592
92592
...

result:

ok 200001 tokens

Test #125:

score: 20
Accepted
time: 1572ms
memory: 231724kb

input:

200000 200000
1301 1448 1613 569 2892 791 667 5388 5026 1842 2714 4095 8009 6581 7018 2535 3855 7801 1108 8153 716 440 2270 5866 1419 4121 3080 6279 4082 834 7473 2408 41 2403 3283 6263 3933 1259 7372 1330 421 3491 6382 806 2687 5514 2977 2501 875 6300 3640 1063 3338 6365 1266 7273 4678 130 7656 489...

output:

90486
90486
90486
90487
90488
90488
90489
90489
90490
90489
90490
90491
90491
90492
90492
90491
90490
90489
90488
90488
90487
90487
90487
90487
90488
90488
90487
90487
90488
90487
90486
90485
90485
90486
90487
90486
90486
90486
90486
90486
90485
90485
90485
90485
90485
90486
90485
90486
90487
90486
...

result:

ok 200001 tokens

Test #126:

score: 20
Accepted
time: 1581ms
memory: 234284kb

input:

200000 200000
3269 1639 53 3807 288 695 3674 6803 2258 5502 4452 812 1168 3792 2815 4587 7940 2586 5195 5471 1738 3088 492 6264 7930 6647 1598 1593 6583 4231 5109 5477 2430 5717 1732 7538 5845 1985 1420 3476 6606 3798 4724 5474 7874 4825 776 2170 828 3484 1279 8022 2773 4613 7499 5924 6621 2615 7512...

output:

90579
90580
90580
90581
90581
90580
90580
90581
90582
90582
90583
90584
90584
90583
90582
90581
90581
90580
90580
90579
90580
90580
90580
90580
90581
90582
90581
90581
90580
90580
90579
90580
90580
90580
90579
90579
90579
90580
90581
90582
90581
90580
90579
90580
90581
90581
90582
90581
90581
90582
...

result:

ok 200001 tokens

Test #127:

score: 20
Accepted
time: 1437ms
memory: 245040kb

input:

200000 200000
6125 15133 4913 3467 12883 3835 2871 3100 10396 2483 13347 13619 12552 6604 491 3083 10996 4016 10255 7525 1483 11764 10446 5669 2847 5430 902 5521 2667 6084 1252 4648 14420 5642 9439 13122 6696 2068 11225 10787 4767 50 5710 14139 16331 2150 13132 8226 5052 12741 4136 12796 11126 5987 ...

output:

88461
88460
88459
88458
88459
88459
88458
88458
88458
88457
88456
88455
88454
88454
88454
88455
88454
88455
88454
88455
88454
88454
88454
88455
88456
88457
88457
88457
88458
88458
88458
88458
88458
88459
88458
88457
88457
88456
88456
88456
88456
88455
88455
88455
88456
88456
88455
88455
88455
88456
...

result:

ok 200001 tokens

Test #128:

score: 20
Accepted
time: 1411ms
memory: 244408kb

input:

200000 200000
7476 12868 253 11571 663 4368 14423 11466 15219 7503 4138 10395 9785 11798 1028 3355 1699 1411 1543 1356 15335 2003 3132 15611 6600 4800 5921 7075 4186 7082 1906 14728 9721 6632 7974 14160 8946 4754 11755 3503 2990 1520 14339 11339 4974 8797 697 10223 10220 6762 1203 6304 14524 6923 73...

output:

88652
88652
88653
88652
88652
88652
88651
88651
88652
88652
88651
88650
88651
88651
88652
88653
88654
88654
88654
88654
88653
88654
88655
88656
88656
88657
88658
88657
88658
88657
88657
88657
88658
88659
88660
88660
88659
88659
88658
88659
88659
88659
88659
88659
88659
88658
88657
88657
88656
88656
...

result:

ok 200001 tokens

Test #129:

score: 20
Accepted
time: 1303ms
memory: 260276kb

input:

200000 200000
21682 7941 14220 2211 1361 6143 6865 8284 17683 8592 10947 13649 668 15216 4090 12920 2781 32465 4374 895 27167 7315 5128 24142 18728 3185 25316 5973 32380 17469 6643 24334 16539 18660 21055 20526 17858 23389 23040 3987 790 29678 25534 19729 15572 25231 12702 17002 26983 21487 29830 52...

output:

87194
87195
87194
87193
87194
87195
87195
87194
87193
87193
87193
87194
87193
87193
87194
87194
87194
87195
87196
87196
87196
87197
87197
87198
87199
87200
87201
87200
87200
87199
87199
87198
87197
87197
87197
87197
87197
87196
87195
87196
87197
87196
87196
87196
87196
87196
87197
87197
87197
87198
...

result:

ok 200001 tokens

Test #130:

score: 20
Accepted
time: 1262ms
memory: 259440kb

input:

200000 200000
4796 29942 5120 22792 16000 28318 4774 22973 23072 26568 17147 20569 21459 3414 28239 16851 20923 21108 9843 5394 13194 560 31905 29009 26837 23060 29374 32565 31239 32396 28205 20385 1940 2143 25040 16775 26208 4279 19332 24548 21800 16084 17691 8329 28085 19825 15311 24876 16009 815 ...

output:

87317
87317
87316
87316
87316
87316
87315
87314
87314
87314
87314
87314
87313
87312
87312
87311
87311
87311
87312
87313
87312
87312
87311
87310
87311
87310
87310
87311
87311
87310
87310
87310
87309
87308
87308
87308
87309
87309
87309
87308
87308
87308
87308
87307
87306
87306
87306
87306
87306
87305
...

result:

ok 200001 tokens