QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#870993#9682. nim 游戏JohnAlfnov86 86ms40816kbC++174.3kb2025-01-25 19:01:022025-01-25 19:01:08

Judging History

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

  • [2025-01-27 16:14:54]
  • hack成功,自动添加数据
  • (/hack/1492)
  • [2025-01-27 09:21:28]
  • hack成功,自动添加数据
  • (/hack/1491)
  • [2025-01-26 21:00:42]
  • hack成功,自动添加数据
  • (/hack/1486)
  • [2025-01-26 19:37:10]
  • hack成功,自动添加数据
  • (/hack/1478)
  • [2025-01-26 18:57:28]
  • hack成功,自动添加数据
  • (/hack/1476)
  • [2025-01-26 18:39:47]
  • hack成功,自动添加数据
  • (/hack/1474)
  • [2025-01-25 19:01:08]
  • 评测
  • 测评结果:86
  • 用时:86ms
  • 内存:40816kb
  • [2025-01-25 19:01:02]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
namespace file_read{
	char ib[1<<24],*ip1=ib,*ip2=ib;
	inline char gc(){
		return ((ip1==ip2)&&(ip2=(ip1=ib)+fread(ib,1,1<<24,stdin)),ip1==ip2?EOF:*ip1++);
	}
	inline int read(){
		int x=0;char c=gc();
		while(c<'0'||c>'9')c=gc();
		while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^'0'),c=gc();
		return x;
	}
	inline long long readl(){
		long long x=0;char c=gc();
		while(c<'0'||c>'9')c=gc();
		while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^'0'),c=gc();
		return x;
	}
}
using namespace file_read;
long long a[100005];
int n,m;
long long ann;
namespace yuchu{
	int b[100005];
	void solve(){
		for(int i=1;i<=n;++i)b[i]=a[i];
		sort(b+1,b+n+1);
		long long ans=0;
		for(int t=59;t>=0;--t){
			int w=lower_bound(b+1,b+n+1,1ll<<t)-b;
			if((n-w+1)%2==0){
				for(int i=w;i<=n;++i)b[i]^=1ll<<t;
				inplace_merge(b+1,b+w,b+n+1);
				continue;
			}
			if(w>1){
				ans+=(1ll<<t)-b[w-1];
				b[w-1]=1ll<<t;
				for(int i=w-1;i<=n;++i)b[i]^=1ll<<t;
				inplace_merge(b+1,b+w-1,b+n+1);
				continue;
			}
		}
		ann=ans;
		printf("%lld\n",ans);
	}
}
long long aj[100005];
int p2[100005];
namespace baoli{
	pair<long long,int>pi[100005];
	int tt;vector<pair<int,int>>vv[100005];
	int hh[35],aa[35][100005],pp[35][100005];
	int tj[100005],st[105],sl=0;
	bool dfs(int t,long long he){
		if(t<0){
			if(he>ann)return 0;
			--m;
			vector<pair<int,int>>vc;
			for(int i=1;i<=n;++i)if(aj[i])vc.emplace_back(i,aj[i]);
			vv[++tt]=vc;
			return 1;
		}
		int gs=hh[t];
		for(int i=1;i<=sl;++i){
			int j=st[i];
			gs-=aa[t][j]>>t&1;
		}
		if(gs%2==0){
			return dfs(t-1,he);
		}
		int fl=0,cg=1;
		for(int i=n-gs;i>=1&&cg&&m;--i){
			int j=pp[t][i];
			if(tj[j])continue;
			if((aa[t][j]>>t&1))continue;
			long long sb=(1ll<<t)-aa[t][j];
			aj[j]+=sb;++tj[j];
			if(tj[j]==1)st[++sl]=j;
			int ff=1;
			if(dfs(t-1,he+sb))fl=1;
			else ff=0;
			if(tj[j]==1)--sl;
			--tj[j];aj[j]-=sb;
			if(!ff)return fl;
		}
		for(int i=1;i<=sl&&cg&&m;++i){
			int j=st[i];
			long long sb=(1ll<<t)-0;
			aj[j]+=sb;++tj[j];
			if(tj[j]==1)st[++sl]=j;
			int ff=1;
			if(dfs(t-1,he+sb))fl=1;
			else ff=0;
			if(tj[j]==1)--sl;
			--tj[j];aj[j]-=sb;
			if(!ff)return fl;
		}
		return fl;
	}
	void solve(){
		for(int i=1;i<=n;++i)p2[i]=i;
		sort(p2+1,p2+n+1,[&](int x,int y){
			return a[x]<a[y];
		});
		for(int t=29;t>=0;--t){
			hh[t]=0;
			int w=0;
			for(int i=1;i<=n;++i){
				aa[t][i]=a[i]&((1<<(t+1))-1);
				pp[t][i]=p2[i];hh[t]+=(aa[t][i]>>t&1);
			}
			for(int i=1;i<=n;++i){
				if(aa[t][p2[i]]<(1<<t))w=i;
			}
			inplace_merge(p2+1,p2+w+1,p2+n+1,[&](int x,int y){
				return (a[x]&((1<<t)-1))<(a[y]&((1<<t)-1));
			});
		}
		for(int i=1;i<=n;++i)aj[i]=0;
		tt=0;dfs(29,0);
		printf("%d\n",tt);
		for(int i=1;i<=tt;++i){
			vector<pair<int,int>>vc=vv[i];
			int z=vc.size();
			printf("%d\n",z);
			for(int j=0;j<z;++j)printf("%d ",vc[j].first);
			printf("\n");
			for(int j=0;j<z;++j)printf("%d ",vc[j].second);
			printf("\n");
		}
	}
}
int main(){
	int c=read(),T=read();
	assert(c>=0);
	while(T--){
		n=read(),m=read();
		for(int i=1;i<=n;++i)a[i]=readl();
		if(c<=7||(14<=c&&c<=21)){
			yuchu::solve();
			baoli::solve();
			continue;
		}
		long long ans=0;
		for(int i=1;i<=n;++i)aj[i]=0;
		for(int t=59;t>=0;--t){
			int gs=0;
			for(int i=1;i<=n;++i)if(a[i]>>t&1)++gs;
			if(gs%2==0)continue;
			if(gs<n)break;
			for(int tt=t;tt<=59;++tt){
				int gs=0;
				for(int i=1;i<=n;++i)if(a[i]>>tt&1)++gs;
				if(gs<n)break;
				long long T=(1ll<<(tt+1))-1;
				long long mx=-1;int wz=0;
				for(int i=1;i<=n;++i){
					if(mx<a[i])mx=a[i],wz=i;
				}
				mx=a[wz]&T;++T;
				ans+=T-mx;aj[wz]+=T-mx;a[wz]+=T-mx;
			}
		}
		for(int t=60;t>=0;--t){
			int gs=0;
			for(int i=1;i<=n;++i)if(a[i]>>t&1)++gs;
			if(gs%2==0)continue;
			long long T=(1ll<<(t+1))-1;
			long long mx=-1;int wz=0;
			for(int i=1;i<=n;++i){
				if((a[i]&T)>=(1ll<<t))continue;
				if(mx<(a[i]&T))mx=(a[i]&T),wz=i;
			}
			ans+=(1ll<<t)-mx;aj[wz]+=(1ll<<t)-mx;a[wz]+=(1ll<<t)-mx;
		}
		printf("%lld\n",ans);
		printf("%d\n",1);
		int gs=0;
		for(int i=1;i<=n;++i)if(aj[i])++gs;
		printf("%d\n",gs);
		for(int i=1;i<=n;++i)if(aj[i])printf("%d ",i);
		printf("\n");
		for(int i=1;i<=n;++i)if(aj[i])printf("%lld ",aj[i]);
		printf("\n");
	}
	return 0;
}

