QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#403344#7782. Ursa MinorretaliatorEliteTL 2843ms263560kbC++145.0kb2024-05-02 09:01:282024-05-02 09:01:29

Judging History

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

  • [2024-05-02 09:01:29]
  • 评测
  • 测评结果:TL
  • 用时:2843ms
  • 内存:263560kb
  • [2024-05-02 09:01:28]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
inline long long read(){
	long long ret=0,neg=1;
	char ch;
	ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
	if(ch=='-'){
		neg=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		ret=(ret<<1)+(ret<<3)+(ch^48);
		ch=getchar();
	}
	return ret*neg;
}
void write(long long x){
	if(x<0) putchar('-'),x=-x;
	if(x>=10) write(x/10);
	putchar('0'+x%10);
}

const long long mod=1000000007998244353,Base=7539375027;

const int Blim=150;

int n,q;
long long a[200010];
long long dif[200010];

vector<long long> BIT[3+((1+Blim)*Blim/2)];
int Bid[Blim+3][Blim+3];
int Bidx;

inline int Get_pos(int k,int pos){
	return ((pos-1)/k)+1;
}

inline void Add(int id,int pos,long long del){
	for(;pos<BIT[id].size();pos+=pos-((pos-1)&pos)){
		//cout<<pos<<endl;
		BIT[id][pos]+=del;
	}
}
inline long long Ask(int id,int pos){
	long long ret=0;
	for(;pos;pos=pos&(pos-1)){
		ret+=BIT[id][pos];
	}
	return ret;
}

inline void Min_Modify(int pos,long long del){
	//dif[pos]+=del;
	for(int i=1;i<=Blim;++i){
		Add(Bid[i][pos%i],Get_pos(i,pos),del);
	}
}

int Gcd(int x,int y){
	if(x==0) return y;
	return Gcd(y%x,x);
}

long long pw[2][200010];
long long ksm(long long x,long long t){
	long long ret=1;
	while(t){
		if(t&1){
			ret=(__int128)x*ret%mod;
		}
		x=(__int128)x*x%mod;
		t>>=1;
	}
	return ret;
}

long long bIT[200010];
inline void aDD(int pos,long long del){
	for(;pos<=n;pos+=pos-((pos-1)&pos)){
		//cout<<pos<<endl;
		bIT[pos]+=del;
		bIT[pos]=bIT[pos]>=mod?bIT[pos]-mod:bIT[pos];
	}
}
inline long long aSK(int pos){
	/*__int128 qqq=0;
	for(int i=1;i<=pos;++i){
		qqq=(qqq+(__int128)(a[i]+mod)*pw[0][n-i])%mod;
	}*/

	long long ret=0;
	for(;pos;pos=pos&(pos-1)){
		ret+=bIT[pos];
		ret=ret>=mod?ret-mod:ret;
	}
	//assert(qqq==ret);
	return ret;
}

namespace Primagen{
	int m;
	int b[200010];
	int ST[200010][20];
	int Lg[200010];
	inline void Build(){
		for(int i=0;i<=20;++i){
			for(int j=(1<<i);j<=min(m,(1<<(i+1))-1);++j)
				Lg[j]=i;
		}
		for(int i=1;i<=m;++i){
			ST[i][0]=b[i];
		}
		for(int j=1;j<=18;++j){
			for(int i=1;i+(1<<j)-1<=m;++i){
				ST[i][j]=Gcd(ST[i][j-1],ST[i+(1<<(j-1))][j-1]);
			}
		}
	}
	inline int Ask(int l,int r){
		int tmp=Lg[r-l+1];
		return Gcd(ST[l][tmp],ST[r-(1<<tmp)+1][tmp]);
	}
}

