QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#95098#5575. Knight's Tour ReduxSEM_PRESSAO_pedroteosousa#AC ✓17ms4544kbC++141.4kb2023-04-09 04:22:382023-04-09 04:22:39

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-09 04:22:39]
  • 评测
  • 测评结果:AC
  • 用时:17ms
  • 内存:4544kb
  • [2023-04-09 04:22:38]
  • 提交

answer

#include <bits/stdc++.h>
#define mod 998244353
#define ll long long
#define maxn 2020000
#define pii pair<int,int>
#define pb push_back
using namespace std;

int foix[maxn];
int foiy[maxn];

int n;

int mrk = 0 ;

vector<pii> ans;

void go(int x,int y){
	
		
		
		
	if(x <= 0 || x > n || y <= 0 || y > n) return;
	if(foix[x] || foiy[y]) return;
	foix[x] = foiy[y] = 1;
	mrk++;
	
	ans.pb({x,y});
	
	//printf("+ %d %d\n",x,y);
	if(mrk == n){
		//printf("ok!\n");
		for(pii e : ans)
			printf("%d %d\n",e.first,e.second);
		exit(0);
		return;
	}

	
	go(x+1,y+3);
	go(x+1,y-3);
	go(x-1,y+3);
	go(x-1,y-3);
	go(x+3,y+1);
	go(x+3,y-1);
	go(x-3,y+1);
	go(x-3,y-1);
	foix[x] = foiy[y] = 0;
	mrk--;
	
	ans.pop_back();
}

main(){

	scanf("%d",&n);
	
	if(n == 1){
		printf("POSSIBLE\n1 1\n");
		return 0;
	}
	
	if(n <= 4){
		printf("IMPOSSIBLE\n");
		return 0;
	}
	
	//go(1,3);
	
	printf("POSSIBLE\n");
	
	int cur = 0;
	
	while(cur + 18 < n){
	
		
		printf("%d %d\n",1+cur,3+cur);
		printf("%d %d\n",4+cur,2+cur);
		printf("%d %d\n",7+cur,1+cur);
		printf("%d %d\n",6+cur,4+cur);
		printf("%d %d\n",3+cur,5+cur);
		printf("%d %d\n",2+cur,8+cur);
		printf("%d %d\n",5+cur,7+cur);
		printf("%d %d\n",8+cur,6+cur);
		printf("%d %d\n",9+cur,9+cur);
		
		for(int i=1;i<=9;i++) foix[cur+i] = foiy[cur+i] = 1, mrk++;	
		cur += 9;
	}
	
	go(cur+1,cur+3);
	
	

}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3532kb

input:

1

output:

POSSIBLE
1 1

result:

ok answer = 1

Test #2:

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

input:

2

output:

IMPOSSIBLE

result:

ok answer = 0

Test #3:

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

input:

3

output:

IMPOSSIBLE

result:

ok answer = 0

Test #4:

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

input:

4

output:

IMPOSSIBLE

result:

ok answer = 0

Test #5:

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

input:

5

output:

POSSIBLE
1 3
4 4
5 1
2 2
3 5

result:

ok answer = 1

Test #6:

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

input:

6

output:

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

result:

ok answer = 1

Test #7:

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

input:

7

output:

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

result:

ok answer = 1

Test #8:

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

input:

8

output:

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

result:

ok answer = 1

Test #9:

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

input:

9

output:

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

result:

ok answer = 1

Test #10:

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

input:

10

output:

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

result:

ok answer = 1

Test #11:

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

input:

11

output:

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

result:

ok answer = 1

Test #12:

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

input:

12

output:

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

result:

ok answer = 1

Test #13:

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

input:

13

output:

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

result:

ok answer = 1

Test #14:

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

input:

14

output:

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

result:

ok answer = 1

Test #15:

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

input:

15

output:

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

result:

ok answer = 1

Test #16:

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

input:

16

output:

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

result:

ok answer = 1

Test #17:

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

input:

17

output:

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

result:

ok answer = 1

Test #18:

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

input:

18

output:

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

result:

ok answer = 1

Test #19:

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

input:

19

output:

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

result:

ok answer = 1

Test #20:

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

input:

20

output:

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

result:

ok answer = 1

Test #21:

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

input:

99990

output:

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

result:

ok answer = 1

Test #22:

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

input:

99991

output:

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

result:

ok answer = 1

Test #23:

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

input:

99992

output:

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

result:

ok answer = 1

Test #24:

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

input:

99993

output:

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

result:

ok answer = 1

Test #25:

score: 0
Accepted
time: 17ms
memory: 4316kb

input:

99994

output:

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

result:

ok answer = 1

Test #26:

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

input:

99995

output:

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

result:

ok answer = 1

Test #27:

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

input:

99996

output:

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

result:

ok answer = 1

Test #28:

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

input:

99997

output:

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

result:

ok answer = 1

Test #29:

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

input:

99998

output:

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

result:

ok answer = 1

Test #30:

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

input:

99999

output:

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

result:

ok answer = 1

Test #31:

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

input:

100000

output:

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

result:

ok answer = 1

Test #32:

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

input:

74615

output:

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

result:

ok answer = 1

Test #33:

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

input:

25027

output:

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

result:

ok answer = 1

Test #34:

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

input:

40852

output:

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

result:

ok answer = 1

Test #35:

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

input:

31411

output:

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

result:

ok answer = 1

Test #36:

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

input:

37332

output:

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

result:

ok answer = 1

Test #37:

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

input:

80435

output:

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

result:

ok answer = 1

Test #38:

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

input:

90457

output:

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

result:

ok answer = 1

Test #39:

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

input:

1796

output:

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

result:

ok answer = 1

Test #40:

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

input:

55809

output:

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

result:

ok answer = 1

Test #41:

score: 0
Accepted
time: 17ms
memory: 4520kb

input:

97013

output:

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

result:

ok answer = 1

Test #42:

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

input:

77938

output:

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

result:

ok answer = 1

Test #43:

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

input:

87884

output:

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

result:

ok answer = 1

Test #44:

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

input:

61687

output:

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

result:

ok answer = 1

Test #45:

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

input:

32567

output:

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

result:

ok answer = 1

Test #46:

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

input:

53441

output:

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

result:

ok answer = 1

Test #47:

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

input:

19197

output:

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

result:

ok answer = 1

Test #48:

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

input:

77260

output:

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

result:

ok answer = 1

Test #49:

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

input:

6699

output:

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

result:

ok answer = 1

Test #50:

score: 0
Accepted
time: 13ms
memory: 4096kb

input:

72561

output:

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

result:

ok answer = 1

Test #51:

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

input:

60412

output:

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

result:

ok answer = 1

Test #52:

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

input:

78243

output:

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

result:

ok answer = 1

Test #53:

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

input:

93055

output:

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

result:

ok answer = 1

Test #54:

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

input:

72060

output:

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

result:

ok answer = 1

Test #55:

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

input:

10561

output:

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

result:

ok answer = 1

Test #56:

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

input:

56368

output:

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

result:

ok answer = 1

Test #57:

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

input:

44898

output:

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

result:

ok answer = 1

Test #58:

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

input:

69941

output:

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

result:

ok answer = 1

Test #59:

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

input:

24192

output:

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

result:

ok answer = 1

Test #60:

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

input:

13677

output:

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

result:

ok answer = 1

Test #61:

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

input:

47780

output:

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

result:

ok answer = 1

Test #62:

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

input:

36022

output:

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

result:

ok answer = 1

Test #63:

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

input:

50675

output:

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

result:

ok answer = 1

Test #64:

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

input:

26644

output:

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

result:

ok answer = 1

Test #65:

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

input:

56969

output:

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

result:

ok answer = 1

Test #66:

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

input:

53401

output:

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

result:

ok answer = 1

Test #67:

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

input:

24772

output:

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

result:

ok answer = 1

Test #68:

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

input:

35433

output:

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

result:

ok answer = 1

Test #69:

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

input:

89877

output:

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

result:

ok answer = 1

Test #70:

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

input:

99986

output:

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

result:

ok answer = 1

Test #71:

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

input:

6094

output:

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

result:

ok answer = 1