详细


Pretests

Pretest #1:

score: 4
Accepted
time: 20ms
memory: 34476kb

input:

1 10000
2 1
787709928 658090405
2 1
508859442 320865978
2 1
901516660 1071318821
2 1
924326675 330656846
2 1
556507192 599101864
2 1
518528812 842021415
2 1
153781736 213270767
2 1
161460204 140517709
2 1
344895823 339053034
2 1
76824343 446590781
2 1
943442122 128864577
2 1
186128196 166832232
2 1
...

output:

129619523
1
1
2 
129619523 
187993464
1
1
2 
187993464 
169802161
1
1
1 
169802161 
593669829
1
1
2 
593669829 
42594672
1
1
1 
42594672 
323492603
1
1
1 
323492603 
59489031
1
1
1 
59489031 
20942495
1
1
2 
20942495 
5842789
1
1
2 
5842789 
369766438
1
1
1 
369766438 
814577545
1
1
2 
814577545 
19...

result:

ok correct answer

Pretest #2:

score: 4
Accepted
time: 1ms
memory: 36688kb

input:

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

output:

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

result:

ok correct answer

Pretest #3:

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

input:

3 5
5 2000
0 12 14 13 4
5 2000
0 14 5 5 11
5 2000
0 12 3 0 1
5 2000
0 8 5 9 11
5 2000
0 8 7 1 2

output:

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

result:

ok correct answer

Pretest #4:

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

input:

4 5
5 2000
0 0 3 13 5
5 2000
0 9 10 14 3
5 2000
0 4 7 10 3
5 2000
0 9 14 5 0
5 2000
0 6 4 7 12

output:

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

result:

ok correct answer

Pretest #5:

score: 4
Accepted
time: 1ms
memory: 38736kb

input:

5 5
6 2000
0 924 738 482 642 735
6 2000
0 506 297 82 577 913
6 2000
0 520 847 369 136 119
6 2000
0 690 849 528 740 840
6 2000
0 121 51 176 500 435

output:

189
420
5
1 2 3 4 5 
131 36 6 14 2 
5
1 2 3 4 5 
130 37 6 14 2 
5
1 2 3 4 5 
130 36 6 15 2 
5
1 2 3 4 5 
130 36 7 14 2 
5
1 2 3 4 5 
130 36 6 14 3 
5
1 2 3 4 5 
129 38 6 14 2 
5
1 2 3 4 5 
128 39 6 14 2 
5
1 2 3 4 5 
128 38 6 15 2 
5
1 2 3 4 5 
128 38 7 14 2 
5
1 2 3 4 5 
128 38 6 14 3 
5
1 2 3 4 5 ...

result:

ok correct answer

Pretest #6:

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

input:

6 5
6 2000
0 611 108 95 972 21
6 2000
0 477 6 212 751 342
6 2000
0 131 78 345 512 551
6 2000
0 606 560 666 251 1020
6 2000
0 837 1013 823 371 987

output:

183
54
5
1 2 3 5 6 
4 29 148 1 1 
4
1 2 3 6 
4 29 149 1 
4
1 2 3 6 
4 30 148 1 
4
1 2 3 6 
5 29 148 1 
4
1 2 3 6 
4 29 148 2 
4
1 2 3 5 
4 29 148 2 
3
1 2 3 
4 29 150 
3
1 2 3 
4 31 148 
3
1 2 3 
6 29 148 
4
2 3 5 6 
29 152 1 1 
4
1 2 3 6 
1 29 152 1 
3
2 3 6 
29 153 1 
3
2 3 6 
30 152 1 
3
2 3 6 
2...

result:

ok correct answer

Pretest #7:

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

input:

7 5
6 2000
0 843 555 227 498 625
6 2000
0 365 658 849 181 373
6 2000
0 784 493 983 343 427
6 2000
0 628 848 762 675 423
6 2000
0 714 409 429 732 164

output:

58
122
5
1 3 4 5 6 
2 5 29 15 7 
5
1 3 4 5 6 
2 5 30 14 7 
5
1 3 4 5 6 
2 6 29 14 7 
5
1 3 4 5 6 
2 5 29 14 8 
5
1 3 4 5 6 
3 5 29 14 7 
5
1 3 4 5 6 
1 5 29 16 7 
4
3 4 5 6 
5 29 17 7 
4
3 4 5 6 
5 30 16 7 
4
3 4 5 6 
6 29 16 7 
4
3 4 5 6 
5 29 16 8 
5
1 3 4 5 6 
1 5 31 14 7 
4
3 4 5 6 
5 31 15 7 
4...

result:

ok correct answer

Pretest #8:

score: 2
Acceptable Answer
time: 10ms
memory: 11980kb

input:

8 272
100000 100
268435456 16 2 16 256 2 131072 1 536870912 16 134217728 4096 2048 8 512 8388608 33554432 128 1 134217728 256 2 16777216 256 4194304 1048576 536870912 262144 16 67108864 536870912 268435456 1024 2097152 2 128 512 512 512 4096 8388608 524288 2048 268435456 16 16384 512 4096 8192 16 65...

