QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#83279#5575. Knight's Tour Reduxchenshi#AC ✓18ms1876kbC++1008b2023-03-01 11:00:182023-03-01 11:00:19

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-01 11:00:19]
  • 评测
  • 测评结果:AC
  • 用时:18ms
  • 内存:1876kb
  • [2023-03-01 11:00:18]
  • 提交

answer

#include<cstdio>
using namespace std;
const int dx[]={-3,3,-3,3,-1,1,-1,1},dy[]={-1,-1,1,1,-3,-3,3,3};
int n,stx[99],sty[99],tp,delt;bool flg,vis1[99],vis2[99];
void dfs(int x,int y){
	if(flg) return;
	vis1[stx[++tp]=x]=1;vis2[sty[tp]=y]=1;
	if(tp==n){flg=1;for(int i=1;i<=tp;++i) printf("%d %d\n",stx[i]+delt,sty[i]+delt);}
	for(int i=0,tx,ty;i<8;++i) if((tx=x+dx[i])>0&&(ty=y+dy[i])>0)
		if(tx<=n&&ty<=n&&!vis1[tx]&&!vis2[ty]) dfs(tx,ty);
	vis1[x]=0;vis2[y]=0;--tp;
}
int main(){
	scanf("%d",&n);
	if(n==1){printf("POSSIBLE\n1 1");return 0;}
	if(n<5){printf("IMPOSSIBLE");return 0;}
	printf("POSSIBLE\n");
	for(;n>13;n-=8,delt+=8)
		printf("%d %d\n",delt+1,delt+1),
		printf("%d %d\n",delt+4,delt+2),
		printf("%d %d\n",delt+7,delt+3),
		printf("%d %d\n",delt+8,delt+6),
		printf("%d %d\n",delt+5,delt+5),
		printf("%d %d\n",delt+2,delt+4),
		printf("%d %d\n",delt+3,delt+7),
		printf("%d %d\n",delt+6,delt+8);
	for(int i=1;i<=n;++i) for(int j=1;j<=n;++j) dfs(i,j);
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 1500kb

input:

1

output:

POSSIBLE
1 1

result:

ok answer = 1

Test #2:

score: 0
Accepted
time: 1ms
memory: 1728kb

input:

2

output:

IMPOSSIBLE

result:

ok answer = 0

Test #3:

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

input:

3

output:

IMPOSSIBLE

result:

ok answer = 0

Test #4:

score: 0
Accepted
time: 1ms
memory: 1532kb

input:

4

output:

IMPOSSIBLE

result:

ok answer = 0

Test #5:

score: 0
Accepted
time: 1ms
memory: 1564kb

input:

5

output:

POSSIBLE
1 3
4 2
5 5
2 4
3 1

result:

ok answer = 1

Test #6:

score: 0
Accepted
time: 1ms
memory: 1764kb

input:

6

output:

POSSIBLE
1 1
4 2
3 5
6 6
5 3
2 4

result:

ok answer = 1

Test #7:

score: 0
Accepted
time: 1ms
memory: 1724kb

input:

7

output:

POSSIBLE
1 1
4 2
7 3
6 6
3 7
2 4
5 5

result:

ok answer = 1

Test #8:

score: 0
Accepted
time: 1ms
memory: 1520kb

input:

8

output:

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

result:

ok answer = 1

Test #9:

score: 0
Accepted
time: 1ms
memory: 1528kb

input:

9

output:

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

result:

ok answer = 1

Test #10:

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

input:

10

output:

POSSIBLE
1 1
4 2
7 3
10 4
9 7
6 6
3 5
2 8
5 9
8 10

result:

ok answer = 1

Test #11:

score: 0
Accepted
time: 1ms
memory: 1764kb

input:

11

output:

POSSIBLE
1 1
4 2
7 3
10 4
9 7
6 6
3 5
2 8
5 9
8 10
11 11

result:

ok answer = 1

Test #12:

score: 0
Accepted
time: 1ms
memory: 1572kb

input:

12

output:

POSSIBLE
1 1
4 2
3 5
2 8
5 9
6 12
9 11
12 10
11 7
8 6
7 3
10 4

result:

ok answer = 1

Test #13:

score: 0
Accepted
time: 1ms
memory: 1520kb

input:

13

output:

POSSIBLE
1 1
4 2
5 5
2 6
3 3
6 4
7 7
10 8
13 9
12 12
9 13
8 10
11 11

result:

ok answer = 1

Test #14:

score: 0
Accepted
time: 1ms
memory: 1500kb

input:

14

output:

POSSIBLE
1 1
4 2
7 3
8 6
5 5
2 4
3 7
6 8
9 9
12 10
11 13
14 14
13 11
10 12

result:

ok answer = 1

Test #15:

score: 0
Accepted
time: 1ms
memory: 1528kb

input:

15

output:

POSSIBLE
1 1
4 2
7 3
8 6
5 5
2 4
3 7
6 8
9 9
12 10
15 11
14 14
11 15
10 12
13 13

result:

ok answer = 1

Test #16:

score: 0
Accepted
time: 1ms
memory: 1748kb

input:

16

output:

POSSIBLE
1 1
4 2
7 3
8 6
5 5
2 4
3 7
6 8
9 9
12 10
15 11
16 14
13 13
10 12
11 15
14 16

result:

ok answer = 1

Test #17:

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

input:

17

output:

POSSIBLE
1 1
4 2
7 3
8 6
5 5
2 4
3 7
6 8
9 9
12 10
15 11
16 14
13 13
10 12
11 15
14 16
17 17

result:

ok answer = 1

Test #18:

score: 0
Accepted
time: 1ms
memory: 1728kb

input:

18

output:

POSSIBLE
1 1
4 2
7 3
8 6
5 5
2 4
3 7
6 8
9 9
12 10
15 11
18 12
17 15
14 14
11 13
10 16
13 17
16 18

result:

ok answer = 1

Test #19:

score: 0
Accepted
time: 1ms
memory: 1532kb

input:

19

output:

POSSIBLE
1 1
4 2
7 3
8 6
5 5
2 4
3 7
6 8
9 9
12 10
15 11
18 12
17 15
14 14
11 13
10 16
13 17
16 18
19 19

result:

ok answer = 1

Test #20:

score: 0
Accepted
time: 1ms
memory: 1488kb

input:

20

output:

POSSIBLE
1 1
4 2
7 3
8 6
5 5
2 4
3 7
6 8
9 9
12 10
11 13
10 16
13 17
14 20
17 19
20 18
19 15
16 14
15 11
18 12

result:

ok answer = 1

Test #21:

score: 0
Accepted
time: 11ms
memory: 1504kb

input:

99990

output:

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

result:

ok answer = 1

Test #22:

score: 0
Accepted
time: 8ms
memory: 1448kb

input:

99991

output:

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

result:

ok answer = 1

Test #23:

score: 0
Accepted
time: 10ms
memory: 1524kb

input:

99992

output:

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

result:

ok answer = 1

Test #24:

score: 0
Accepted
time: 12ms
memory: 1532kb

input:

99993

output:

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

result:

ok answer = 1

Test #25:

score: 0
Accepted
time: 18ms
memory: 1528kb

input:

99994

output:

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

result:

ok answer = 1

Test #26:

score: 0
Accepted
time: 15ms
memory: 1748kb

input:

99995

output:

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

result:

ok answer = 1

Test #27:

score: 0
Accepted
time: 16ms
memory: 1732kb

input:

99996

output:

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

result:

ok answer = 1

Test #28:

score: 0
Accepted
time: 11ms
memory: 1736kb

input:

99997

output:

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

result:

ok answer = 1

Test #29:

score: 0
Accepted
time: 15ms
memory: 1516kb

input:

99998

output:

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

result:

ok answer = 1

Test #30:

score: 0
Accepted
time: 7ms
memory: 1696kb

input:

99999

output:

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

result:

ok answer = 1

Test #31:

score: 0
Accepted
time: 8ms
memory: 1764kb

input:

100000

output:

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

result:

ok answer = 1

Test #32:

score: 0
Accepted
time: 11ms
memory: 1720kb

input:

74615

output:

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

result:

ok answer = 1

Test #33:

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

input:

25027

output:

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

result:

ok answer = 1

Test #34:

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

input:

40852

output:

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

result:

ok answer = 1

Test #35:

score: 0
Accepted
time: 5ms
memory: 1768kb

input:

31411

output:

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

result:

ok answer = 1

Test #36:

score: 0
Accepted
time: 6ms
memory: 1520kb

input:

37332

output:

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

result:

ok answer = 1

Test #37:

score: 0
Accepted
time: 8ms
memory: 1512kb

input:

80435

output:

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

result:

ok answer = 1

Test #38:

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

input:

90457

output:

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

result:

ok answer = 1

Test #39:

score: 0
Accepted
time: 1ms
memory: 1516kb

input:

1796

output:

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

result:

ok answer = 1

Test #40:

score: 0
Accepted
time: 1ms
memory: 1744kb

input:

55809

output:

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

result:

ok answer = 1

Test #41:

score: 0
Accepted
time: 9ms
memory: 1872kb

input:

97013

output:

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

result:

ok answer = 1

Test #42:

score: 0
Accepted
time: 11ms
memory: 1524kb

input:

77938

output:

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

result:

ok answer = 1

Test #43:

score: 0
Accepted
time: 8ms
memory: 1528kb

input:

87884

output:

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

result:

ok answer = 1

Test #44:

score: 0
Accepted
time: 7ms
memory: 1516kb

input:

61687

output:

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

result:

ok answer = 1

Test #45:

score: 0
Accepted
time: 2ms
memory: 1500kb

input:

32567

output:

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

result:

ok answer = 1

Test #46:

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

input:

53441

output:

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

result:

ok answer = 1

Test #47:

score: 0
Accepted
time: 3ms
memory: 1768kb

input:

19197

output:

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

result:

ok answer = 1

Test #48:

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

input:

77260

output:

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

result:

ok answer = 1

Test #49:

score: 0
Accepted
time: 1ms
memory: 1764kb

input:

6699

output:

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

result:

ok answer = 1

Test #50:

score: 0
Accepted
time: 10ms
memory: 1504kb

input:

72561

output:

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

result:

ok answer = 1

Test #51:

score: 0
Accepted
time: 9ms
memory: 1688kb

input:

60412

output:

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

result:

ok answer = 1

Test #52:

score: 0
Accepted
time: 7ms
memory: 1520kb

input:

78243

output:

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

result:

ok answer = 1

Test #53:

score: 0
Accepted
time: 14ms
memory: 1688kb

input:

93055

output:

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

result:

ok answer = 1

Test #54:

score: 0
Accepted
time: 7ms
memory: 1876kb

input:

72060

output:

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

result:

ok answer = 1

Test #55:

score: 0
Accepted
time: 2ms
memory: 1572kb

input:

10561

output:

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

result:

ok answer = 1

Test #56:

score: 0
Accepted
time: 9ms
memory: 1696kb

input:

56368

output:

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

result:

ok answer = 1

Test #57:

score: 0
Accepted
time: 7ms
memory: 1496kb

input:

44898

output:

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

result:

ok answer = 1

Test #58:

score: 0
Accepted
time: 5ms
memory: 1488kb

input:

69941

output:

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

result:

ok answer = 1

Test #59:

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

input:

24192

output:

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

result:

ok answer = 1

Test #60:

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

input:

13677

output:

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

result:

ok answer = 1

Test #61:

score: 0
Accepted
time: 7ms
memory: 1720kb

input:

47780

output:

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

result:

ok answer = 1

Test #62:

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

input:

36022

output:

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

result:

ok answer = 1

Test #63:

score: 0
Accepted
time: 6ms
memory: 1708kb

input:

50675

output:

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

result:

ok answer = 1

Test #64:

score: 0
Accepted
time: 5ms
memory: 1872kb

input:

26644

output:

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

result:

ok answer = 1

Test #65:

score: 0
Accepted
time: 9ms
memory: 1868kb

input:

56969

output:

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

result:

ok answer = 1

Test #66:

score: 0
Accepted
time: 9ms
memory: 1532kb

input:

53401

output:

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

result:

ok answer = 1

Test #67:

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

input:

24772

output:

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

result:

ok answer = 1

Test #68:

score: 0
Accepted
time: 2ms
memory: 1876kb

input:

35433

output:

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

result:

ok answer = 1

Test #69:

score: 0
Accepted
time: 8ms
memory: 1472kb

input:

89877

output:

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

result:

ok answer = 1

Test #70:

score: 0
Accepted
time: 14ms
memory: 1524kb

input:

99986

output:

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

result:

ok answer = 1

Test #71:

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

input:

6094

output:

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

result:

ok answer = 1