QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#915960 | #5575. Knight's Tour Redux | tsai | AC ✓ | 9ms | 3840kb | C++14 | 7.6kb | 2025-02-26 17:41:10 | 2025-02-26 17:41:11 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+5;
ll a[33];
void solve(){
int n;
scanf("%d",&n);
if(n==1){
printf("POSSIBLE\n1 1");
return ;
}else if(n==12){
printf("POSSIBLE\n5 3\n2 4\n1 1\n4 2\n3 5\n");
printf("6 6\n9 7\n12 8\n11 11\n8 12\n7 9\n10 10\n");
return ;
}else if(n>11&&(n-11)%9==0&&(n-11)%18!=0){
printf("POSSIBLE\n5 3\n2 4\n1 1\n4 2\n3 5\n");
int x=6,y=6;
int jd=0,jd1=0;
int cnt=0,k=0;
for(int i=1;i<=n-11;i++){
printf("%d %d\n",x,y);
k++;
cnt++;
if(k%9==0){
k=0;
x++;y+=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
if(cnt%3==0){
if(jd1==0){
x+=3;y++;
}else if(jd1==1){
x+=3;y--;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x++;y+=3;
}else if(jd==1){
x--;y-=3;
}
}
printf("%d %d\n",n-3,n-5);
printf("%d %d\n",n,n-4);
printf("%d %d\n",n-1,n-1);
printf("%d %d\n",n-4,n);
printf("%d %d\n",n-5,n-3);
printf("%d %d\n",n-2,n-2);
return ;
}
if(n%9==0){
printf("POSSIBLE\n");
int x=n,y=n;
int k=0;
int jd=0;
int jd1=0;
int cnt=0;
for(int i=1;i<=n;i++){
printf("%d %d\n",x,y);
k++;
if(k%9==0){
k=0;
x--;
y-=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
cnt++;
if(cnt%3==0){
if(jd1==0){
x-=3;
y--;
}else if(jd1==1){
x-=3;
y++;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x--;
y-=3;
}else if(jd==1){
y+=3;
x++;
}
}
}else if(n%9==1){
printf("POSSIBLE\n");
int x=2,y=4;
int jd=0,jd1=0;
int cnt=0,k=0;
printf("1 1\n");
for(int i=2;i<=n;i++){
printf("%d %d\n",x,y);
k++;
cnt++;
if(k%9==0){
k=0;
x++;y+=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
if(cnt%3==0){
if(jd1==0){
x+=3;y--;
}else if(jd1==1){
x+=3;y++;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x++;y+=3;
}else if(jd==1){
x--;y-=3;
}
}
}else if(n>9&&n%9==2&&(n-2)%18!=0){
printf("POSSIBLE\n");
int x=2,y=4;
int jd=0,jd1=0;
int cnt=0,k=0;
printf("1 1\n");
for(int i=2;i<=n-1;i++){
printf("%d %d\n",x,y);
k++;
cnt++;
if(k%9==0){
k=0;
x++;y+=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
if(cnt%3==0){
if(jd1==0){
x+=3;y--;
}else if(jd1==1){
x+=3;y++;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x++;y+=3;
}else if(jd==1){
x--;y-=3;
}
}
printf("%d %d\n",n,n);
}else if(n%18==12&&n>18){
printf("POSSIBLE\n5 3\n2 4\n1 1\n4 2\n3 5\n");
int x=6,y=6;
int jd=0,jd1=1;
int cnt=0,k=0;
for(int i=1;i<=n-12;i++){
printf("%d %d\n",x,y);
k++;
cnt++;
if(k%9==0){
k=0;
x++;y+=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
if(cnt%3==0){
if(jd1==0){
x+=3;y--;
}else if(jd1==1){
x+=3;y++;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x++;y+=3;
}else if(jd==1){
x--;y-=3;
}
}
printf("%d %d\n",n-6,n-6);
printf("%d %d\n",n-3,n-5);
printf("%d %d\n",n,n-4);
printf("%d %d\n",n-1,n-1);
printf("%d %d\n",n-4,n);
printf("%d %d\n",n-5,n-3);
printf("%d %d\n",n-2,n-2);
}else if(n%9==8){
printf("POSSIBLE\n");
int x=n,y=n-2;
int jd=0,jd1=0;
int cnt=1,k=1;
for(int i=1;i<=n;i++){
printf("%d %d\n",x,y);
k++;
if(k%9==0){
k=0;
x--;
y-=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
cnt++;
if(cnt%3==0){
if(jd1==0){
x-=3;
y--;
}else if(jd1==1){
x-=3;
y++;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x--;
y-=3;
}else if(jd==1){
y+=3;
x++;
}
}
// printf("%d %d\n",n,n);
}else if(n%9==7){
printf("POSSIBLE\n");
printf("%d %d\n",n-2,n-2);
printf("%d %d\n",n-5,n-3);
printf("%d %d\n",n-4,n);
printf("%d %d\n",n-1,n-1);
printf("%d %d\n",n,n-4);
printf("%d %d\n",n-3,n-5);
printf("%d %d\n",n-6,n-6);
int x=n-7,y=n-9;
int k=0;
int jd=0;
int jd1=1;
int cnt=0;
for(int i=1;i<=n-7;i++){
printf("%d %d\n",x,y);
k++;
if(k%9==0){
k=0;
x--;
y-=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
cnt++;
if(cnt%3==0){
if(jd1==0){
x-=3;
y--;
}else if(jd1==1){
x-=3;
y++;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x--;
y-=3;
}else if(jd==1){
y+=3;
x++;
}
}
}else if(n%9==5||(n%9==4&&n>9&&(n-4)%18!=0)){
printf("POSSIBLE\n5 3\n2 4\n1 1\n4 2\n3 5\n");
int x=6,y=6;
int jd=0,jd1=0;
int cnt=0,k=0;
for(int i=1;i<=n-5;i++){
printf("%d %d\n",x,y);
k++;
cnt++;
if(k%9==0){
k=0;
x++;y+=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
if(cnt%3==0){
if(jd1==0){
x+=3;y++;
}else if(jd1==1){
x+=3;y--;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x++;y+=3;
}else if(jd==1){
x--;y-=3;
}
}
}else if((n%9==4&&n>18&&(n-4)%18==0)){
printf("POSSIBLE\n5 3\n2 4\n1 1\n4 2\n3 5\n6 6\n");
int x=7,y=9;
int jd=0,jd1=1;
int cnt=0,k=0;
for(int i=1;i<=n-13;i++){
printf("%d %d\n",x,y);
k++;
cnt++;
if(k%9==0){
k=0;
x++;y+=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
if(cnt%3==0){
if(jd1==0){
x+=3;y++;
}else if(jd1==1){
x+=3;y--;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x++;y+=3;
}else if(jd==1){
x--;y-=3;
}
}
printf("%d %d\n",n-6,n-6);
printf("%d %d\n",n-3,n-5);
printf("%d %d\n",n-2,n-2);
printf("%d %d\n",n-5,n-1);
printf("%d %d\n",n-4,n-4);
printf("%d %d\n",n-1,n-3);
printf("%d %d\n",n,n);
}else if(n%18==3&&n>18){
printf("POSSIBLE\n5 3\n2 4\n1 1\n4 2\n3 5\n6 6\n");
int x=7,y=9;
int jd=0,jd1=1;
int cnt=0,k=0;
for(int i=1;i<=n-12;i++){
printf("%d %d\n",x,y);
k++;
cnt++;
if(k%9==0){
k=0;
x++;y+=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
if(cnt%3==0){
if(jd1==0){
x+=3;y++;
}else if(jd1==1){
x+=3;y--;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x++;y+=3;
}else if(jd==1){
x--;y-=3;
}
}
printf("%d %d\n",n-5,n-5);
printf("%d %d\n",n-2,n-4);
printf("%d %d\n",n-3,n-1);
printf("%d %d\n",n,n);
printf("%d %d\n",n-1,n-3);
printf("%d %d\n",n-4,n-2);
}else if(n%9==6){
printf("POSSIBLE\n");
printf("%d %d\n",n-2,n-2);
printf("%d %d\n",n-5,n-3);
printf("%d %d\n",n-4,n);
printf("%d %d\n",n-1,n-1);
printf("%d %d\n",n,n-4);
printf("%d %d\n",n-3,n-5);
int x=n-6,y=n-6;
int k=0;
int jd=0;
int jd1=0;
int cnt=0;
for(int i=1;i<=n-6;i++){
printf("%d %d\n",x,y);
k++;
if(k%9==0){
k=0;
x--;
y-=3;
jd1++;
jd1%=2;
jd=0;
cnt=0;
continue;
}
cnt++;
if(cnt%3==0){
if(jd1==0){
x-=3;
y--;
}else if(jd1==1){
x-=3;
y++;
}
jd++;
jd%=2;
cnt=0;
continue;
}
if(jd==0){
x--;
y-=3;
}else if(jd==1){
y+=3;
x++;
}
}
}else{
printf("IMPOSSIBLE");
}
return ;
}
int main(){
int t=1;
while(t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3840kb
input:
1
output:
POSSIBLE 1 1
result:
ok answer = 1
Test #2:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
2
output:
IMPOSSIBLE
result:
ok answer = 0
Test #3:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
3
output:
IMPOSSIBLE
result:
ok answer = 0
Test #4:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
4
output:
IMPOSSIBLE
result:
ok answer = 0
Test #5:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
5
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5
result:
ok answer = 1
Test #6:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
6
output:
POSSIBLE 4 4 1 3 2 6 5 5 6 2 3 1
result:
ok answer = 1
Test #7:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
7
output:
POSSIBLE 5 5 2 4 3 7 6 6 7 3 4 2 1 1
result:
ok answer = 1
Test #8:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
8
output:
POSSIBLE 8 6 7 3 4 2 5 5 6 8 3 7 2 4 1 1
result:
ok answer = 1
Test #9:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
9
output:
POSSIBLE 9 9 8 6 7 3 4 2 5 5 6 8 3 7 2 4 1 1
result:
ok answer = 1
Test #10:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
10
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8
result:
ok answer = 1
Test #11:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
11
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11
result:
ok answer = 1
Test #12:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
12
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 9 7 12 8 11 11 8 12 7 9 10 10
result:
ok answer = 1
Test #13:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
13
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11
result:
ok answer = 1
Test #14:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
14
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14
result:
ok answer = 1
Test #15:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
15
output:
POSSIBLE 13 13 10 12 11 15 14 14 15 11 12 10 9 9 8 6 7 3 4 2 5 5 6 8 3 7 2 4 1 1
result:
ok answer = 1
Test #16:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
16
output:
POSSIBLE 14 14 11 13 12 16 15 15 16 12 13 11 10 10 9 7 8 4 7 1 4 2 5 5 6 8 3 9 2 6 1 3
result:
ok answer = 1
Test #17:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
17
output:
POSSIBLE 17 15 16 12 13 11 14 14 15 17 12 16 11 13 10 10 9 7 8 4 7 1 4 2 5 5 6 8 3 9 2 6 1 3
result:
ok answer = 1
Test #18:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
18
output:
POSSIBLE 18 18 17 15 16 12 13 11 14 14 15 17 12 16 11 13 10 10 9 7 8 4 7 1 4 2 5 5 6 8 3 9 2 6 1 3
result:
ok answer = 1
Test #19:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
19
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19
result:
ok answer = 1
Test #20:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
20
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 17 15 20 16 19 19 16 20 15 17 18 18
result:
ok answer = 1
Test #21:
score: 0
Accepted
time: 7ms
memory: 3840kb
input:
99990
output:
POSSIBLE 99990 99990 99989 99987 99988 99984 99985 99983 99986 99986 99987 99989 99984 99988 99983 99985 99982 99982 99981 99979 99980 99976 99979 99973 99976 99974 99977 99977 99978 99980 99975 99981 99974 99978 99973 99975 99972 99972 99971 99969 99970 99966 99967 99965 99968 99968 99969 99971 999...
result:
ok answer = 1
Test #22:
score: 0
Accepted
time: 9ms
memory: 3840kb
input:
99991
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #23:
score: 0
Accepted
time: 8ms
memory: 3840kb
input:
99992
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #24:
score: 0
Accepted
time: 9ms
memory: 3840kb
input:
99993
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #25:
score: 0
Accepted
time: 6ms
memory: 3840kb
input:
99994
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #26:
score: 0
Accepted
time: 7ms
memory: 3712kb
input:
99995
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #27:
score: 0
Accepted
time: 7ms
memory: 3840kb
input:
99996
output:
POSSIBLE 99994 99994 99991 99993 99992 99996 99995 99995 99996 99992 99993 99991 99990 99990 99989 99987 99988 99984 99985 99983 99986 99986 99987 99989 99984 99988 99983 99985 99982 99982 99981 99979 99980 99976 99979 99973 99976 99974 99977 99977 99978 99980 99975 99981 99974 99978 99973 99975 999...
result:
ok answer = 1
Test #28:
score: 0
Accepted
time: 7ms
memory: 3840kb
input:
99997
output:
POSSIBLE 99995 99995 99992 99994 99993 99997 99996 99996 99997 99993 99994 99992 99991 99991 99990 99988 99989 99985 99988 99982 99985 99983 99986 99986 99987 99989 99984 99990 99983 99987 99982 99984 99981 99981 99980 99978 99979 99975 99976 99974 99977 99977 99978 99980 99975 99979 99974 99976 999...
result:
ok answer = 1
Test #29:
score: 0
Accepted
time: 5ms
memory: 3840kb
input:
99998
output:
POSSIBLE 99998 99996 99997 99993 99994 99992 99995 99995 99996 99998 99993 99997 99992 99994 99991 99991 99990 99988 99989 99985 99988 99982 99985 99983 99986 99986 99987 99989 99984 99990 99983 99987 99982 99984 99981 99981 99980 99978 99979 99975 99976 99974 99977 99977 99978 99980 99975 99979 999...
result:
ok answer = 1
Test #30:
score: 0
Accepted
time: 7ms
memory: 3840kb
input:
99999
output:
POSSIBLE 99999 99999 99998 99996 99997 99993 99994 99992 99995 99995 99996 99998 99993 99997 99992 99994 99991 99991 99990 99988 99989 99985 99988 99982 99985 99983 99986 99986 99987 99989 99984 99990 99983 99987 99982 99984 99981 99981 99980 99978 99979 99975 99976 99974 99977 99977 99978 99980 999...
result:
ok answer = 1
Test #31:
score: 0
Accepted
time: 9ms
memory: 3840kb
input:
100000
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #32:
score: 0
Accepted
time: 6ms
memory: 3840kb
input:
74615
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #33:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
25027
output:
POSSIBLE 25025 25025 25022 25024 25023 25027 25026 25026 25027 25023 25024 25022 25021 25021 25020 25018 25019 25015 25018 25012 25015 25013 25016 25016 25017 25019 25014 25020 25013 25017 25012 25014 25011 25011 25010 25008 25009 25005 25006 25004 25007 25007 25008 25010 25005 25009 25004 25006 250...
result:
ok answer = 1
Test #34:
score: 0
Accepted
time: 3ms
memory: 3840kb
input:
40852
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #35:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
31411
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #36:
score: 0
Accepted
time: 4ms
memory: 3840kb
input:
37332
output:
POSSIBLE 37332 37332 37331 37329 37330 37326 37327 37325 37328 37328 37329 37331 37326 37330 37325 37327 37324 37324 37323 37321 37322 37318 37321 37315 37318 37316 37319 37319 37320 37322 37317 37323 37316 37320 37315 37317 37314 37314 37313 37311 37312 37308 37309 37307 37310 37310 37311 37313 373...
result:
ok answer = 1
Test #37:
score: 0
Accepted
time: 6ms
memory: 3840kb
input:
80435
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #38:
score: 0
Accepted
time: 8ms
memory: 3840kb
input:
90457
output:
POSSIBLE 90455 90455 90452 90454 90453 90457 90456 90456 90457 90453 90454 90452 90451 90451 90450 90448 90449 90445 90448 90442 90445 90443 90446 90446 90447 90449 90444 90450 90443 90447 90442 90444 90441 90441 90440 90438 90439 90435 90436 90434 90437 90437 90438 90440 90435 90439 90434 90436 904...
result:
ok answer = 1
Test #39:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
1796
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #40:
score: 0
Accepted
time: 5ms
memory: 3840kb
input:
55809
output:
POSSIBLE 55809 55809 55808 55806 55807 55803 55804 55802 55805 55805 55806 55808 55803 55807 55802 55804 55801 55801 55800 55798 55799 55795 55798 55792 55795 55793 55796 55796 55797 55799 55794 55800 55793 55797 55792 55794 55791 55791 55790 55788 55789 55785 55786 55784 55787 55787 55788 55790 557...
result:
ok answer = 1
Test #41:
score: 0
Accepted
time: 7ms
memory: 3840kb
input:
97013
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #42:
score: 0
Accepted
time: 5ms
memory: 3840kb
input:
77938
output:
POSSIBLE 77936 77936 77933 77935 77934 77938 77937 77937 77938 77934 77935 77933 77932 77932 77931 77929 77930 77926 77929 77923 77926 77924 77927 77927 77928 77930 77925 77931 77924 77928 77923 77925 77922 77922 77921 77919 77920 77916 77917 77915 77918 77918 77919 77921 77916 77920 77915 77917 779...
result:
ok answer = 1
Test #43:
score: 0
Accepted
time: 6ms
memory: 3840kb
input:
87884
output:
POSSIBLE 87884 87882 87883 87879 87880 87878 87881 87881 87882 87884 87879 87883 87878 87880 87877 87877 87876 87874 87875 87871 87874 87868 87871 87869 87872 87872 87873 87875 87870 87876 87869 87873 87868 87870 87867 87867 87866 87864 87865 87861 87862 87860 87863 87863 87864 87866 87861 87865 878...
result:
ok answer = 1
Test #44:
score: 0
Accepted
time: 4ms
memory: 3840kb
input:
61687
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #45:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
32567
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #46:
score: 0
Accepted
time: 3ms
memory: 3840kb
input:
53441
output:
POSSIBLE 53441 53439 53440 53436 53437 53435 53438 53438 53439 53441 53436 53440 53435 53437 53434 53434 53433 53431 53432 53428 53431 53425 53428 53426 53429 53429 53430 53432 53427 53433 53426 53430 53425 53427 53424 53424 53423 53421 53422 53418 53419 53417 53420 53420 53421 53423 53418 53422 534...
result:
ok answer = 1
Test #47:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
19197
output:
POSSIBLE 19197 19197 19196 19194 19195 19191 19192 19190 19193 19193 19194 19196 19191 19195 19190 19192 19189 19189 19188 19186 19187 19183 19186 19180 19183 19181 19184 19184 19185 19187 19182 19188 19181 19185 19180 19182 19179 19179 19178 19176 19177 19173 19174 19172 19175 19175 19176 19178 191...
result:
ok answer = 1
Test #48:
score: 0
Accepted
time: 7ms
memory: 3840kb
input:
77260
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #49:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
6699
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #50:
score: 0
Accepted
time: 5ms
memory: 3840kb
input:
72561
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #51:
score: 0
Accepted
time: 3ms
memory: 3712kb
input:
60412
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #52:
score: 0
Accepted
time: 5ms
memory: 3840kb
input:
78243
output:
POSSIBLE 78241 78241 78238 78240 78239 78243 78242 78242 78243 78239 78240 78238 78237 78237 78236 78234 78235 78231 78232 78230 78233 78233 78234 78236 78231 78235 78230 78232 78229 78229 78228 78226 78227 78223 78226 78220 78223 78221 78224 78224 78225 78227 78222 78228 78221 78225 78220 78222 782...
result:
ok answer = 1
Test #53:
score: 0
Accepted
time: 6ms
memory: 3840kb
input:
93055
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #54:
score: 0
Accepted
time: 6ms
memory: 3840kb
input:
72060
output:
POSSIBLE 72058 72058 72055 72057 72056 72060 72059 72059 72060 72056 72057 72055 72054 72054 72053 72051 72052 72048 72049 72047 72050 72050 72051 72053 72048 72052 72047 72049 72046 72046 72045 72043 72044 72040 72043 72037 72040 72038 72041 72041 72042 72044 72039 72045 72038 72042 72037 72039 720...
result:
ok answer = 1
Test #55:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
10561
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #56:
score: 0
Accepted
time: 4ms
memory: 3712kb
input:
56368
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #57:
score: 0
Accepted
time: 3ms
memory: 3840kb
input:
44898
output:
POSSIBLE 44896 44896 44893 44895 44894 44898 44897 44897 44898 44894 44895 44893 44892 44892 44891 44889 44890 44886 44887 44885 44888 44888 44889 44891 44886 44890 44885 44887 44884 44884 44883 44881 44882 44878 44881 44875 44878 44876 44879 44879 44880 44882 44877 44883 44876 44880 44875 44877 448...
result:
ok answer = 1
Test #58:
score: 0
Accepted
time: 5ms
memory: 3840kb
input:
69941
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1
Test #59:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
24192
output:
POSSIBLE 24192 24192 24191 24189 24190 24186 24187 24185 24188 24188 24189 24191 24186 24190 24185 24187 24184 24184 24183 24181 24182 24178 24181 24175 24178 24176 24179 24179 24180 24182 24177 24183 24176 24180 24175 24177 24174 24174 24173 24171 24172 24168 24169 24167 24170 24170 24171 24173 241...
result:
ok answer = 1
Test #60:
score: 0
Accepted
time: 1ms
memory: 3840kb
input:
13677
output:
POSSIBLE 13675 13675 13672 13674 13673 13677 13676 13676 13677 13673 13674 13672 13671 13671 13670 13668 13669 13665 13666 13664 13667 13667 13668 13670 13665 13669 13664 13666 13663 13663 13662 13660 13661 13657 13660 13654 13657 13655 13658 13658 13659 13661 13656 13662 13655 13659 13654 13656 136...
result:
ok answer = 1
Test #61:
score: 0
Accepted
time: 3ms
memory: 3840kb
input:
47780
output:
POSSIBLE 47780 47778 47779 47775 47776 47774 47777 47777 47778 47780 47775 47779 47774 47776 47773 47773 47772 47770 47771 47767 47770 47764 47767 47765 47768 47768 47769 47771 47766 47772 47765 47769 47764 47766 47763 47763 47762 47760 47761 47757 47758 47756 47759 47759 47760 47762 47757 47761 477...
result:
ok answer = 1
Test #62:
score: 0
Accepted
time: 3ms
memory: 3840kb
input:
36022
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #63:
score: 0
Accepted
time: 4ms
memory: 3840kb
input:
50675
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #64:
score: 0
Accepted
time: 2ms
memory: 3712kb
input:
26644
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #65:
score: 0
Accepted
time: 5ms
memory: 3840kb
input:
56969
output:
POSSIBLE 56969 56967 56968 56964 56965 56963 56966 56966 56967 56969 56964 56968 56963 56965 56962 56962 56961 56959 56960 56956 56959 56953 56956 56954 56957 56957 56958 56960 56955 56961 56954 56958 56953 56955 56952 56952 56951 56949 56950 56946 56947 56945 56948 56948 56949 56951 56946 56950 569...
result:
ok answer = 1
Test #66:
score: 0
Accepted
time: 5ms
memory: 3840kb
input:
53401
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #67:
score: 0
Accepted
time: 2ms
memory: 3840kb
input:
24772
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #68:
score: 0
Accepted
time: 3ms
memory: 3840kb
input:
35433
output:
POSSIBLE 35433 35433 35432 35430 35431 35427 35428 35426 35429 35429 35430 35432 35427 35431 35426 35428 35425 35425 35424 35422 35423 35419 35422 35416 35419 35417 35420 35420 35421 35423 35418 35424 35417 35421 35416 35418 35415 35415 35414 35412 35413 35409 35410 35408 35411 35411 35412 35414 354...
result:
ok answer = 1
Test #69:
score: 0
Accepted
time: 8ms
memory: 3840kb
input:
89877
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 9 15 12 14 11 11 10 8 13 7 14 10 15 13 16 16 17 19 18 22 21 23 20 20 19 17 22 18 23 21 24 24 25 27 26 30 27 33 30 32 29 29 28 26 31 25 32 28 33 31 34 34 35 37 36 40 39 41 38 38 37 35 40 36 41 39 42 42 43 45 44 48 45 51 48 50 47 47 46 44 49 43 50 46 51 49 52 ...
result:
ok answer = 1
Test #70:
score: 0
Accepted
time: 7ms
memory: 3840kb
input:
99986
output:
POSSIBLE 5 3 2 4 1 1 4 2 3 5 6 6 7 9 8 12 11 13 10 10 9 7 12 8 13 11 14 14 15 17 16 20 17 23 20 22 19 19 18 16 21 15 22 18 23 21 24 24 25 27 26 30 29 31 28 28 27 25 30 26 31 29 32 32 33 35 34 38 35 41 38 40 37 37 36 34 39 33 40 36 41 39 42 42 43 45 44 48 47 49 46 46 45 43 48 44 49 47 50 50 51 53 52 ...
result:
ok answer = 1
Test #71:
score: 0
Accepted
time: 0ms
memory: 3840kb
input:
6094
output:
POSSIBLE 1 1 2 4 3 7 4 10 7 9 6 6 5 3 8 2 9 5 10 8 11 11 12 14 13 17 16 18 15 15 14 12 17 13 18 16 19 19 20 22 21 25 22 28 25 27 24 24 23 21 26 20 27 23 28 26 29 29 30 32 31 35 34 36 33 33 32 30 35 31 36 34 37 37 38 40 39 43 40 46 43 45 42 42 41 39 44 38 45 41 46 44 47 47 48 50 49 53 52 54 51 51 50 ...
result:
ok answer = 1