QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#303478#7688. Alea Iacta EstzhouhuanyiWA 155ms32464kbC++142.4kb2024-01-12 16:42:582024-01-12 16:42:58

Judging History

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

  • [2024-01-12 16:42:58]
  • 评测
  • 测评结果:WA
  • 用时:155ms
  • 内存:32464kb
  • [2024-01-12 16:42:58]
  • 提交

answer

#include<iostream>
#include<cstdio>
#define N 3000000
using namespace std;
const int inf=(int)(1e9);
int read()
{
	char c=0;
	int sum=0;
	while (c<'0'||c>'9') c=getchar();
	while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
	return sum;
}
int gcd(int x,int y)
{
	if (!y) return x;
	return gcd(y,x%y);
}
int T,n,m,v[N+1],tong[N+1],tong2[N+1],length,length2;
bool nprime[N+1];
long long res,ans;
int main()
{
	int rt,x,y,d;
	v[1]=1;
	for (int i=2;i<=N;++i)
		if (!nprime[i])
		{
			v[i]=i;
			for (int j=(i<<1);j<=N;j+=i)
			{
				nprime[j]=1;
				if (!v[j]) v[j]=i;
			}
		}
	T=read();
	while (T--)
	{
		n=read(),m=read(),res=1ll*n*m,ans=n+m+min(n,m),d=v[gcd(n,m)],rt=length=length2=0;
		if (d!=1&&(d!=n||d!=m)) ans=n+m;
		for (int i=1;1ll*i*i<=res;++i)
			if (i!=n&&i!=m&&res%i==0&&i+res/i<ans)
				ans=i+res/i,rt=i;
		if (rt)
		{
			x=gcd(rt,n),y=rt/x,length=length2=0;
			for (int i=0;i<x;++i)
				for (int j=0;j<y;++j)
					tong[++length]=i+j+1;
			for (int i=0;i<n/x;++i)
				for (int j=0;j<m/y;++j)
					tong2[++length2]=x*i+y*j+1;
			printf("%d ",length);
			for (int i=1;i<=length;++i) printf("%d ",tong[i]);
			puts("");
			printf("%d ",length2);
			for (int i=1;i<=length2;++i) printf("%d ",tong2[i]);
			puts("");
		}
		else
		{
			length=length2=0;
			if (d!=1&&(d!=n||d!=m))
			{
				for (int i=0;i<n/d;++i)
					for (int j=0;j<d;++j)
						tong[++length]=i*d+j*(m/d)+1;
				for (int i=0;i<m/d;++i)
					for (int j=0;j<d;++j)
						tong2[++length2]=i+j+1;
				printf("%d ",length);
				for (int i=1;i<=length;++i) printf("%d ",tong[i]);
				puts("");
				printf("%d ",length2);
				for (int i=1;i<=length2;++i) printf("%d ",tong2[i]);
				puts("");
			}
			else if (n<m)
			{
				for (int i=0;i<n;++i) tong[++length]=i+1,tong[++length]=i+1;
				for (int i=0;i<m;++i) tong2[++length2]=i+1;
				printf("%d ",length);
				for (int i=1;i<=length;++i) printf("%d ",tong[i]);
				puts("");
				printf("%d ",length2);
				for (int i=1;i<=length2;++i) printf("%d ",tong2[i]);
				puts("");
			}
			else
			{
				for (int i=0;i<n;++i) tong[++length]=i+1;
				for (int i=0;i<m;++i) tong2[++length2]=i+1,tong2[++length2]=i+1;
				printf("%d ",length);
				for (int i=1;i<=length;++i) printf("%d ",tong[i]);
				puts("");
				printf("%d ",length2);
				for (int i=1;i<=length2;++i) printf("%d ",tong2[i]);
				puts("");
			}
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 24ms
memory: 21356kb

input:

3
2 8
1 9
2 9

output:

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

result:

ok Correct. (3 test cases)

Test #2:

score: 0
Accepted
time: 36ms
memory: 23400kb

input:

1
40013 40013

output:

40013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok Correct. (1 test case)

Test #3:

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

input:

1
40013 1

output:

40013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 10...

result:

ok Correct. (1 test case)

Test #4:

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

input:

1
2 40013

output:

4 1 1 2 2 
40013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 9...

result:

ok Correct. (1 test case)

Test #5:

score: 0
Accepted
time: 32ms
memory: 21516kb

input:

1
3 40013

output:

6 1 1 2 2 3 3 
40013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 ...

result:

ok Correct. (1 test case)

Test #6:

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

input:

1
4 40013

output:

8 1 1 2 2 3 3 4 4 
40013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95...

result:

ok Correct. (1 test case)

Test #7:

score: 0
Accepted
time: 155ms
memory: 32464kb

input:

1
999983 999983

output:

999983 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct. (1 test case)

Test #8:

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

input:

1
1 999983

output:

2 1 1 
999983 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 9...

result:

ok Correct. (1 test case)

Test #9:

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

input:

1
2 999983

output:

4 1 1 2 2 
999983 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 ...

result:

ok Correct. (1 test case)

Test #10:

score: 0
Accepted
time: 70ms
memory: 27556kb

input:

1
999983 3

output:

999983 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct. (1 test case)

Test #11:

score: 0
Accepted
time: 66ms
memory: 25500kb

input:

1
999983 4

output:

999983 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

ok Correct. (1 test case)

Test #12:

score: 0
Accepted
time: 115ms
memory: 29548kb

input:

1
1000000 1000000

output:

1000000 1 500001 3 500003 5 500005 7 500007 9 500009 11 500011 13 500013 15 500015 17 500017 19 500019 21 500021 23 500023 25 500025 27 500027 29 500029 31 500031 33 500033 35 500035 37 500037 39 500039 41 500041 43 500043 45 500045 47 500047 49 500049 51 500051 53 500053 55 500055 57 500057 59 5000...

result:

ok Correct. (1 test case)

Test #13:

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

input:

1
1000000 1

output:

1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #14:

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

input:

1
1000000 2

output:

1250 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #15:

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

input:

1
3 1000000

output:

1600 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #16:

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

input:

1
4 1000000

output:

2000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #17:

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

input:

1
988027 988027

output:

988027 1 998 1995 2992 3989 4986 5983 6980 7977 8974 9971 10968 11965 12962 13959 14956 15953 16950 17947 18944 19941 20938 21935 22932 23929 24926 25923 26920 27917 28914 29911 30908 31905 32902 33899 34896 35893 36890 37887 38884 39881 40878 41875 42872 43869 44866 45863 46860 47857 48854 49851 50...

result:

ok Correct. (1 test case)

Test #18:

score: 0
Accepted
time: 32ms
memory: 21436kb

input:

1
988027 1

output:

991 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #19:

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

input:

1
2 988027

output:

997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #20:

score: 0
Accepted
time: 32ms
memory: 23408kb

input:

1
3 988027

output:

997 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #21:

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

input:

1
4 988027

output:

1982 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #22:

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

input:

1
995779 995779

output:

995779 1 1014 2027 3040 4053 5066 6079 7092 8105 9118 10131 11144 12157 13170 14183 15196 16209 17222 18235 19248 20261 21274 22287 23300 24313 25326 26339 27352 28365 29378 30391 31404 32417 33430 34443 35456 36469 37482 38495 39508 40521 41534 42547 43560 44573 45586 46599 47612 48625 49638 50651 ...

result:

ok Correct. (1 test case)

Test #23:

score: 0
Accepted
time: 32ms
memory: 21356kb

input:

1
1 995779

output:

983 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #24:

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

input:

1
995779 2

output:

1013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #25:

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

input:

1
995779 3

output:

1013 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #26:

score: 0
Accepted
time: 25ms
memory: 23404kb

input:

1
995779 4

output:

1966 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 ...

result:

ok Correct. (1 test case)

Test #27:

score: 0
Accepted
time: 89ms
memory: 27588kb

input:

1
720720 720720

output:

720720 1 360361 3 360363 5 360365 7 360367 9 360369 11 360371 13 360373 15 360375 17 360377 19 360379 21 360381 23 360383 25 360385 27 360387 29 360389 31 360391 33 360393 35 360395 37 360397 39 360399 41 360401 43 360403 45 360405 47 360407 49 360409 51 360411 53 360413 55 360415 57 360417 59 36041...

result:

ok Correct. (1 test case)

Test #28:

score: 0
Accepted
time: 32ms
memory: 21412kb

input:

1
720720 1

output:

840 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #29:

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

input:

1
2 720720

output:

1170 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #30:

score: 0
Accepted
time: 32ms
memory: 23400kb

input:

1
3 720720

output:

1456 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #31:

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

input:

1
4 720720

output:

1680 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #32:

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

input:

1
524288 524288

output:

524288 1 262145 3 262147 5 262149 7 262151 9 262153 11 262155 13 262157 15 262159 17 262161 19 262163 21 262165 23 262167 25 262169 27 262171 29 262173 31 262175 33 262177 35 262179 37 262181 39 262183 41 262185 43 262187 45 262189 47 262191 49 262193 51 262195 53 262197 55 262199 57 262201 59 26220...

result:

ok Correct. (1 test case)

Test #33:

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

input:

1
1 524288

output:

512 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #34:

score: 0
Accepted
time: 26ms
memory: 23460kb

input:

1
2 524288

output:

1024 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #35:

score: 0
Accepted
time: 25ms
memory: 23400kb

input:

1
3 524288

output:

1024 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #36:

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

input:

1
524288 4

output:

1024 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #37:

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

input:

1
531441 531441

output:

531441 1 177148 354295 4 177151 354298 7 177154 354301 10 177157 354304 13 177160 354307 16 177163 354310 19 177166 354313 22 177169 354316 25 177172 354319 28 177175 354322 31 177178 354325 34 177181 354328 37 177184 354331 40 177187 354334 43 177190 354337 46 177193 354340 49 177196 354343 52 1771...

result:

ok Correct. (1 test case)

Test #38:

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

input:

1
1 531441

output:

729 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #39:

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

input:

1
2 531441

output:

729 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #40:

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

input:

1
531441 3

output:

729 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #41:

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

input:

1
531441 4

output:

1458 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 ...

result:

ok Correct. (1 test case)

Test #42:

score: 0
Accepted
time: 81ms
memory: 27484kb

input:

1
510510 510510

output:

510510 1 255256 3 255258 5 255260 7 255262 9 255264 11 255266 13 255268 15 255270 17 255272 19 255274 21 255276 23 255278 25 255280 27 255282 29 255284 31 255286 33 255288 35 255290 37 255292 39 255294 41 255296 43 255298 45 255300 47 255302 49 255304 51 255306 53 255308 55 255310 57 255312 59 25531...

result:

ok Correct. (1 test case)

Test #43:

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

input:

1
510510 1

output:

714 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #44:

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

input:

1
510510 2

output:

1001 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #45:

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

input:

1
3 510510

output:

1190 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #46:

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

input:

1
4 510510

output:

1428 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101...

result:

ok Correct. (1 test case)

Test #47:

score: 0
Accepted
time: 51ms
memory: 25496kb

input:

1
279936 279936

output:

279936 1 139969 3 139971 5 139973 7 139975 9 139977 11 139979 13 139981 15 139983 17 139985 19 139987 21 139989 23 139991 25 139993 27 139995 29 139997 31 139999 33 140001 35 140003 37 140005 39 140007 41 140009 43 140011 45 140013 47 140015 49 140017 51 140019 53 140021 55 140023 57 140025 59 14002...

result:

ok Correct. (1 test case)

Test #48:

score: 0
Accepted
time: 32ms
memory: 23560kb

input:

1
279936 1

output:

486 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #49:

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

input:

1
279936 2

output:

729 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #50:

score: 0
Accepted
time: 36ms
memory: 23480kb

input:

1
279936 3

output:

864 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #51:

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

input:

1
4 279936

output:

972 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #52:

score: 0
Accepted
time: 106ms
memory: 27500kb

input:

1
871933 871933

output:

871933 1 9798 19595 29392 39189 48986 58783 68580 78377 88174 97971 107768 117565 127362 137159 146956 156753 166550 176347 186144 195941 205738 215535 225332 235129 244926 254723 264520 274317 284114 293911 303708 313505 323302 333099 342896 352693 362490 372287 382084 391881 401678 411475 421272 4...

result:

ok Correct. (1 test case)

Test #53:

score: 0
Accepted
time: 29ms
memory: 21428kb

input:

1
871933 1

output:

101 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #54:

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

input:

1
2 871933

output:

202 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #55:

score: 0
Accepted
time: 30ms
memory: 23480kb

input:

1
3 871933

output:

303 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #56:

score: 0
Accepted
time: 32ms
memory: 23456kb

input:

1
4 871933

output:

404 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 ...

result:

ok Correct. (1 test case)

Test #57:

score: -100
Wrong Answer
time: 118ms
memory: 29536kb

input:

1
1000000 999999

output:

999000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...

result:

wrong answer Jury has a better answer. (test case 1)