QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#239984 | #7688. Alea Iacta Est | ucup-team197# | WA | 364ms | 139124kb | C++14 | 2.4kb | 2023-11-05 01:59:51 | 2023-11-05 01:59:51 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define int long long
typedef long long ll;
#define fi first
#define se second
const int N=3e6+5;
const int iu=1e6;
vector<int>pf[N];
ll n,m;
int sz=0;
ll v[N];
void gen(vector<pair<ll,ll> >&g,int id,ll cur){
if(id==g.size()){
v[++sz]=cur;
return;
}
for(int i=0; i<g[id].fi ;i++){
ll dx=i*g[id].se;
gen(g,id+1,cur+dx);
}
}
ll gcd(ll x,ll y){
if(y==0) return x;
return gcd(y,x%y);
}
void dumb(){
cout << 2*n << ' ';
for(int i=1; i<=n ;i++) cout << i << ' ' << i << ' ';
cout << '\n';
cout << m << ' ';
for(int i=1; i<=m ;i++) cout << i << ' ';
cout << '\n';
}
ll test_dumb(){
return 2*n+m;
}
void solve(){
cin >> n >> m;
if(n>m) swap(n,m);
if(n==1 && pf[m].size()<=1){
dumb();
return;
}
ll xs=n;
for(ll s=n+1; s<=m ;s++){
if(s*s>n*m) break;
if(n*m%s==0) xs=s;
}
ll g=gcd(n,m);
if(n==m && pf[n].size()==1) g=1;
vector<pair<ll,ll> >gl,gr;
if(xs==n && g!=1){//score = n+m
ll p=pf[g][0];
for(int i=0; i<pf[n].size() ;i++){
if(pf[n][i]==p){
swap(pf[n][0],pf[n][i]);
break;
}
}
{
ll step=1;
for(auto c:pf[n]){
gl.push_back({c,step});
step*=c;
}
}
for(int i=0; i<pf[m].size() ;i++){
if(pf[m][i]==p){
swap(pf[m][0],pf[m][i]);
break;
}
}
swap(pf[m][0],pf[m].back());
{
ll step=1;
for(auto c:pf[m]){
gr.push_back({c,step});
step*=c;
}
}
swap(gl[0],gr.back());
}
else{
if(xs==n){
xs--;
while(n*m%xs!=0) --xs;
}
if(test_dumb()<=xs+(n*m)/xs){
dumb();
return;
}
vector<pair<ll,ll> >gn;
{
ll step=1;
for(auto c:pf[n]){
gn.push_back({c,step});
step*=c;
}
}
{
ll step=1;
for(auto c:pf[m]){
gn.push_back({c,step});
step*=c;
}
}
for(auto c:gn){
if(xs%c.fi==0){
xs/=c.fi;
gl.push_back(c);
}
else gr.push_back(c);
}
}
sz=0;
gen(gl,0,0);
cout << sz << ' ';
for(int i=1; i<=sz ;i++) cout << v[i]+1 << ' ';
cout << '\n';
sz=0;
gen(gr,0,0);
cout << sz << ' ';
for(int i=1; i<=sz ;i++) cout << v[i]+1 << ' ';
cout << '\n';
}
signed main(){
ios::sync_with_stdio(false);cin.tie(0);
for(int i=2; i<=iu ;i++){
if(!pf[i].empty()) continue;
for(int j=i; j<=iu ;j+=i){
int z=j;
while(z%i==0){
z/=i;
pf[j].push_back(i);
}
}
}
int t;cin >> t;
while(t--) solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 211ms
memory: 128264kb
input:
3 2 8 1 9 2 9
output:
4 1 2 2 3 4 1 5 3 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: 239ms
memory: 128396kb
input:
1 40013 40013
output:
80026 1 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 ...
result:
ok Correct. (1 test case)
Test #3:
score: 0
Accepted
time: 242ms
memory: 129440kb
input:
1 40013 1
output:
2 1 1 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...
result:
ok Correct. (1 test case)
Test #4:
score: 0
Accepted
time: 246ms
memory: 128604kb
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: 229ms
memory: 129756kb
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: 250ms
memory: 129752kb
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: 364ms
memory: 128120kb
input:
1 999983 999983
output:
1999966 1 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 5...
result:
ok Correct. (1 test case)
Test #8:
score: 0
Accepted
time: 268ms
memory: 129000kb
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: 262ms
memory: 129344kb
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: 270ms
memory: 128252kb
input:
1 999983 3
output:
6 1 1 2 2 3 3 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...
result:
ok Correct. (1 test case)
Test #11:
score: 0
Accepted
time: 268ms
memory: 129432kb
input:
1 999983 4
output:
8 1 1 2 2 3 3 4 4 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 9...
result:
ok Correct. (1 test case)
Test #12:
score: 0
Accepted
time: 309ms
memory: 137040kb
input:
1 1000000 1000000
output:
1000000 1 200001 400001 600001 800001 40001 240001 440001 640001 840001 80001 280001 480001 680001 880001 120001 320001 520001 720001 920001 160001 360001 560001 760001 960001 8001 208001 408001 608001 808001 48001 248001 448001 648001 848001 88001 288001 488001 688001 888001 128001 328001 528001 72...
result:
ok Correct. (1 test case)
Test #13:
score: 0
Accepted
time: 225ms
memory: 129228kb
input:
1 1000000 1
output:
1000 1 1601 3201 4801 6401 321 1921 3521 5121 6721 641 2241 3841 5441 7041 961 2561 4161 5761 7361 1281 2881 4481 6081 7681 65 1665 3265 4865 6465 385 1985 3585 5185 6785 705 2305 3905 5505 7105 1025 2625 4225 5825 7425 1345 2945 4545 6145 7745 129 1729 3329 4929 6529 449 2049 3649 5249 6849 769 236...
result:
ok Correct. (1 test case)
Test #14:
score: 0
Accepted
time: 230ms
memory: 128376kb
input:
1 1000000 2
output:
1250 1 8001 16001 24001 32001 1601 9601 17601 25601 33601 3201 11201 19201 27201 35201 4801 12801 20801 28801 36801 6401 14401 22401 30401 38401 321 8321 16321 24321 32321 1921 9921 17921 25921 33921 3521 11521 19521 27521 35521 5121 13121 21121 29121 37121 6721 14721 22721 30721 38721 641 8641 1664...
result:
ok Correct. (1 test case)
Test #15:
score: 0
Accepted
time: 241ms
memory: 128504kb
input:
1 3 1000000
output:
1600 1 321 641 961 1281 65 385 705 1025 1345 129 449 769 1089 1409 193 513 833 1153 1473 257 577 897 1217 1537 33 353 673 993 1313 97 417 737 1057 1377 161 481 801 1121 1441 225 545 865 1185 1505 289 609 929 1249 1569 17 337 657 977 1297 81 401 721 1041 1361 145 465 785 1105 1425 209 529 849 1169 14...
result:
ok Correct. (1 test case)
Test #16:
score: 0
Accepted
time: 250ms
memory: 129848kb
input:
1 4 1000000
output:
2000 1 1601 3201 4801 6401 321 1921 3521 5121 6721 641 2241 3841 5441 7041 961 2561 4161 5761 7361 1281 2881 4481 6081 7681 65 1665 3265 4865 6465 385 1985 3585 5185 6785 705 2305 3905 5505 7105 1025 2625 4225 5825 7425 1345 2945 4545 6145 7745 129 1729 3329 4929 6529 449 2049 3649 5249 6849 769 236...
result:
ok Correct. (1 test case)
Test #17:
score: 0
Accepted
time: 321ms
memory: 137104kb
input:
1 988027 988027
output:
988027 1 992 1983 2974 3965 4956 5947 6938 7929 8920 9911 10902 11893 12884 13875 14866 15857 16848 17839 18830 19821 20812 21803 22794 23785 24776 25767 26758 27749 28740 29731 30722 31713 32704 33695 34686 35677 36668 37659 38650 39641 40632 41623 42614 43605 44596 45587 46578 47569 48560 49551 50...
result:
ok Correct. (1 test case)
Test #18:
score: 0
Accepted
time: 254ms
memory: 128228kb
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: 238ms
memory: 128340kb
input:
1 2 988027
output:
997 1 992 1983 2974 3965 4956 5947 6938 7929 8920 9911 10902 11893 12884 13875 14866 15857 16848 17839 18830 19821 20812 21803 22794 23785 24776 25767 26758 27749 28740 29731 30722 31713 32704 33695 34686 35677 36668 37659 38650 39641 40632 41623 42614 43605 44596 45587 46578 47569 48560 49551 50542...
result:
ok Correct. (1 test case)
Test #20:
score: 0
Accepted
time: 242ms
memory: 129704kb
input:
1 3 988027
output:
997 1 992 1983 2974 3965 4956 5947 6938 7929 8920 9911 10902 11893 12884 13875 14866 15857 16848 17839 18830 19821 20812 21803 22794 23785 24776 25767 26758 27749 28740 29731 30722 31713 32704 33695 34686 35677 36668 37659 38650 39641 40632 41623 42614 43605 44596 45587 46578 47569 48560 49551 50542...
result:
ok Correct. (1 test case)
Test #21:
score: 0
Accepted
time: 237ms
memory: 129724kb
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: 330ms
memory: 139124kb
input:
1 995779 995779
output:
995779 1 984 1967 2950 3933 4916 5899 6882 7865 8848 9831 10814 11797 12780 13763 14746 15729 16712 17695 18678 19661 20644 21627 22610 23593 24576 25559 26542 27525 28508 29491 30474 31457 32440 33423 34406 35389 36372 37355 38338 39321 40304 41287 42270 43253 44236 45219 46202 47185 48168 49151 50...
result:
ok Correct. (1 test case)
Test #23:
score: 0
Accepted
time: 234ms
memory: 128340kb
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: 252ms
memory: 128676kb
input:
1 995779 2
output:
1013 1 984 1967 2950 3933 4916 5899 6882 7865 8848 9831 10814 11797 12780 13763 14746 15729 16712 17695 18678 19661 20644 21627 22610 23593 24576 25559 26542 27525 28508 29491 30474 31457 32440 33423 34406 35389 36372 37355 38338 39321 40304 41287 42270 43253 44236 45219 46202 47185 48168 49151 5013...
result:
ok Correct. (1 test case)
Test #25:
score: 0
Accepted
time: 251ms
memory: 128876kb
input:
1 995779 3
output:
1013 1 984 1967 2950 3933 4916 5899 6882 7865 8848 9831 10814 11797 12780 13763 14746 15729 16712 17695 18678 19661 20644 21627 22610 23593 24576 25559 26542 27525 28508 29491 30474 31457 32440 33423 34406 35389 36372 37355 38338 39321 40304 41287 42270 43253 44236 45219 46202 47185 48168 49151 5013...
result:
ok Correct. (1 test case)
Test #26:
score: 0
Accepted
time: 254ms
memory: 129120kb
input:
1 995779 4
output:
1966 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 #27:
score: 0
Accepted
time: 289ms
memory: 135072kb
input:
1 720720 720720
output:
720720 1 55441 110881 166321 221761 277201 332641 388081 443521 498961 554401 609841 665281 5041 60481 115921 171361 226801 282241 337681 393121 448561 504001 559441 614881 670321 10081 65521 120961 176401 231841 287281 342721 398161 453601 509041 564481 619921 675361 15121 70561 126001 181441 23688...
result:
ok Correct. (1 test case)
Test #28:
score: 0
Accepted
time: 234ms
memory: 129972kb
input:
1 720720 1
output:
840 1 721 1441 2161 2881 3601 4321 145 865 1585 2305 3025 3745 4465 289 1009 1729 2449 3169 3889 4609 433 1153 1873 2593 3313 4033 4753 577 1297 2017 2737 3457 4177 4897 17 737 1457 2177 2897 3617 4337 161 881 1601 2321 3041 3761 4481 305 1025 1745 2465 3185 3905 4625 449 1169 1889 2609 3329 4049 47...
result:
ok Correct. (1 test case)
Test #29:
score: 0
Accepted
time: 244ms
memory: 128508kb
input:
1 2 720720
output:
1170 1 55441 110881 166321 221761 277201 332641 388081 443521 498961 554401 609841 665281 145 55585 111025 166465 221905 277345 332785 388225 443665 499105 554545 609985 665425 289 55729 111169 166609 222049 277489 332929 388369 443809 499249 554689 610129 665569 433 55873 111313 166753 222193 27763...
result:
ok Correct. (1 test case)
Test #30:
score: 0
Accepted
time: 227ms
memory: 128032kb
input:
1 3 720720
output:
1456 1 55441 110881 166321 221761 277201 332641 388081 443521 498961 554401 609841 665281 721 56161 111601 167041 222481 277921 333361 388801 444241 499681 555121 610561 666001 1441 56881 112321 167761 223201 278641 334081 389521 444961 500401 555841 611281 666721 2161 57601 113041 168481 223921 279...
result:
ok Correct. (1 test case)
Test #31:
score: 0
Accepted
time: 239ms
memory: 128568kb
input:
1 4 720720
output:
1680 1 721 1441 2161 2881 3601 4321 145 865 1585 2305 3025 3745 4465 289 1009 1729 2449 3169 3889 4609 433 1153 1873 2593 3313 4033 4753 577 1297 2017 2737 3457 4177 4897 17 737 1457 2177 2897 3617 4337 161 881 1601 2321 3041 3761 4481 305 1025 1745 2465 3185 3905 4625 449 1169 1889 2609 3329 4049 4...
result:
ok Correct. (1 test case)
Test #32:
score: 0
Accepted
time: 286ms
memory: 132976kb
input:
1 524288 524288
output:
524288 1 262145 131073 393217 65537 327681 196609 458753 32769 294913 163841 425985 98305 360449 229377 491521 16385 278529 147457 409601 81921 344065 212993 475137 49153 311297 180225 442369 114689 376833 245761 507905 8193 270337 139265 401409 73729 335873 204801 466945 40961 303105 172033 434177 ...
result:
ok Correct. (1 test case)
Test #33:
score: 0
Accepted
time: 244ms
memory: 129408kb
input:
1 1 524288
output:
512 1 257 129 385 65 321 193 449 33 289 161 417 97 353 225 481 17 273 145 401 81 337 209 465 49 305 177 433 113 369 241 497 9 265 137 393 73 329 201 457 41 297 169 425 105 361 233 489 25 281 153 409 89 345 217 473 57 313 185 441 121 377 249 505 5 261 133 389 69 325 197 453 37 293 165 421 101 357 229...
result:
ok Correct. (1 test case)
Test #34:
score: 0
Accepted
time: 245ms
memory: 129968kb
input:
1 2 524288
output:
1024 1 257 129 385 65 321 193 449 33 289 161 417 97 353 225 481 17 273 145 401 81 337 209 465 49 305 177 433 113 369 241 497 9 265 137 393 73 329 201 457 41 297 169 425 105 361 233 489 25 281 153 409 89 345 217 473 57 313 185 441 121 377 249 505 5 261 133 389 69 325 197 453 37 293 165 421 101 357 22...
result:
ok Correct. (1 test case)
Test #35:
score: 0
Accepted
time: 243ms
memory: 128780kb
input:
1 3 524288
output:
1024 1 513 257 769 129 641 385 897 65 577 321 833 193 705 449 961 33 545 289 801 161 673 417 929 97 609 353 865 225 737 481 993 17 529 273 785 145 657 401 913 81 593 337 849 209 721 465 977 49 561 305 817 177 689 433 945 113 625 369 881 241 753 497 1009 9 521 265 777 137 649 393 905 73 585 329 841 2...
result:
ok Correct. (1 test case)
Test #36:
score: 0
Accepted
time: 228ms
memory: 129972kb
input:
1 524288 4
output:
1024 1 129 65 193 33 161 97 225 17 145 81 209 49 177 113 241 9 137 73 201 41 169 105 233 25 153 89 217 57 185 121 249 5 133 69 197 37 165 101 229 21 149 85 213 53 181 117 245 13 141 77 205 45 173 109 237 29 157 93 221 61 189 125 253 3 131 67 195 35 163 99 227 19 147 83 211 51 179 115 243 11 139 75 2...
result:
ok Correct. (1 test case)
Test #37:
score: 0
Accepted
time: 295ms
memory: 133028kb
input:
1 531441 531441
output:
531441 1 177148 354295 59050 236197 413344 118099 295246 472393 19684 196831 373978 78733 255880 433027 137782 314929 492076 39367 216514 393661 98416 275563 452710 157465 334612 511759 6562 183709 360856 65611 242758 419905 124660 301807 478954 26245 203392 380539 85294 262441 439588 144343 321490 ...
result:
ok Correct. (1 test case)
Test #38:
score: 0
Accepted
time: 248ms
memory: 129096kb
input:
1 1 531441
output:
729 1 244 487 82 325 568 163 406 649 28 271 514 109 352 595 190 433 676 55 298 541 136 379 622 217 460 703 10 253 496 91 334 577 172 415 658 37 280 523 118 361 604 199 442 685 64 307 550 145 388 631 226 469 712 19 262 505 100 343 586 181 424 667 46 289 532 127 370 613 208 451 694 73 316 559 154 397 ...
result:
ok Correct. (1 test case)
Test #39:
score: 0
Accepted
time: 228ms
memory: 129044kb
input:
1 2 531441
output:
729 1 244 487 82 325 568 163 406 649 28 271 514 109 352 595 190 433 676 55 298 541 136 379 622 217 460 703 10 253 496 91 334 577 172 415 658 37 280 523 118 361 604 199 442 685 64 307 550 145 388 631 226 469 712 19 262 505 100 343 586 181 424 667 46 289 532 127 370 613 208 451 694 73 316 559 154 397 ...
result:
ok Correct. (1 test case)
Test #40:
score: 0
Accepted
time: 230ms
memory: 129480kb
input:
1 531441 3
output:
729 1 82 163 28 109 190 55 136 217 10 91 172 37 118 199 64 145 226 19 100 181 46 127 208 73 154 235 4 85 166 31 112 193 58 139 220 13 94 175 40 121 202 67 148 229 22 103 184 49 130 211 76 157 238 7 88 169 34 115 196 61 142 223 16 97 178 43 124 205 70 151 232 25 106 187 52 133 214 79 160 241 2 83 164...
result:
ok Correct. (1 test case)
Test #41:
score: 0
Accepted
time: 244ms
memory: 128000kb
input:
1 531441 4
output:
1458 1 244 487 82 325 568 163 406 649 28 271 514 109 352 595 190 433 676 55 298 541 136 379 622 217 460 703 10 253 496 91 334 577 172 415 658 37 280 523 118 361 604 199 442 685 64 307 550 145 388 631 226 469 712 19 262 505 100 343 586 181 424 667 46 289 532 127 370 613 208 451 694 73 316 559 154 397...
result:
ok Correct. (1 test case)
Test #42:
score: 0
Accepted
time: 287ms
memory: 135016kb
input:
1 510510 510510
output:
510510 1 30031 60061 90091 120121 150151 180181 210211 240241 270271 300301 330331 360361 390391 420421 450451 480481 2311 32341 62371 92401 122431 152461 182491 212521 242551 272581 302611 332641 362671 392701 422731 452761 482791 4621 34651 64681 94711 124741 154771 184801 214831 244861 274891 304...
result:
ok Correct. (1 test case)
Test #43:
score: 0
Accepted
time: 236ms
memory: 128584kb
input:
1 510510 1
output:
714 1 30031 60061 90091 120121 150151 180181 210211 240241 270271 300301 330331 360361 390391 420421 450451 480481 31 30061 60091 90121 120151 150181 180211 210241 240271 270301 300331 330361 360391 390421 420451 450481 480511 61 30091 60121 90151 120181 150211 180241 210271 240301 270331 300361 330...
result:
ok Correct. (1 test case)
Test #44:
score: 0
Accepted
time: 236ms
memory: 128852kb
input:
1 510510 2
output:
1001 1 2311 4621 6931 9241 11551 13861 16171 18481 20791 23101 25411 27721 211 2521 4831 7141 9451 11761 14071 16381 18691 21001 23311 25621 27931 421 2731 5041 7351 9661 11971 14281 16591 18901 21211 23521 25831 28141 631 2941 5251 7561 9871 12181 14491 16801 19111 21421 23731 26041 28351 841 3151 ...
result:
ok Correct. (1 test case)
Test #45:
score: 0
Accepted
time: 253ms
memory: 128492kb
input:
1 3 510510
output:
1190 1 30031 60061 90091 120121 150151 180181 210211 240241 270271 300301 330331 360361 390391 420421 450451 480481 31 30061 60091 90121 120151 150181 180211 210241 240271 270301 300331 330361 360391 390421 420451 450481 480511 61 30091 60121 90151 120181 150211 180241 210271 240301 270331 300361 33...
result:
ok Correct. (1 test case)
Test #46:
score: 0
Accepted
time: 247ms
memory: 129444kb
input:
1 4 510510
output:
1428 1 30031 60061 90091 120121 150151 180181 210211 240241 270271 300301 330331 360361 390391 420421 450451 480481 31 30061 60091 90121 120151 150181 180211 210241 240271 270301 300331 330361 360391 390421 420451 450481 480511 61 30091 60121 90151 120181 150211 180241 210271 240301 270331 300361 33...
result:
ok Correct. (1 test case)
Test #47:
score: 0
Accepted
time: 288ms
memory: 132980kb
input:
1 279936 279936
output:
279936 1 93313 186625 31105 124417 217729 62209 155521 248833 10369 103681 196993 41473 134785 228097 72577 165889 259201 20737 114049 207361 51841 145153 238465 82945 176257 269569 3457 96769 190081 34561 127873 221185 65665 158977 252289 13825 107137 200449 44929 138241 231553 76033 169345 262657 ...
result:
ok Correct. (1 test case)
Test #48:
score: 0
Accepted
time: 256ms
memory: 130012kb
input:
1 279936 1
output:
486 1 10369 20737 3457 13825 24193 6913 17281 27649 1153 11521 21889 4609 14977 25345 8065 18433 28801 2305 12673 23041 5761 16129 26497 9217 19585 29953 385 10753 21121 3841 14209 24577 7297 17665 28033 1537 11905 22273 4993 15361 25729 8449 18817 29185 2689 13057 23425 6145 16513 26881 9601 19969 ...
result:
ok Correct. (1 test case)
Test #49:
score: 0
Accepted
time: 227ms
memory: 128856kb
input:
1 279936 2
output:
729 1 31105 62209 10369 41473 72577 20737 51841 82945 3457 34561 65665 13825 44929 76033 24193 55297 86401 6913 38017 69121 17281 48385 79489 27649 58753 89857 1153 32257 63361 11521 42625 73729 21889 52993 84097 4609 35713 66817 14977 46081 77185 25345 56449 87553 8065 39169 70273 18433 49537 80641...
result:
ok Correct. (1 test case)
Test #50:
score: 0
Accepted
time: 268ms
memory: 130064kb
input:
1 279936 3
output:
864 1 385 769 129 513 897 257 641 1025 17 401 785 145 529 913 273 657 1041 9 393 777 137 521 905 265 649 1033 25 409 793 153 537 921 281 665 1049 5 389 773 133 517 901 261 645 1029 21 405 789 149 533 917 277 661 1045 13 397 781 141 525 909 269 653 1037 29 413 797 157 541 925 285 669 1053 3 387 771 1...
result:
ok Correct. (1 test case)
Test #51:
score: 0
Accepted
time: 240ms
memory: 129664kb
input:
1 4 279936
output:
972 1 10369 20737 3457 13825 24193 6913 17281 27649 1153 11521 21889 4609 14977 25345 8065 18433 28801 2305 12673 23041 5761 16129 26497 9217 19585 29953 385 10753 21121 3841 14209 24577 7297 17665 28033 1537 11905 22273 4993 15361 25729 8449 18817 29185 2689 13057 23425 6145 16513 26881 9601 19969 ...
result:
ok Correct. (1 test case)
Test #52:
score: 0
Accepted
time: 310ms
memory: 137056kb
input:
1 871933 871933
output:
871933 1 8634 17267 25900 34533 43166 51799 60432 69065 77698 86331 94964 103597 112230 120863 129496 138129 146762 155395 164028 172661 181294 189927 198560 207193 215826 224459 233092 241725 250358 258991 267624 276257 284890 293523 302156 310789 319422 328055 336688 345321 353954 362587 371220 37...
result:
ok Correct. (1 test case)
Test #53:
score: 0
Accepted
time: 237ms
memory: 129664kb
input:
1 871933 1
output:
101 1 8634 17267 25900 34533 43166 51799 60432 69065 77698 86331 94964 103597 112230 120863 129496 138129 146762 155395 164028 172661 181294 189927 198560 207193 215826 224459 233092 241725 250358 258991 267624 276257 284890 293523 302156 310789 319422 328055 336688 345321 353954 362587 371220 37985...
result:
ok Correct. (1 test case)
Test #54:
score: 0
Accepted
time: 249ms
memory: 128648kb
input:
1 2 871933
output:
202 1 8634 17267 25900 34533 43166 51799 60432 69065 77698 86331 94964 103597 112230 120863 129496 138129 146762 155395 164028 172661 181294 189927 198560 207193 215826 224459 233092 241725 250358 258991 267624 276257 284890 293523 302156 310789 319422 328055 336688 345321 353954 362587 371220 37985...
result:
ok Correct. (1 test case)
Test #55:
score: 0
Accepted
time: 250ms
memory: 129284kb
input:
1 3 871933
output:
303 1 8634 17267 25900 34533 43166 51799 60432 69065 77698 86331 94964 103597 112230 120863 129496 138129 146762 155395 164028 172661 181294 189927 198560 207193 215826 224459 233092 241725 250358 258991 267624 276257 284890 293523 302156 310789 319422 328055 336688 345321 353954 362587 371220 37985...
result:
ok Correct. (1 test case)
Test #56:
score: 0
Accepted
time: 233ms
memory: 129556kb
input:
1 4 871933
output:
404 1 8634 17267 25900 34533 43166 51799 60432 69065 77698 86331 94964 103597 112230 120863 129496 138129 146762 155395 164028 172661 181294 189927 198560 207193 215826 224459 233092 241725 250358 258991 267624 276257 284890 293523 302156 310789 319422 328055 336688 345321 353954 362587 371220 37985...
result:
ok Correct. (1 test case)
Test #57:
score: -100
Wrong Answer
time: 337ms
memory: 137112kb
input:
1 1000000 999999
output:
999000 1 1601 3201 4801 6401 321 1921 3521 5121 6721 641 2241 3841 5441 7041 961 2561 4161 5761 7361 1281 2881 4481 6081 7681 65 1665 3265 4865 6465 385 1985 3585 5185 6785 705 2305 3905 5505 7105 1025 2625 4225 5825 7425 1345 2945 4545 6145 7745 129 1729 3329 4929 6529 449 2049 3649 5249 6849 769 2...
result:
wrong answer Jury has a better answer. (test case 1)