int main(){
	//freopen("circle3.in","r",stdin);
	//freopen("circle.out","w",stdout);
	n=read();
	Primagen::m=read();
	q=read();
	for(int i=1;i<=n;++i){
		a[i]=read();
		dif[i]=a[i]-a[i-1];
	}
	for(int i=1;i<=Primagen::m;++i){
		Primagen::b[i]=read();
	}
	Primagen::Build();
	//cout<<Primagen::Ask(3,4)<<endl;
	for(int i=1;i<=min(n,Blim);++i){
		int len=(n/i)+3;
		for(int rm=0;rm<i;++rm){
			BIT[++Bidx].resize(len);
			Bid[i][rm]=Bidx;
		}
		for(int j=1;j<=n;++j){
			Add(Bid[i][j%i],Get_pos(i,j),a[j]);
		}
	}
	//return 0;
	pw[0][0]=pw[1][0]=1;
	pw[0][1]=Base;
	pw[1][1]=ksm(Base,mod-2);
	for(int i=1;i<=n;++i){
		pw[0][i]=(__int128)pw[0][i-1]*Base%mod;
		pw[1][i]=(__int128)pw[1][i-1]*pw[1][1]%mod;
		assert((__int128)pw[0][i]*pw[1][i]%mod==1);
	}
	for(int i=1;i<=n;++i){
		__int128 tmppp=a[i];
		if(tmppp<0){
			tmppp=-tmppp;
			tmppp%=mod;
			tmppp=mod-tmppp;
		}
		tmppp%=mod;
		aDD(i,(__int128)a[i]*pw[0][n-i]%mod);
	}
	while(q--){
		//cout<<q<<endl;
		char type;
		type=getchar();
		while(type!='Q'&&type!='U') type=getchar();
		if(type=='U'){
			int pos;
			long long tar;
			pos=read();
			tar=read();
			long long del=tar-a[pos];
			a[pos]=tar;
			dif[pos]+=del;
			Min_Modify(pos,del);
			if(pos!=n) dif[pos+1]-=del;
			if(del<0){
				del=-del;
				del%=mod;
				del=mod-del;
			}
			del%=mod;
			aDD(pos,(__int128)del*pw[0][n-pos]%mod);
		}
		else{
			int l,r,ool,oor;
			l=read();
			r=read();
			ool=read();
			oor=read();
			int k=r-l+1;
			k=Gcd(k,Primagen::Ask(ool,oor));
			//cout<<k<<endl;
			if(k<=Blim){
				bool flag=true;
				long long tar=Ask(Bid[k][l%k],Get_pos(k,l)-1)-Ask(Bid[k][l%k],Get_pos(k,r-k+1));
				for(int i=1;i<k;++i){
					/*if(i&&Ask(Bid[k][(l+i)%k],Get_pos(k,l+i)-1)!=Ask(Bid[k][(l+i)%k],Get_pos(k,r-k+1+i))){
						flag=false;
						break;
					}*/
					if(Ask(Bid[k][(l+i)%k],Get_pos(k,l+i)-1)-Ask(Bid[k][(l+i)%k],Get_pos(k,r-k+1+i))!=tar){
						flag=false;
						break;
					}
					/*long long sum=0;
					for(int j=l+i;j<=r;j+=k){
						if()
					}*/
				}
				if(flag){
					puts("Yes");
				}
				else{
					puts("No");
				}
			}
			else{
				long long sum=0,sum2=0;
				long long lst=aSK(r);
				for(int i=r-k;i>=l-1;i-=k){
					__int128 tmp=aSK(i);
					__int128 lt=tmp;
					tmp=(lst+mod-tmp)%mod;
					tmp=tmp*pw[1][n-i-k]%mod;
					sum=(sum+tmp)%mod;
					lst=lt;
					sum2+=a[i+1]+mod;
					sum2%=mod;
				}
				__int128 coef;
				coef=pw[0][k]+mod-1;
				coef=coef*ksm(Base-1,mod-2)%mod;
				//assert(coef==1);
				coef=coef*sum2%mod;
				if(coef==sum){
					puts("Yes");
				}
				else{
					puts("No");
				}
			}
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 3ms
memory: 11724kb

input:

6 4 5
1 1 4 5 1 4
3 3 2 4
Q 1 5 1 2
Q 2 5 3 4
U 5 2
Q 1 6 1 2
Q 2 5 3 4

output:

Yes
No
No
Yes

result:

ok 4 tokens

Test #2:

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

input:

1 1 1
0
1
Q 1 1 1 1

output:

Yes

result:

ok "Yes"

Test #3:

score: 0
Accepted
time: 244ms
memory: 18604kb

input:

2000 2000 200000
1 1 2 0 0 2 0 2 0 0 0 0 0 2 2 1 2 0 0 2 2 2 1 0 1 2 1 2 0 0 1 1 1 2 0 0 2 2 2 2 0 2 0 0 2 1 2 0 0 1 2 2 1 0 2 0 0 0 1 2 2 1 2 2 0 0 1 1 1 0 0 2 0 0 1 1 0 2 2 2 1 0 0 1 0 1 2 2 2 1 1 2 2 1 2 1 0 2 2 3 1 3 2 3 1 0 1 2 0 1 1 1 0 2 2 3 2 0 3 2 3 3 1 2 3 1 2 0 1 0 3 1 0 0 2 0 1 2 1 3 2 2...

output:

Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
No
Yes
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
No
Yes
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No...

result:

ok 100554 tokens

Test #4:

score: 0
Accepted
time: 113ms
memory: 27944kb

input:

1 200000 200000
998244353
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 100240 tokens

Test #5:

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

input:

6 131072 200000
0 0 0 0 1000000000 1000000000
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 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 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 4 4 4 4 4 4 4 4 4 4 ...

output:

Yes
Yes
Yes
No
No
No
Yes
No
No
No
No
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
No
No
No
No
No
No
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
Yes
Yes
No
Yes
N...

result:

ok 100021 tokens

Test #6:

score: 0
Accepted
time: 758ms
memory: 263488kb

input:

200000 200000 200000
490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877 490339877...

output:

No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
Yes
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
Yes
Yes
No
No
No
No
No
No
No
No
N...

result:

ok 187340 tokens

Test #7:

score: 0
Accepted
time: 693ms
memory: 263548kb

input:

200000 200000 200000
360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531 360543531...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 199985 tokens

Test #8:

score: 0
Accepted
time: 622ms
memory: 263320kb

input:

200000 200000 200000
793134805 922104801 158394038 993313213 77527653 992889267 148461787 499165677 132176015 189185554 783374975 332147281 923925325 371040161 393285793 437388761 138662855 212488140 265392646 498903298 578518594 550390771 960084339 408548934 56106823 814997309 456913457 300689692 1...

output:

No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No...

result:

ok 200000 tokens

Test #9:

score: 0
Accepted
time: 631ms
memory: 263312kb

input:

200000 200000 200000
451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037 451942036 451942035 451942037...

output:

No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
Yes
No
Yes
No
No
No
No
Yes
No
Yes
No
No
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
No
N...

result:

ok 199977 tokens

Test #10:

score: 0
Accepted
time: 1002ms
memory: 263360kb

input:

200000 200000 200000
606894463 710609424 913364361 30426550 801940265 516097169 349718376 606894463 710609424 913364361 30426550 801940265 516097169 349718376 606894463 710609424 913364361 30426550 801940265 516097169 349718376 606894463 710609424 913364361 30426550 801940265 516097169 349718376 606...

output:

No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
No
No
N...

result:

ok 100329 tokens

Test #11:

score: 0
Accepted
time: 2843ms
memory: 263484kb

input:

200000 199999 200000
903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886 903745886...

output:

Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 100000 tokens

Test #12:

score: 0
Accepted
time: 2071ms
memory: 263404kb

input:

199997 199989 199999
516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047 516381047...

output:

Yes
Yes
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
Yes
No
Yes
No
No
Yes
No
No
No
No
No
No
No
No
Yes
No
No
No
No
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
No
No
No
No
No
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
No
No
Yes
Yes
No
No
No
No
No
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
Yes
No
Yes
No
No
No
No
No
No
No
Yes
No...

result:

ok 100000 tokens

Test #13:

score: 0
Accepted
time: 2818ms
memory: 263320kb

input:

200000 199899 200000
738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100 738568100...

output:

Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 100000 tokens

Test #14:

score: 0
Accepted
time: 2410ms
memory: 263256kb

input:

200000 199990 200000
748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491 748167491...

output:

Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No...

result:

ok 100000 tokens

Test #15:

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

input:

200000 200000 200000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 200000 tokens

Test #16:

score: 0
Accepted
time: 488ms
memory: 263452kb

input:

200000 200000 200000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 200000 tokens

Test #17:

score: 0
Accepted
time: 1378ms
memory: 263476kb

input:

200000 200000 200000
136241709 121069654 74104428 402269028 289305416 855066384 59173243 188019353 669781180 986996513 504339812 329791320 25125974 222565943 288337442 964609791 466878029 264002600 189175389 9157365 469615339 896075603 753652692 122288279 240727003 784469217 906985969 890794301 2169...

output:


result:

ok 0 tokens

Test #18:

score: 0
Accepted
time: 448ms
memory: 263560kb

input:

200000 200000 200000
273240622 378627620 579491720 693306037 632472065 511340335 670989889 554488479 652467925 278524470 836147563 424777678 759339952 855362660 230757613 865543002 560326470 755302163 785969817 6168093 585297358 945522008 799833815 740595138 24393108 602846463 227643614 845760733 81...

output:


result:

ok 0 tokens

Test #19:

score: 0
Accepted
time: 891ms
memory: 263492kb

input:

200000 200000 200000
902784461 118694875 998774623 411874728 685597851 368044897 72498166 42228570 960589282 760858636 63223215 20140256 256927497 432494553 374529608 902188891 898994 969710880 697644219 743838599 684197754 515142816 492082738 409457048 326043554 219156706 376310102 878117528 358651...

output:


result:

ok 0 tokens

Test #20:

score: 0
Accepted
time: 1358ms
memory: 263320kb

input:

200000 200000 200000
658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584 658243584...

output:

Yes
No
Yes
No
Yes
No
No
No
Yes
No
No
No
No
No
No
No
Yes
No
Yes
Yes
No
No
Yes
No
No
No
No
No
Yes
Yes
No
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Yes
No
No
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
No
No
No
No
Yes
No
No
No
No
Yes
Yes
No
Yes
No
Yes
No
Yes
No
No
No
Ye...

result:

ok 100000 tokens

Test #21:

score: 0
Accepted
time: 1484ms
memory: 256588kb

input:

194304 200000 200000
959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896 959184896...

output:

Yes
No
No
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No

result:

ok 28 tokens

Test #22:

score: 0
Accepted
time: 2151ms
memory: 247560kb

input:

199996 15 200000
935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935181296 935...

output:

Yes
Yes
No
Yes

result:

ok 4 tokens

Test #23:

score: 0
Accepted
time: 1953ms
memory: 262872kb

input:

199613 200000 199355
68 66 37 99 0 85 24 67 57 97 64 11 50 82 96 35 66 83 31 98 91 81 64 70 77 31 35 68 10 56 73 54 87 38 89 3 93 36 4 67 52 5 19 46 4 84 52 7 32 60 51 78 73 82 44 88 80 31 56 68 28 88 41 64 29 96 50 40 88 33 78 73 11 84 80 28 67 30 68 72 16 29 11 3 97 40 57 10 23 21 58 49 74 3 51 58...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 464 tokens

Test #24:

score: 0
Accepted
time: 1936ms
memory: 259524kb

input:

196607 200000 199398
0 1 1 0 0 1 1 0 1 1 1 0 0 1 1 1 1 0 0 0 1 0 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 1 1 1 1 1 0 1 0 0 0 0 1 1 1 1 1 0 0 0...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 634 tokens

Test #25:

score: 0
Accepted
time: 1923ms
memory: 263324kb

input:

200000 200000 199927
3608 3071 382 2875 4078 2201 3056 4339 221 307 2736 1827 4951 2565 1431 822 993 4269 2321 2170 4305 1836 4693 659 2844 3725 4204 2146 4553 161 851 3852 3330 1215 1317 4269 1585 2185 4199 4854 593 274 4226 665 4294 3543 2442 2082 248 2609 648 2988 1917 3857 3936 621 4332 1302 460...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Y...

result:

ok 349 tokens

Test #26:

score: 0
Accepted
time: 1899ms
memory: 262464kb

input:

199287 199555 199458
17888 15054 15804 11751 3852 2586 1000 8640 2890 13710 2101 14879 4661 3123 8257 11473 9344 19804 10350 12554 12225 14205 1976 8966 5297 9533 6650 7384 11267 15100 16333 19254 16266 10754 6784 12533 10357 2016 5686 4472 4775 5552 6994 18428 14532 17346 1791 9369 5105 18143 5982 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Y...

result:

ok 273 tokens

Test #27:

score: 0
Accepted
time: 804ms
memory: 262924kb

input:

199613 200000 199358
99 85 8 14 8 49 14 78 31 36 25 42 51 27 17 99 87 81 69 47 49 82 59 17 73 93 94 4 40 43 53 60 53 11 10 17 84 78 100 91 16 67 1 8 7 73 29 17 90 87 42 27 91 41 17 77 79 84 62 9 10 9 23 64 72 74 45 35 56 55 39 100 31 95 72 91 41 84 65 87 11 21 24 15 44 33 69 15 23 44 15 19 88 48 38 ...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 467 tokens

Test #28:

score: 0
Accepted
time: 788ms
memory: 259408kb

input:

196607 200000 199397
1 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 1 1 1 1 1 0 1 1 1 0 0 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 0 0 0 1 0 0 1 1 0 0 0 1 1 0 1 0 0 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 0 0 0 1 0 1 1 1 1 1 1 1 0 1 0 0 1 0 0 0 1 0 1 1 1 1 1 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 0 1 0 1 1 0 0 1 1 1 0 1...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 633 tokens

Test #29:

score: 0
Accepted
time: 811ms
memory: 263384kb

input:

200000 200000 199930
1191 3250 1280 3656 3717 264 4976 3781 4938 4614 3966 1596 1759 1777 2832 72 3815 4659 4545 1993 1452 3799 1927 3708 630 2930 4261 4945 4174 1857 382 3318 4650 446 874 1474 3052 1221 1178 1271 347 4010 290 2242 4709 966 745 4553 2733 523 322 2396 499 157 562 1345 2877 253 41 486...

output:

No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Ye...

result:

ok 352 tokens

Test #30:

score: 0
Accepted
time: 828ms
memory: 262672kb

input:

199287 199555 199460
11989 3412 18093 18081 5075 17628 4297 5259 10918 14712 5642 6071 19609 10036 2216 3556 16721 4199 4680 1012 867 17122 116 3037 2637 6330 3282 1931 13559 5631 1226 16238 4788 6878 3255 12056 18785 6364 6815 12710 15797 18947 7636 16043 6652 377 13996 17892 10445 17959 8000 18577...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Ye...

result:

ok 275 tokens

Test #31:

score: 0
Accepted
time: 1348ms
memory: 263496kb

input:

200000 200000 200000
11 363 646 535 779 932 12 990 232 995 978 506 130 128 698 345 291 92 52 593 634 614 804 132 743 684 833 934 95 832 209 280 649 431 5 161 799 230 9 83 277 483 642 75 971 567 17 606 933 972 199 756 365 248 354 5 351 67 225 870 888 543 676 690 270 450 388 246 306 461 622 372 476 87...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result:

ok 66667 tokens

Test #32:

score: 0
Accepted
time: 1255ms
memory: 263396kb

input:

200000 200000 200000
1024 1099 1073 1003 1003 1004 1049 1084 1026 1096 1051 1030 1087 1007 1089 1078 1040 1054 1020 1021 1046 1074 1002 1067 1089 1086 1052 1043 1036 1006 1027 1100 1093 1066 1049 1050 1070 1070 1008 1064 1091 1085 1003 1022 1084 1005 1095 1068 1085 1063 1098 1051 1092 1006 1001 1092...

output:

Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Yes
No
Yes
Yes
No
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
No
Ye...

result:

ok 66667 tokens

Test #33:

score: -100
Time Limit Exceeded

input:

200000 200000 200000
3748 3636 3028 3976 2033 2874 1675 1444 1654 678 4684 3738 1790 2821 2213 3669 3801 3533 4298 4040 122 4575 3618 195 2189 1627 2975 2622 4794 2512 4534 4333 4981 2437 4514 528 3750 4197 3470 4827 4387 3160 3044 3159 4491 4358 1219 3296 1874 4487 1764 4405 4728 1755 1470 4853 163...

output:

Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
...

result: