QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#788948#9669. Function QueryBreakPlusAC ✓158ms71692kbC++142.2kb2024-11-27 18:51:122024-11-27 18:51:13

Judging History

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

  • [2024-11-27 18:51:13]
  • 评测
  • 测评结果:AC
  • 用时:158ms
  • 内存:71692kb
  • [2024-11-27 18:51:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
#define fi first
#define se second
#define mkp make_pair
#define pb emplace_back
#define popcnt __builtin_popcountll
const ll mod = 998244353;
inline ll read(){
	ll x=0, f=1; char ch=getchar();
	while(ch<'0' || ch>'9') { if(ch=='-') f=-1; ch=getchar(); }
	while(ch>='0' && ch<='9') x=x*10+ch-'0', ch=getchar();
	return x*f;
}
inline int lg2(int x){ return 31^__builtin_clz(x); }
inline ll lg2(ll x){ return 63^__builtin_clzll(x); }
inline ll qpow(ll a,ll b){
	ll ans=1, base=a;
	while(b){
		if(b&1) ans=ans*base%mod;
		base=base*base%mod; b>>=1;
	}
	return ans;
}
void init(){ }
const int M = 30;

int n,q,x[300005],tr[9000005],cnt=1;
int son[9000005][2];

void add(int pos,int id){ tr[pos]=min(tr[pos],id); }

void input(int x,int id){
	int rt=1; add(rt, id);
	for(int i=(M-1);i>=0;i--){
		int w=((x>>i)&1);
		if(!son[rt][w]) son[rt][w]=(++cnt);
		// cerr<<"rt = "<<rt<<endl;
		rt=son[rt][w];
		add(rt, id);
	}
}

void procedure(){
	memset(tr, 0x3f, sizeof(tr));
	n=read(),q=read();
	for(int i=1;i<=n;i++) x[i]=read(), input(x[i], i);

	// cerr<<"zhenghanyun2"<<endl;
	while(q--){
		int a=read(), b=read();
		if((a^x[1])==b) {puts("1"); continue;}
		else if((a^x[1])<b){
			a^=((1<<M)-1),b^=((1<<M)-1);
			// find (a^x[1])>=b
			int ans=0x3f3f3f3f, rt=1;
			for(int i=(M-1);i>=0;i--){
				int w=(b>>i)&1, q=((a>>i)&1);
				if(w){
					ans=min(ans, tr[son[rt][q]]);
					// cout<<"get "<<tr[son[rt][q]]<<endl;
				}
				rt=son[rt][w^q];
				if(!rt) break;
			}
			ans=min(ans, tr[rt]);
			if(ans>n){ puts("-1"); continue; }
			else printf("%d\n", ans-1);
		}else{
			// find (a^x[1])>=b
			int ans=0x3f3f3f3f, rt=1;
			for(int i=(M-1);i>=0;i--){
				int w=(b>>i)&1, q=w^((a>>i)&1);
				if(w) ans=min(ans, tr[son[rt][q^1]]);
				rt=son[rt][q];
				if(!rt) break;
			}
			ans=min(ans, tr[rt]);
			if(ans>n){ puts("-1"); continue; }
			else printf("%d\n", ans-1);
		}
	}
}

int main(){
	#ifdef LOCAL
		assert(freopen("input.txt","r",stdin));
		assert(freopen("output.txt","w",stdout));
	#endif
	ll T=1;
	init();
	while(T--) procedure();
	return 0;
}

这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 40156kb

input:

5 6
3 5 1 2 4
0 2
1 1
2 3
3 2
4 2
5 8

output:

2
2
1
1
1
-1

result:

ok ok

Test #2:

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

input:

2 1
3 3
0 3

output:

1

result:

ok ok

Test #3:

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

input:

300000 300000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

59791
209610
89695
89695
89695
269763
29721
59791
89695
209610
149700
209610
209610
59791
-1
29721
209610
89695
149700
89695
89695
149700
209610
89695
209610
269763
59791
89695
59791
209610
209610
209610
29721
89695
209610
59791
89695
89695
149700
29721
29721
59791
59791
29721
149700
149700
149700
2...

result:

ok ok

Test #4:

score: 0
Accepted
time: 49ms
memory: 40656kb

input:

300000 300000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

59824
29872
239818
120024
269973
120024
209816
120024
1
120024
120024
29872
179677
209816
90063
90063
59824
29872
209816
120024
59824
209816
120024
149876
179677
59824
1
149876
120024
149876
59824
269973
209816
179677
1
120024
239818
149876
179677
29872
239818
29872
149876
149876
120024
120024
14987...

result:

ok ok

Test #5:

score: 0
Accepted
time: 59ms
memory: 40164kb

input:

299999 300000
999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999...

output:

59912
59912
59912
89929
59912
59912
59912
59912
1
59912
269781
59912
59912
149833
89929
89929
179888
59912
149833
-1
239680
59912
59912
59912
269781
59912
59912
59912
59912
1
269781
89929
59912
59912
59912
59912
269781
149833
59912
59912
59912
30018
1
179888
30018
59912
59912
59912
59912
59912
59912...

result:

ok ok

Test #6:

score: 0
Accepted
time: 69ms
memory: 41820kb

input:

299999 300000
999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999990 999999...

output:

149501
149501
59597
59597
149501
89750
89750
59597
179553
59597
29668
59597
269967
149501
149501
59597
59597
59597
59597
59597
59597
269967
59597
59597
269967
209808
179553
269967
59597
59597
59597
59597
59597
89750
149501
89750
269967
59597
59597
59597
269967
1
209808
59597
29668
59597
59597
149501...

result:

ok ok

Test #7:

score: 0
Accepted
time: 38ms
memory: 41464kb

input:

300000 300000
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 ...

output:

24072
62885
-1
153067
153067
62885
-1
162026
62885
-1
-1
108288
50934
153067
-1
153067
-1
50934
-1
-1
153067
24072
62885
153067
153067
-1
168096
-1
-1
11995
-1
-1
30177
-1
20999
39023
-1
20999
210256
233864
269855
-1
62885
-1
-1
65877
-1
50934
-1
153067
-1
62885
39023
-1
-1
62885
-1
257912
-1
-1
-1
...

result:

ok ok

Test #8:

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

input:

300000 300000
9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ...

output:

153157
-1
-1
-1
-1
80636
281910
-1
201058
132105
-1
65745
245980
-1
2965
-1
-1
-1
17964
-1
195073
-1
195073
-1
201058
-1
-1
177103
269817
-1
71754
219008
-1
248865
-1
27020
147070
-1
86719
224959
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
80636
-1
-1
-1
-1
281910
180088
17964
123018
201058
-1
-1
86719
-1
2398...

result:

ok ok

Test #9:

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

input:

299999 300000
4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 4583175 458317...

output:

158339
158339
5832
38624
89629
11811
71398
59564
164479
44602
254981
158339
71398
197572
158339
158339
44602
158339
20674
80638
71398
14830
158339
158339
158339
158339
158339
71398
158339
288007
71398
-1
44602
158339
264004
71398
158339
224648
95610
116432
161432
158339
44602
98518
161432
89629
1583...

result:

ok ok

Test #10:

score: 0
Accepted
time: 69ms
memory: 42012kb

input:

300000 300000
788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806 788806...

output:

20978
167793
92835
56877
167793
258008
20978
156030
203749
173786
47858
92835
138187
167793
167793
167793
92835
167793
258008
138187
167793
126151
167793
29893
167793
92835
44865
104896
167793
92835
203749
185730
80922
167793
248950
44865
185730
167793
44865
288039
-1
47858
138187
-1
44865
288039
10...

result:

ok ok

Test #11:

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

input:

299999 300000
963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355592 963355...

output:

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

result:

ok ok

Test #12:

score: 0
Accepted
time: 38ms
memory: 41152kb

input:

300000 300000
231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122736 231122...

output:

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

result:

ok ok

Test #13:

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

input:

300000 300000
2 1 3 5 0 3 3 2 2 4 1 4 1 4 0 0 1 3 0 1 2 5 1 5 1 5 1 3 0 1 0 2 5 1 1 3 1 3 0 2 5 5 5 0 5 4 5 5 5 2 0 5 0 4 3 0 2 5 3 1 4 1 4 1 1 2 3 4 3 5 0 0 4 2 0 1 5 1 0 1 5 0 3 5 4 0 0 4 1 4 4 1 4 2 3 1 2 5 5 2 0 2 5 1 2 2 5 0 4 1 5 4 0 1 3 3 3 4 1 2 3 1 4 4 2 3 0 1 3 3 1 3 3 4 5 1 4 3 1 3 1 4 0 ...

output:

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

result:

ok ok

Test #14:

score: 0
Accepted
time: 41ms
memory: 40688kb

input:

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

output:

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

result:

ok ok

Test #15:

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

input:

300000 300000
0 2 0 2 5 2 0 3 4 3 3 0 1 2 0 0 5 1 1 1 1 1 4 1 0 4 0 2 5 4 2 2 5 4 0 4 2 5 4 3 0 0 0 5 5 3 1 3 1 0 4 0 1 2 0 1 0 4 0 1 3 0 5 3 3 0 1 5 5 2 5 0 2 0 4 5 1 3 5 5 1 2 3 5 2 0 3 3 4 4 4 0 0 2 4 2 2 3 2 1 0 3 3 2 1 3 3 3 1 4 2 5 2 4 1 2 4 2 3 4 1 2 3 3 4 4 3 1 3 5 3 3 2 3 5 4 4 4 0 0 1 0 1 ...

output:

1
1
8
12
7
1
1
12
8
1
8
4
12
7
12
8
7
1
12
8
1
1
7
4
1
7
8
1
8
1
12
7
8
1
7
1
7
7
12
1
12
1
7
4
12
1
1
1
4
12
12
4
12
12
12
1
1
4
7
1
8
1
1
1
8
7
4
4
4
12
8
1
7
1
1
12
8
7
1
1
12
4
4
7
12
8
8
12
8
8
4
8
7
1
7
7
8
7
8
1
7
8
1
7
8
1
8
12
12
7
12
1
4
7
7
1
1
7
7
4
8
1
4
1
12
7
8
1
7
4
1
4
8
1
12
4
7
1
...

result:

ok ok

Test #16:

score: 0
Accepted
time: 38ms
memory: 40720kb

input:

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

output:

10
10
1
3
-1
10
10
3
10
-1
1
10
3
1
5
1
1
10
1
3
-1
-1
10
3
1
3
1
1
10
5
10
3
5
-1
-1
1
10
5
5
-1
3
10
1
1
-1
5
5
1
1
1
-1
10
5
10
3
3
1
10
1
1
1
-1
-1
1
10
10
1
10
-1
1
10
1
-1
1
5
10
10
1
3
5
1
5
10
1
5
1
1
10
5
1
1
1
10
5
1
1
3
10
5
10
1
1
1
-1
-1
1
10
1
1
1
10
1
-1
1
-1
-1
1
10
10
1
3
1
1
1
5
-1...

result:

ok ok

Test #17:

score: 0
Accepted
time: 35ms
memory: 41796kb

input:

300000 300000
5 2 3 3 1 5 0 3 2 4 2 5 1 2 4 1 1 5 4 5 0 4 0 4 4 0 0 1 2 3 0 1 1 4 1 1 2 5 3 0 2 4 4 0 2 1 5 0 2 1 0 4 5 4 4 3 5 2 1 0 3 2 1 4 1 2 2 2 4 3 0 3 3 3 0 4 2 0 5 1 5 2 2 0 4 2 2 0 3 0 5 2 3 2 5 3 5 5 1 2 4 2 0 1 2 5 3 4 5 0 0 5 2 3 2 2 5 1 1 3 1 5 4 2 3 3 5 4 0 3 1 2 1 1 5 4 5 2 2 4 4 2 5 ...

output:

1
-1
1
1
-1
-1
1
-1
1
1
1
-1
1
1
4
1
-1
1
-1
6
-1
-1
4
6
-1
4
1
-1
1
-1
-1
6
-1
1
1
-1
-1
1
1
1
1
1
1
-1
-1
1
4
1
6
6
4
1
1
1
-1
-1
1
4
1
1
1
1
1
1
6
-1
-1
4
-1
-1
4
-1
-1
1
1
-1
1
1
6
-1
1
1
1
1
1
1
-1
4
1
1
1
-1
1
-1
6
1
-1
-1
-1
1
-1
6
1
1
-1
-1
1
-1
-1
-1
6
1
-1
-1
1
-1
-1
1
-1
-1
1
6
1
1
-1
-1
...

result:

ok ok

Test #18:

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

input:

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

output:

1
1
-1
1
-1
1
1
-1
13
-1
1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
-1
1
-1
-1
-1
1
1
-1
-1
1
-1
-1
13
13
-1
-1
1
-1
-1
1
1
-1
1
1
-1
-1
1
-1
-1
-1
1
1
-1
-1
1
1
1
-1
-1
-1
-1
1
-1
-1
1
-1
1
-1
1
-1
-1
-1
-1
1
-1
1
-1
13
-1
-1
-1
-1
1
1
1
1
1
1
1
-1
1
-1
1
1
1
13
1
-1
-1
-1
-1
-1
-1
-1
1
-1
13
-1
-1
-1
1
-1
1
-1...

result:

ok ok

Test #19:

score: 0
Accepted
time: 158ms
memory: 71252kb

input:

299999 300000
368364702 522726267 191777284 836785831 580519392 679702855 851224739 286998110 385871146 870875427 45817410 544738809 510710727 165619883 318858025 794120765 630021531 511379876 132579749 299399929 498617931 364772164 347885601 884294669 2578901 576388254 66773472 757552580 738656163 ...

output:

4
4
3
3
3
3
1
3
2
46
3
2
2
4
4
3
2
13
4
24
3
3
535
4
2
3
16
3
4
1
5
3
4
5
5
2
10
1
3
4
10
3
49
3
46
4
3
1
3
4
1
3
3
3
2
10
1
2
2
52
2
100
1
4
3
3
2
413
5
3
1
3
3
3
3
3
4
2
2
1
3
4
3
2
2
3
5
3
3
4
3
1
3
3
3
10
103
3
3
16
3
3
2
4
1
2
4
2
3
3
3
3
4
3
5
2
3
1
4
1
1
4
1
3
4
3
3
3
4
15
10
60
3
4
1
2
2
3
1...

result:

ok ok

Test #20:

score: 0
Accepted
time: 152ms
memory: 71692kb

input:

300000 300000
329363808 410837414 386542070 316091908 224988184 590807425 401154024 565635770 86332895 871768724 648980535 429516720 974692004 393242573 258082599 541700334 365570636 140418397 22543471 474596985 928885580 593375594 883649657 723085701 136251090 79716489 444939923 965935970 173809628...

output:

20
9
5
1
4
5
5
5
5
5
5
1
9
5
9
5
4
5
5
5
5
1
19
1
5
9
9
5
9
4
4
9
5
5
4
1
11
4
8
4
4
5
1
5
46
9
4
5
18
5
81
5
4
5
4
5
5
9
4
9
8
4
5
9
4
1
5
4
1
5
5
4
5
4
5
9
5
1
12
9
4
9
9
1
5
1
5
5
18
9
12
4
1
4
1
1
5
5
5
4
5
74
4
1
5
2
4
5
2
9
5
1
5
4
5
8
9
4
7
2
5
5
4
9
4
1
5
5
5
5
5
1
8
5
1083
4
4
27
5
4
5
4
5
...

result:

ok ok

Extra Test:

score: 0
Extra Test Passed