output:

200828637
1
18
2 8 11 14 15 16 17 18 23 25 26 33 34 42 46 49 70 76 
16 1 134217728 8 512 8388608 33554432 128 16777216 4194304 1048576 1024 2097152 524288 16384 8192 4 64 
254
1
1
2 
254 
197087
1
6
3 6 7 8 11 13 
65536 448 131072 16 1 14 
227
1
4
1 2 3 8 
32 1 192 2 
51
1
2
1 2 
3 48 
63366
1
6
2 4...

result:

points 0.5 right answer but not right solutions at 1th solution

Pretest #9:

score: 2
Acceptable Answer
time: 10ms
memory: 12108kb

input:

9 264
100000 100
64 32 4 67108864 4194304 262144 2048 1 8192 536870912 268435456 16 33554432 128 1048576 32768 2097152 536870912 2 1 8 64 1048576 4096 16777216 8192 2 16384 2048 2097152 16384 32 131072 2097152 2048 131072 134217728 134217728 4096 4096 32768 1048576 1024 268435456 2097152 16384 33554...

output:

341268837
1
15
1 2 3 4 5 6 7 8 11 15 24 28 33 48 63 
64 32 4 67108864 4194304 262144 2048 1 268435456 1048576 4096 16384 131072 65536 256 
2
1
1
1 
2 
7861
1
6
1 4 5 6 14 19 
1 1536 6144 48 128 4 
67096641
1
10
1 3 4 6 9 11 12 16 20 22 
8126464 8388608 64 32768 33554432 16777216 4096 16384 196608 1 ...

result:

points 0.5 right answer but not right solutions at 1th solution

Pretest #10:

score: 2
Acceptable Answer
time: 8ms
memory: 11980kb

input:

10 260
100000 100
2097152 2048 16777216 32 65536 262144 16777216 16384 524288 8192 1 2 1 32768 134217728 131072 2097152 1024 64 8388608 131072 4194304 2 262144 2 512 65536 2 262144 1 1 512 33554432 262144 32 8388608 1 16777216 524288 4 128 512 134217728 1 67108864 536870912 512 65536 32768 8388608 1...

output:

156152625
1
14
3 4 6 9 10 11 14 15 16 22 26 62 74 95 
16777216 32 262144 524288 8192 1 32768 134217728 131072 4194304 512 4096 256 16 
6930418
1
8
1 2 5 8 11 12 14 15 
2 7168 112 896 6291456 524288 98304 8192 
1
1
1
2 
1 
0
1
0


516097
1
2
2 3 
1 516096 
9
1
2
1 2 
1 8 
131051
1
8
1 2 4 5 6 8 14 15...

result:

points 0.5 right answer but not right solutions at 1th solution

Pretest #11:

score: 4
Accepted
time: 23ms
memory: 14160kb

input:

11 1926
100000 1
0 212593154 1052140456 972928282 462369044 673421356 1030921469 775492985 523349355 1069594143 190488188 492043456 733126324 341798699 724636365 947318175 262485282 931417678 663669259 740799776 535456704 684181464 19065576 53174255 514941440 670957241 988117825 629697943 45145107 1...

output:

166
1
12
1 9 10 28 158 916 3178 4343 24063 35928 55418 84218 
1 1 1 1 1 1 1 1 50 1 6 101 
3507
1
9
1 2 5 8 9 10 16 19 24 
1 960 1 16 444 40 124 1920 1 
330
1
2
1 2 
96 234 
2702
1
2
1 3 
602 2100 
29425584
1
4
5 7 8 9 
29359096 4 988 65496 
4458735
1
9
2 3 5 6 7 19 20 24 38 
229376 512 1536 7 1008 3...

result:

ok correct answer

Pretest #12:

score: 4
Accepted
time: 22ms
memory: 12108kb

input:

12 2322
100000 1
0 7039776 731926398 236886500 253555357 170069043 850149498 316268635 795618622 1065678481 633285758 1009207086 237836472 1017789866 399181873 324785167 527514687 676377746 338198269 270887526 278879561 639366360 646568377 35830334 462432910 876996649 282011992 376880056 871143466 6...

output:

34074
1
12
17 535 668 770 1106 17832 27428 30903 34296 41131 54949 55827 
1 1 1 1 1 328 1 3 287 9 1 33440 
9706
1
9
1 2 3 4 5 6 11 12 16 
1 128 1024 32 64 8192 8 1 256 
159051
1
9
1 3 5 7 8 13 20 22 23 
1 64 131072 256 3072 16384 2 8192 8 
28903264
1
5
3 4 5 6 7 
130944 96 3637248 25133056 1920 
557...

result:

ok correct answer

Pretest #13:

score: 4
Accepted
time: 25ms
memory: 14160kb

input:

13 2464
100000 1
0 427935372 551832889 844721265 648958227 58702839 98231989 67300751 1070455997 255697378 699971877 1056963469 632702252 896835770 545070997 374682484 333464439 140377201 550440744 704064530 917272389 331841130 755945696 883819791 896333287 197663164 1004357948 335423689 95692127 34...

output:

5015
1
18
1 5 6 8 55 165 1157 4515 34541 36654 38387 42740 54590 54715 57645 69119 71138 76661 
1 1 1 1 1 1 1 1 1 2 45 2 191 1 53 3294 1412 6 
40747082
1
18
1 4 24 30 65 76 210 249 284 315 319 375 401 414 415 572 706 747 
1 491520 1 1 16 64 6291456 8192 262112 65528 131072 29360128 4128768 4 508 28 ...

result:

ok correct answer

Pretest #14:

score: 4
Accepted
time: 1ms
memory: 38612kb

input:

14 23
1000 10
0 698723699 153465147 73111165 241423619 281436251 113788324 332818071 542687168 77217995 707859065 70032469 945739237 152178890 73308725 1024104741 39038522 68449065 817070146 484673194 548054722 17751150 1033084930 799709329 351409876 1014395268 477743523 926399631 141641436 10162229...

output:

2629849
10
14
39 305 397 457 514 556 574 667 735 807 917 938 953 998 
1311479 1 33161 1 112 4 428 1 1 3803 1 155 48 1280654 
14
39 48 397 457 514 556 574 667 735 807 917 938 953 998 
1311479 1 33161 1 112 4 428 1 1 3803 1 155 48 1280654 
14
39 397 457 514 556 574 667 735 807 917 938 953 973 998 
131...

result:

ok correct answer

Pretest #15:

score: 4
Accepted
time: 1ms
memory: 34644kb

input:

15 20
1000 10
0 325140143 399467215 271742503 190711881 796467699 212013868 800948731 598735180 276851093 459249598 988722552 598611576 105484598 808958849 841464615 178027765 508254895 206994337 1072632121 1049525925 403545743 729066403 167006626 616418294 1054659905 183353134 221931747 696125686 6...

output:

132910
10
10
101 175 366 497 542 706 707 756 824 902 
1 6482 136 1 280 14 6 16 89186 36788 
10
101 175 365 366 542 706 707 756 824 902 
1 6482 1 136 280 14 6 16 89186 36788 
10
101 175 366 542 548 706 707 756 824 902 
1 6482 136 280 1 14 6 16 89186 36788 
10
101 175 366 542 706 707 756 824 837 902 
...

result:

ok correct answer

Pretest #16:

score: 4
Accepted
time: 3ms
memory: 36688kb

input:

16 13
1000 10
0 482035639 676392463 177349717 883879216 637330885 636356465 296234635 413153479 243419329 335379052 28971145 245253558 649873071 989738887 859470495 546547468 165357700 205836231 930726901 836955479 527409688 413040184 425801996 723492123 804913055 914899671 430466328 1001437510 3421...

output:

938103
10
18
11 26 91 118 119 181 291 302 396 483 523 567 582 669 746 776 961 972 
165268 393313 105609 4858 1 221826 1 55 1 42557 1 183 2196 1 169 2062 1 1 
18
11 26 59 91 118 119 181 291 302 396 483 523 567 582 746 776 961 972 
165268 393313 1 105609 4858 1 221826 1 55 1 42557 1 183 2196 169 2062 ...

result:

ok correct answer

Pretest #17:

score: 4
Accepted
time: 1ms
memory: 38732kb

input:

17 25
1000 10
0 204462620 639500437 1036012729 739663091 537559905 884930259 908629202 87714371 214733383 426959949 412554835 286343676 997368563 336872508 137649097 499408853 98787579 526714350 509336631 438105017 488897961 521760143 786808538 496422268 1006079836 855395010 204030938 325348670 4189...

output:

1515532
10
18
74 135 152 199 257 259 349 414 423 471 519 606 627 680 720 811 984 985 
708963 180 1 278032 4148 28978 1 1 4 1 16 486260 356 7999 1 589 1 1 
18
74 135 152 199 257 259 414 423 456 471 519 606 627 680 720 811 984 985 
708963 180 1 278032 4148 28978 1 4 1 1 16 486260 356 7999 1 589 1 1 
1...

result:

ok correct answer

Pretest #18:

score: 4
Accepted
time: 86ms
memory: 39184kb

input:

18 235
100000 1000
0 82292805 542862389 496765580 714793373 1018727959 380589532 235510694 439236106 450402753 644037967 69084284 398499559 833754127 162045571 1073497987 905929801 414312207 964010413 690834864 244433021 782011334 138519454 409419856 431781810 1035339746 480460956 415997860 10156623...

output:

34345
1000
21
643 2951 9041 14636 26560 37605 42711 47588 49703 51228 56651 71125 73038 79998 83905 84226 85101 86749 90794 96349 97288 
75 2 1 1 65 1 1 1 1 4 1 5777 1 373 24144 1 59 7 56 3773 1 
21
643 2951 9041 14636 26560 37605 42711 47588 49703 51228 56651 63811 71125 73038 79998 83905 84226 851...

result:

ok correct answer

Pretest #19:

score: 4
Accepted
time: 83ms
memory: 39448kb

input:

19 236
100000 1000
0 109677213 768433554 834865731 720533892 838023709 491602375 513068054 1030589833 94664107 745436908 1037219078 228408014 547804495 508518110 773484880 380678427 782156458 113943184 307779979 912132791 587642137 735393238 657215861 44405388 83221805 174662600 163585186 300009673 ...

output:

3319
1000
16
2593 27423 30973 32550 37965 40843 41431 42630 43122 49706 50297 71580 92540 94162 95275 95419 
58 1 84 1 1 1 1 2 33 1 1 1992 648 492 2 1 
16
2593 27423 30973 32550 37965 39125 41431 42630 43122 49706 50297 71580 92540 94162 95275 95419 
58 1 84 1 1 1 1 2 33 1 1 1992 648 492 2 1 
16
259...

result:

ok correct answer

Pretest #20:

score: 4
Accepted
time: 85ms
memory: 39444kb

input:

20 210
100000 1000
0 550139852 961781343 290521815 952492729 457397512 357809864 204830121 1140484 170664856 470999550 1055212876 691814384 638327612 265853133 674623701 160349476 763151462 881390841 355393034 667147513 628883665 627392037 395945621 565511024 979892315 870090061 43124702 944114976 1...

output:

533
1000
17
481 7762 14972 21109 34762 35706 36031 47605 54076 72960 74010 77223 82225 83980 87756 88113 88377 
1 9 1 1 7 1 1 98 4 1 1 1 1 1 53 1 351 
17
481 7762 14972 21109 34762 35706 36031 36993 47605 54076 72960 74010 82225 83980 87756 88113 88377 
1 9 1 1 7 1 1 1 98 4 1 1 1 1 53 1 351 
17
481 ...

result:

ok correct answer

Pretest #21:

score: 4
Accepted
time: 84ms
memory: 39828kb

input:

21 246
100000 1000
0 897255135 331582452 692933508 605776464 745133272 287951719 636521474 674882787 145593015 355040634 666511339 967360297 920416500 1010174993 220923757 1062201185 392857314 952622455 432831665 591343815 983505947 314879003 323044 876019636 3896524 753501041 48852262 176877973 104...

output:

18210
1000
14
9641 14279 14303 21149 22875 27958 29321 36601 49350 50079 58494 66606 73563 92166 
10717 1 1 47 4636 2126 1 190 1 1 331 155 1 2 
14
9641 14279 14303 21149 22875 27958 36601 49350 50079 58494 66606 73563 86416 92166 
10717 1 1 47 4636 2126 190 1 1 331 155 1 1 2 
14
9641 14279 14303 211...

result:

ok correct answer

Pretest #22:

score: 2
Acceptable Answer
time: 13ms
memory: 14156kb

input:

22 237
99999 1000
0 19429538 32580338 239047420 111765496 237262980 10571876 197851450 233191405 192728811 23616992 2112605 201810362 35237428 102317792 1287284 107825938 219438710 182319519 243718852 90090242 90138990 118813262 207877046 233448598 224872276 5939550 82514558 103000114 13729014 79388...

output:

3840
1
13
9 10 232 519 42958 47708 52746 62264 62603 65135 71044 72641 77404 
1 1 1 1 31 469 107 312 6 2867 20 22 2 
31351309
1
5
2 3 4 5 6 
14 22528 29360127 3584 1965056 
83901
1
6
5 6 9 11 15 18 
1 60 65536 1792 16384 128 
159427233
1
10
1 2 5 9 11 15 16 23 28 31 
1 25165824 128 2048 100663296 32...

result:

points 0.5 right answer but not right solutions at 1th solution

Pretest #23:

score: 2
Acceptable Answer
time: 10ms
memory: 14152kb

input:

23 229
99999 1000
0 251252946 107619243 220631496 246783065 243267863 37598061 174732100 119356777 38068361 57156544 232667237 83660542 90081294 219829370 268237117 43024835 122172878 186256566 48858424 81564486 177620789 177890699 37297432 39654072 59706273 144598610 213246934 239565341 192674874 1...

output:

3129
1
10
1 3 54 115 375 927 39798 66691 73096 87117 
1 1 1 1 1 1 7 3071 33 12 
56
1
4
1 5 6 8 
32 16 7 1 
16722
1
2
1 3 
14120 2602 
13749
1
10
3 8 13 18 19 20 24 25 30 31 
1 8 8188 30 6 496 1280 3584 124 32 
9
1
3
3 4 5 
1 4 4 
1177216
1
2
2 3 
919168 258048 
71158
1
5
1 2 4 5 6 
49149 506 16380 5...

result:

points 0.5 right answer but not right solutions at 1th solution

Pretest #24:

score: 2
Acceptable Answer
time: 21ms
memory: 14028kb

input:

24 295
99999 2000
0 144446187652890493 178777776597373669 235188002077979946 277503908732511739 47638688657611750 68964406333979880 151013710872842158 146243386861595119 99485082905765142 200318010185323152 282591375727049216 123011484444631758 286520503049914226 232871465119451744 18280893731725023...

output:

5526392210479
1
31
5 9 32 41 252 709 4050 7099 17076 42196 51567 52136 52400 52776 54144 54273 59077 65328 65860 68328 69557 76691 79214 79445 82198 87737 87750 91537 92079 95909 97562 
1 1 1 1 1 1 1 4003 2714127705519 131217420705 23 110945309 26401935 2619991761857 3 184215720 46 646807383 9 38913...

result:

points 0.5 right answer but not right solutions at 1th solution

Pretest #25:

score: 2
Acceptable Answer
time: 21ms
memory: 13984kb

input:

25 302
99999 2000
0 158060258327551 71283336971520116 219425730293845004 160993545682455627 118267401240028100 71239693681579669 269286666497227789 93391159342185951 23853690640806525 151733498955852704 124666395764102330 67021920580696748 119814027172684125 70463976282802752 2939723111608543 127044...

output:

4114663026142
1
30
7 40 46 631 3523 6116 20429 25027 25388 29582 33091 36098 47575 48727 51461 51955 51968 54072 54466 61700 65008 67847 68197 73653 76692 77756 78263 81349 93188 97771 
1 1 1 1 1 113 26140037 2 1 3201994587 2804655 518817662748 3363252745111 4361069 31820 1 982906017 12160709 565068...

result:

points 0.5 right answer but not right solutions at 1th solution


Final Tests

Test #1:

score: 4
Accepted
time: 19ms
memory: 38740kb

input:

1 10000
2 1
324097321 555675086
2 1
304655177 991244276
2 1
9980291 383616352
2 1
1071036550 795625380
2 1
682098056 68370721
2 1
969101726 685975156
2 1
973896269 354857775
2 1
196188000 606494155
2 1
754416123 467588829
2 1
495704303 558090120
2 1
618002000 491488050
2 1
741575237 9937018
2 1
1002...

output:

231577765
1
1
1 
231577765 
686589099
1
1
1 
686589099 
373636061
1
1
1 
373636061 
275411170
1
1
2 
275411170 
613727335
1
1
2 
613727335 
283126570
1
1
2 
283126570 
619038494
1
1
2 
619038494 
410306155
1
1
1 
410306155 
286827294
1
1
2 
286827294 
62385817
1
1
1 
62385817 
126513950
1
1
2 
12651...

result:

ok correct answer

Test #2:

score: 4
Accepted
time: 1ms
memory: 36688kb

input:

2 5
5 2000
0 13 3 4 10
5 2000
0 3 9 1 11
5 2000
0 13 7 3 5
5 2000
0 1 13 9 2
5 2000
0 8 14 7 13

output:

0
1
0


0
1
0


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

result:

ok correct answer

Test #3:

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

input:

3 5
5 2000
0 4 14 5 7
5 2000
0 2 15 0 12
5 2000
0 1 14 0 5
5 2000
0 13 4 12 3
5 2000
0 10 10 1 11

output:

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

result:

ok correct answer

Test #4:

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

input:

4 5
5 2000
0 6 15 10 1
5 2000
0 15 0 13 10
5 2000
0 5 7 5 1
5 2000
0 13 3 2 15
5 2000
0 2 4 7 0

output:

2
5
2
2 5 
1 1 
2
4 5 
1 1 
2
1 5 
1 1 
1
5 
2 
1
1 
2 
8
2
1
3 
8 
1
1 
8 
4
2
2
4 5 
1 3 
2
2 5 
1 3 
1
1
1
2 
1 
1
4
1
2 
1 
1
3 
1 
1
5 
1 
1
1 
1 

result:

ok correct answer

Test #5:

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

input:

5 5
6 2000
0 45 517 811 107 132
6 2000
0 382 576 805 419 579
6 2000
0 379 809 441 331 67
6 2000
0 565 776 959 852 383
6 2000
0 613 383 829 47 441

output:

146
20
5
1 2 3 5 6 
1 19 1 1 124 
4
2 3 5 6 
19 1 1 125 
4
2 3 5 6 
20 1 1 124 
4
2 3 5 6 
19 1 2 124 
4
2 3 5 6 
19 2 1 124 
4
1 2 5 6 
2 19 1 124 
3
2 5 6 
19 1 126 
3
2 5 6 
21 1 124 
3
2 5 6 
19 3 124 
5
1 2 3 4 6 
1 19 1 1 124 
4
2 3 4 6 
19 1 1 125 
4
2 3 4 6 
20 1 1 124 
4
2 3 4 6 
19 1 2 124...

result:

ok correct answer

Test #6:

score: 4
Accepted
time: 1ms
memory: 38612kb

input:

6 5
6 2000
0 75 173 555 637 905
6 2000
0 934 118 906 367 728
6 2000
0 244 321 598 625 469
6 2000
0 573 489 24 480 459
6 2000
0 424 356 750 623 871

output:

557
483
5
1 2 3 5 6 
8 53 342 131 23 
5
1 2 3 5 6 
8 53 341 132 23 
5
1 2 3 5 6 
8 54 341 131 23 
5
1 2 3 5 6 
8 53 341 131 24 
5
1 2 3 5 6 
9 53 341 131 23 
5
1 2 3 5 6 
8 53 340 133 23 
5
1 2 3 5 6 
8 53 339 134 23 
5
1 2 3 5 6 
8 54 339 133 23 
5
1 2 3 5 6 
8 53 339 133 24 
5
1 2 3 5 6 
9 53 339 ...

result:

ok correct answer

Test #7:

score: 4
Accepted
time: 1ms
memory: 38604kb

input:

7 5
6 2000
0 886 972 226 813 407
6 2000
0 219 190 742 101 572
6 2000
0 590 423 516 1017 46
6 2000
0 388 807 207 205 647
6 2000
0 408 180 238 300 694

output:

176
25
5
1 2 4 5 6 
8 10 30 19 109 
5
1 2 4 5 6 
8 10 34 19 105 
5
1 2 4 5 6 
8 14 30 19 105 
5
1 2 4 5 6 
8 10 30 23 105 
5
1 2 4 5 6 
12 10 30 19 105 
5
1 2 4 5 6 
4 10 30 19 113 
4
2 4 5 6 
10 30 19 117 
4
2 4 5 6 
10 34 19 113 
4
2 4 5 6 
14 30 19 113 
4
2 4 5 6 
10 30 23 113 
5
1 2 4 5 6 
4 10 ...

result:

ok correct answer

Test #8:

score: 2
Acceptable Answer
time: 10ms
memory: 14032kb

input:

8 257
100000 100
32768 65536 262144 32768 8388608 1048576 4 67108864 16384 32768 262144 8192 512 134217728 65536 4194304 262144 67108864 1024 262144 64 32 65536 2097152 268435456 1 2048 4194304 16777216 8 16384 2 2048 16777216 268435456 262144 1048576 8388608 16 268435456 2 128 4194304 262144 32768 ...

output:

303389274
1
13
2 3 6 9 13 21 25 27 30 32 39 62 66 
65536 262144 1048576 16384 512 64 268435456 2048 8 2 16 4096 33554432 
1
1
1
1 
1 
188156
1
8
2 3 4 6 7 10 13 16 
3584 128 32 64 131072 4096 28 49152 
5
1
2
1 11 
1 4 
7388192
1
7
1 3 4 5 6 7 16 
8 2097152 4194304 1048576 32768 24 15360 
1044482
1
2...

result:

points 0.5 right answer but not right solutions at 1th solution

Test #9:

score: 2
Acceptable Answer
time: 10ms
memory: 14160kb

input:

9 266
100000 100
134217728 524288 8388608 4 8 8388608 33554432 4 536870912 4 16 8 33554432 33554432 256 65536 8 16 64 8 256 2048 268435456 256 8192 2 1024 65536 32 2048 134217728 8 1048576 8 16777216 33554432 1024 33554432 131072 16 2 33554432 8192 512 4194304 2048 268435456 256 536870912 16777216 1...

output:

269988539
1
15
5 11 16 23 25 26 29 33 39 44 61 65 71 95 121 
8 16 65536 268435456 8192 2 32 1048576 131072 512 262144 128 1 32768 4096 
128
1
5
1 2 4 5 8 
4 4 8 64 48 
2111
1
5
3 6 10 24 26 
1 4 2 56 2048 
24648843
1
8
1 2 4 12 17 22 24 27 
8 6144 6291456 1024 16777216 3 128 1572864 
38738
1
6
1 2 4...

result:

points 0.5 right answer but not right solutions at 1th solution

Test #10:

score: 2
Acceptable Answer
time: 9ms
memory: 12108kb

input:

10 269
100000 100
1048576 2 64 67108864 1024 67108864 268435456 32768 8388608 32 256 2 268435456 262144 524288 262144 2 524288 64 8192 262144 536870912 2097152 64 1024 2 1048576 128 2 8388608 512 32768 1 8388608 4 2 268435456 128 67108864 65536 2 8388608 2048 16 2048 4096 32768 1048576 32768 32 8388...

output:

471323918
1
15
1 2 4 5 7 8 11 14 35 40 46 53 61 74 114 
1048576 2 67108864 1024 268435456 32768 256 262144 4 65536 4096 131072 8 16384 134217728 
522240
1
1
2 
522240 
408220
1
8
1 7 10 11 13 16 20 24 
262144 16 128 14336 8 131072 4 512 
15334
1
4
1 6 8 11 
96 896 14336 6 
0
1
0


130666
1
5
1 3 4 7...

result:

points 0.5 right answer but not right solutions at 1th solution

Test #11:

score: 4
Accepted
time: 25ms
memory: 14032kb

input:

11 2323
100000 1
0 3170633 888529329 347839787 101667249 273239696 1028446182 411994109 710973319 298677951 299452068 519308796 361451040 488605068 74238166 997794448 478367019 532094220 747266199 217905213 682359917 774814810 234838947 456387659 38459020 434013070 633290806 173828476 94076883 56828...

output:

11962
1
15
4 10 88 212 523 954 2474 5529 5764 8448 33798 38129 47454 49541 78515 
1 1 1 1 1 1 1 19 1 54 8212 139 1 2165 1364 
1607036
1
11
4 6 7 12 15 16 22 25 26 28 29 
65471 32512 6 520064 978944 6136 3836 1 4 60 2 
106
1
3
1 2 3 
41 20 45 
3
1
2
1 2 
1 2 
126
1
5
1 3 5 9 10 
1 12 7 60 46 
727
1
6...

result:

ok correct answer

Test #12:

score: 4
Accepted
time: 26ms
memory: 11984kb

input:

12 2205
100000 1
0 684191025 220215685 982495864 602362406 687396179 439432236 81065680 398068897 269754402 306183653 309939439 664994998 1011962742 338161922 629593565 926305057 1026259775 711874360 69406110 426672919 208267066 551253027 9384823 26156203 778817402 654214308 527029151 1065024353 287...

output:

22539
1
18
1 2 6 21 79 252 901 1463 3023 8561 9642 11813 14681 21599 38540 38873 89268 92825 
1 1 1 1 1 1 1 1 1 1 18405 5 1 2826 14 846 404 28 
5296170
1
10
3 8 9 11 12 16 19 20 30 38 
2 1048320 64 4194240 30 6142 31744 15360 16 252 
2997548
1
3
3 4 5 
7998 1031664 1957886 
10
1
2
1 5 
2 8 
73171
1
...

result:

ok correct answer

Test #13:

score: 4
Accepted
time: 25ms
memory: 14024kb

input:

13 2166
100000 1
0 58930516 543560994 783997157 728082180 789115629 549794748 81818067 214839912 203394814 711969322 908524000 570262778 992867922 359455295 88035653 412186516 937931728 331800409 545354553 535440658 894562512 657466952 555070606 469471475 1055263866 874958292 76960239 478302168 6800...

output:

8241
1
16
1 4 28 66 72 394 473 709 1894 26786 29190 33285 54258 68234 72809 82425 
1 1 1 63 1 1 1 1 1 5 7798 1 156 192 4 14 
2846999
1
4
1 2 4 5 
202000 103522 1978946 562531 
1605
1
6
1 2 6 7 8 12 
1 1 96 4 1023 480 
21150
1
4
1 2 3 5 
47 13205 4050 3848 
13
1
2
1 2 
7 6 
0
1
0


1667525
1
7
1 3 12...

result:

ok correct answer

Test #14:

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

input:

14 23
1000 10
0 357293452 452461848 986047039 546588280 762710079 767831017 39741545 416114273 515599366 1018969624 603342125 928112286 1053016142 240953466 533088067 1028134429 504727014 371307863 834428873 968387878 478550336 1047217797 1046651542 777749850 866989319 92995163 251915198 363285573 1...

output:

264227
10
12
85 134 203 355 565 673 677 786 876 955 996 999 
1 5 2638 9 531 1 1 697 251113 10 5226 3995 
12
85 134 203 355 565 673 748 786 876 955 996 999 
1 5 2638 9 531 1 1 697 251113 10 5226 3995 
12
85 132 134 203 355 565 673 786 876 955 996 999 
1 1 5 2638 9 531 1 697 251113 10 5226 3995 
12
59...

result:

ok correct answer

Test #15:

score: 4
Accepted
time: 1ms
memory: 36724kb

input:

15 23
1000 10
0 978686021 287986921 276311856 889616598 739968417 1060147652 463275477 172393699 591333230 983197307 235514434 330494755 449056272 882229818 781111474 275587745 980041928 334198691 305313012 415758352 947298893 950211162 909723054 961622596 917454340 161928901 404346316 369133631 103...

output:

709905
10
15
32 159 163 279 283 347 482 656 677 727 842 917 954 977 978 
56 1 1 3862 6 1 12836 4 1 47 693086 1 1 1 1 
15
32 159 163 279 283 347 482 608 656 677 727 842 917 977 978 
56 1 1 3862 6 1 12836 1 4 1 47 693086 1 1 1 
15
32 159 163 279 283 347 482 656 677 727 761 842 917 977 978 
56 1 1 3862...

result:

ok correct answer

Test #16:

score: 4
Accepted
time: 2ms
memory: 36548kb

input:

16 15
1000 10
0 631723071 149784582 965844254 515554472 887253148 467825521 981769969 1054193550 627909969 590277818 159342752 658063143 667914173 169490051 25536270 337269419 1056885019 980490575 750858271 553446484 347553447 376197986 1053224035 473470890 123586 97769047 761755924 510998818 256094...

output:

737485
10
15
162 172 265 384 387 474 599 625 643 747 790 831 880 924 960 
1 27 227 215546 1 2917 6 7 1 87404 1600 16 41649 388082 1 
15
65 162 172 265 384 387 474 599 625 643 747 790 831 880 924 
1 1 27 227 215546 1 2917 6 7 1 87404 1600 16 41649 388082 
15
162 172 265 384 387 474 599 625 643 747 79...

result:

ok correct answer

Test #17:

score: 4
Accepted
time: 1ms
memory: 36720kb

input:

17 25
1000 10
0 751950140 901599329 987895071 306253500 278530668 539473653 911723672 948474628 722632384 369217860 428703545 999113214 567923990 53499297 1013528916 263060554 669297221 349021033 832596533 893306880 892438572 345611286 331257977 488113061 578929864 881846255 320356815 76057168 70469...

output:

1119212
10
14
69 97 122 215 236 430 431 528 552 555 576 717 887 950 
1 7 5641 149775 107 1 6002 26620 674 1 1237 6239 922903 4 
14
97 122 215 236 307 430 431 528 552 555 576 717 887 950 
7 5641 149775 107 1 1 6002 26620 674 1 1237 6239 922903 4 
14
97 122 215 236 430 431 528 552 555 576 685 717 887 ...

result:

ok correct answer

Test #18:

score: 4
Accepted
time: 85ms
memory: 40816kb

input:

18 195
100000 1000
0 828483622 617711013 242092397 1034026464 456205583 731635466 382894773 533786631 582730039 74863848 661821965 368857719 541353387 662605236 580923280 798012506 54823622 333416217 39292129 995195996 477140985 1014499425 362164396 970752859 879997855 96768859 1005365898 576674982 ...

output:

23456
1000
17
5250 7223 8651 12609 21594 22555 26970 27646 27770 33985 37411 43854 57508 83761 94288 94649 96808 
1 1743 3 20988 1 1 34 4 1 1 1 3 1 1 279 1 393 
17
5250 7223 8651 12609 21594 26970 27646 27770 33985 37411 43854 57508 62999 83761 94288 94649 96808 
1 1743 3 20988 1 34 4 1 1 1 3 1 1 1 ...

result:

ok correct answer

Test #19:

score: 4
Accepted
time: 85ms
memory: 39568kb

input:

19 228
100000 1000
0 230727359 951312015 741711018 367230626 775024687 130794976 435788836 781961691 736694220 427610697 1016199868 798240399 340962994 1006804448 708169239 976753368 364431996 495851435 246658001 190094424 1054346726 639713727 218794912 229693460 313349630 85091951 418997497 2734590...

output:

5906
1000
18
18000 26070 27090 31031 36690 49706 52983 57045 57375 60712 63184 67455 67985 75071 94039 97479 97656 99233 
1 1 1 2 71 1 1 1 2 11 28 3 4034 1 20 1071 656 1 
18
9580 18000 26070 27090 31031 36690 49706 57045 57375 60712 63184 67455 67985 75071 94039 97479 97656 99233 
1 1 1 1 2 71 1 1 2...

result:

ok correct answer

Test #20:

score: 4
Accepted
time: 84ms
memory: 40672kb

input:

20 221
100000 1000
0 716795222 632538294 1008333912 248043863 1023411987 11954597 917179098 100756831 19780613 336926235 768679016 371044675 360783184 402042708 1056697208 567354265 284551620 146863144 1008241012 536649321 680142584 506474136 80860918 973856876 30288601 668537691 877380398 131785980...

output:

13893
1000
15
8817 12957 16017 23446 31013 45965 49780 53134 68169 70942 82418 86486 88194 90245 94588 
307 22 1 1 10 1 2415 1 2 1 33 1 1 1 11096 
15
8817 12957 16017 23446 31013 49780 53134 68169 70308 70942 82418 86486 88194 90245 94588 
307 22 1 1 10 2415 1 2 1 1 33 1 1 1 11096 
15
8817 12957 160...

result:

ok correct answer

Test #21:

score: 4
Accepted
time: 83ms
memory: 40460kb

input:

21 204
100000 1000
0 867143449 289720871 62880653 256495758 373546157 114942061 524281177 164218453 261500635 241690011 911469619 794136322 460604293 201667773 1001245336 873383805 136426866 731765422 1036091702 428463064 474020221 916532901 913755707 704796468 745115429 387268771 611877390 10158806...

output:

1241
1000
11
7982 17864 17963 47178 55333 66676 69260 72308 84132 87997 98425 
1 1 132 11 1 119 1 970 1 1 3 
11
7982 17864 17963 47178 55333 57921 66676 69260 72308 87997 98425 
1 1 132 11 1 1 119 1 970 1 3 
11
7982 17864 17963 47178 54490 55333 66676 69260 72308 87997 98425 
1 1 132 11 1 1 119 1 97...

result:

ok correct answer

Test #22:

score: 2
Acceptable Answer
time: 12ms
memory: 14160kb

input:

22 259
99999 1000
0 184042404 114860590 81955939 149152356 141033215 259145072 144981065 194732174 87943638 3239431 196977178 27923106 209711053 259763893 143914852 152580789 5161376 220134523 49139129 179593854 115442954 268238166 42599190 6509126 76156465 153820967 111093283 89981466 186373935 684...

output:

553
1
13
6 8 30 168 185 816 1337 2458 8259 28126 37309 74516 89972 
1 1 1 1 1 1 1 1 1 253 1 11 279 
42746320
1
3
1 3 4 
31484040 7472315 3789965 
6761
1
3
2 3 4 
652 664 5445 
3480
1
5
1 2 5 8 9 
32 1980 12 1264 192 
1298539109
1
14
4 5 7 9 12 13 14 16 24 25 26 31 32 33 
512 504 1920 262128 12050432...

result:

points 0.5 right answer but not right solutions at 1th solution

Test #23:

score: 2
Acceptable Answer
time: 14ms
memory: 14160kb

input:

23 229
99999 1000
0 67684423 27530736 262933500 210540490 87986446 142495215 8108489 162333902 7472566 74649932 22340176 96113149 105072940 96282592 479313 231805795 113210597 21907161 131354773 137785844 44861082 60046190 195538723 185926550 49537906 255986573 48373131 153611664 98228321 259354412 ...

output:

1406
1
14
17 38 201 945 7858 23217 28521 39604 40342 42925 46982 47165 73472 73671 
1 1 1 1 15 1 81 187 207 1 130 2 47 731 
76226279
1
6
1 2 3 4 7 9 
989 58712048 260092 524159 16728064 927 
8710
1
5
1 4 5 13 15 
2 512 4 6144 2048 
1027
1
4
2 3 6 9 
2 1008 1 16 
10
1
3
1 2 3 
7 1 2 
484142
1
6
3 4 5...

result:

points 0.5 right answer but not right solutions at 1th solution

Test #24:

score: 2
Acceptable Answer
time: 20ms
memory: 14024kb

input:

24 299
99999 2000
0 46856671573051356 144451722821279396 194202742420356088 42768202435393968 146930968341077918 121735975802283045 43381059403904591 9790356926653248 90585698509588415 182205406048046442 106698163084666387 83495547377102990 95530264027271484 151047337738852707 263069394355867183 215...

output:

3144886350134
1
27
27 32 368 409 2980 3421 3739 4700 5256 5906 6949 16115 19764 21141 25835 27859 30961 31845 46521 48368 49133 71057 78175 88091 90046 97499 98974 
1 1 1 1 169076 1 1 1497224288718 1 1 5830 933386637 67487321 91372840416 2152295861 1521611014901 1532 1 499432150 79 12269454815 12569...

result:

points 0.5 right answer but not right solutions at 1th solution

Test #25:

score: 2
Acceptable Answer
time: 21ms
memory: 14156kb

input:

25 308
99999 2000
0 62481075687254565 108220925926439751 147822046782831506 143330595029626008 266264147751224285 261103833765129444 47417861284547971 240063309104990334 57610062682346847 86133126920120030 166996559481841953 262167570538721871 37862622740033692 1564310050448344 238599881630673329 84...

output:

1899280322188
1
31
1 2 10 13 136 187 237 1356 2278 3636 15132 15147 17538 18067 19843 23023 29630 34798 41115 41884 50818 57179 57679 66896 72504 75474 76054 79898 80838 97728 98598 
1 1 1 1 1 1 1 64573475 1729 30706446 5081 1 76 3582624376 29658 783168 3 8 3128937444 1032 2314 1618610116420 3582600...

result:

points 0.5 right answer but not right solutions at 1th solution