QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#81818#5575. Knight's Tour ReduxjeffqiAC ✓17ms4148kbC++141.5kb2023-02-26 13:59:222023-02-26 14:06:56

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-26 14:06:56]
  • 评测
  • 测评结果:AC
  • 用时:17ms
  • 内存:4148kb
  • [2023-02-26 13:59:22]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i,a,b) for (int i = (a); i <= (b); ++i)
#define drep(i,a,b) for (int i = (a); i >= (b); --i)
#define LL long long
#define pii pair<int,int>
#define pll pair<LL,LL>
#define fi first
#define se second
#define eb emplace_back
#define mp make_pair
using namespace std;
LL read() {
	LL x = 0,y = 1; char ch = getchar(); while (!isdigit(ch)) {if (ch == '-') y = -y; ch = getchar();}
	while (isdigit(ch)) {x = x*10+ch-'0'; ch = getchar();} return x*y;
}
namespace qiqi {
	const int N = 1e5+5; int n,m,vx[N],vy[N],tl,dx[8] = {1,3,3,1,-1,-3,-3,-1},dy[8] = {3,1,-1,-3,-3,-1,1,3}; pii q[N]; vector<pii> ans;
	bool chk(int x,int y) {
		return x > 0 && y > 0 && x <= n && y <= n && !vx[x] && !vy[y];
	}
	bool dfs(int x,int y) {
		q[++tl] = mp(x,y);
		vx[x] = vy[y] = 1;
		if (tl == n) {
			rep(i,1,tl) ans.eb(q[i]);
			return 1;
		}
		rep(i,0,7) if (chk(x+dx[i],y+dy[i])) {
			if (dfs(x+dx[i],y+dy[i])) return 1;
		}
		--tl; vx[x] = vy[y] = 0;
		return 0;
	}
	void print() {
		puts("POSSIBLE");
		for (auto p:ans) printf("%d %d\n",p.fi,p.se);
	}
	void fail() {
		puts("IMPOSSIBLE");
	}
	void main() {
		n = read();
		if (n < 11) {
			rep(i,1,n) rep(j,1,n) {
				if (dfs(i,j)) {
					return print(); 
				}
			}
			return fail();
		}
		while (n > 11) {
			ans.eb(mp(n,n));
			ans.eb(mp(n-1,n-3));
			ans.eb(mp(n-4,n-4));
			ans.eb(mp(n-5,n-1));
			ans.eb(mp(n-2,n-2));
			ans.eb(mp(n-3,n-5));
			n -= 6;
		}
		if (!dfs(n,n)) return fail();
		print();
	}
}
int main() {
	qiqi::main(); return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3572kb

input:

1

output:

POSSIBLE
1 1

result:

ok answer = 1

Test #2:

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

input:

2

output:

IMPOSSIBLE

result:

ok answer = 0

Test #3:

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

input:

3

output:

IMPOSSIBLE

result:

ok answer = 0

Test #4:

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

input:

4

output:

IMPOSSIBLE

result:

ok answer = 0

Test #5:

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

input:

5

output:

POSSIBLE
1 3
4 4
5 1
2 2
3 5

result:

ok answer = 1

Test #6:

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

input:

6

output:

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

result:

ok answer = 1

Test #7:

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

input:

7

output:

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

result:

ok answer = 1

Test #8:

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

input:

8

output:

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

result:

ok answer = 1

Test #9:

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

input:

9

output:

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

result:

ok answer = 1

Test #10:

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

input:

10

output:

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

result:

ok answer = 1

Test #11:

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

input:

11

output:

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

result:

ok answer = 1

Test #12:

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

input:

12

output:

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

result:

ok answer = 1

Test #13:

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

input:

13

output:

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

result:

ok answer = 1

Test #14:

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

input:

14

output:

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

result:

ok answer = 1

Test #15:

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

input:

15

output:

POSSIBLE
15 15
14 12
11 11
10 14
13 13
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: 1ms
memory: 3764kb

input:

16

output:

POSSIBLE
16 16
15 13
12 12
11 15
14 14
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: 2ms
memory: 3576kb

input:

17

output:

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

result:

ok answer = 1

Test #18:

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

input:

18

output:

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

result:

ok answer = 1

Test #19:

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

input:

19

output:

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

result:

ok answer = 1

Test #20:

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

input:

20

output:

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

result:

ok answer = 1

Test #21:

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

input:

99990

output:

POSSIBLE
99990 99990
99989 99987
99986 99986
99985 99989
99988 99988
99987 99985
99984 99984
99983 99981
99980 99980
99979 99983
99982 99982
99981 99979
99978 99978
99977 99975
99974 99974
99973 99977
99976 99976
99975 99973
99972 99972
99971 99969
99968 99968
99967 99971
99970 99970
99969 99967
999...

result:

ok answer = 1

Test #22:

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

input:

99991

output:

POSSIBLE
99991 99991
99990 99988
99987 99987
99986 99990
99989 99989
99988 99986
99985 99985
99984 99982
99981 99981
99980 99984
99983 99983
99982 99980
99979 99979
99978 99976
99975 99975
99974 99978
99977 99977
99976 99974
99973 99973
99972 99970
99969 99969
99968 99972
99971 99971
99970 99968
999...

result:

ok answer = 1

Test #23:

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

input:

99992

output:

POSSIBLE
99992 99992
99991 99989
99988 99988
99987 99991
99990 99990
99989 99987
99986 99986
99985 99983
99982 99982
99981 99985
99984 99984
99983 99981
99980 99980
99979 99977
99976 99976
99975 99979
99978 99978
99977 99975
99974 99974
99973 99971
99970 99970
99969 99973
99972 99972
99971 99969
999...

result:

ok answer = 1

Test #24:

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

input:

99993

output:

POSSIBLE
99993 99993
99992 99990
99989 99989
99988 99992
99991 99991
99990 99988
99987 99987
99986 99984
99983 99983
99982 99986
99985 99985
99984 99982
99981 99981
99980 99978
99977 99977
99976 99980
99979 99979
99978 99976
99975 99975
99974 99972
99971 99971
99970 99974
99973 99973
99972 99970
999...

result:

ok answer = 1

Test #25:

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

input:

99994

output:

POSSIBLE
99994 99994
99993 99991
99990 99990
99989 99993
99992 99992
99991 99989
99988 99988
99987 99985
99984 99984
99983 99987
99986 99986
99985 99983
99982 99982
99981 99979
99978 99978
99977 99981
99980 99980
99979 99977
99976 99976
99975 99973
99972 99972
99971 99975
99974 99974
99973 99971
999...

result:

ok answer = 1

Test #26:

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

input:

99995

output:

POSSIBLE
99995 99995
99994 99992
99991 99991
99990 99994
99993 99993
99992 99990
99989 99989
99988 99986
99985 99985
99984 99988
99987 99987
99986 99984
99983 99983
99982 99980
99979 99979
99978 99982
99981 99981
99980 99978
99977 99977
99976 99974
99973 99973
99972 99976
99975 99975
99974 99972
999...

result:

ok answer = 1

Test #27:

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

input:

99996

output:

POSSIBLE
99996 99996
99995 99993
99992 99992
99991 99995
99994 99994
99993 99991
99990 99990
99989 99987
99986 99986
99985 99989
99988 99988
99987 99985
99984 99984
99983 99981
99980 99980
99979 99983
99982 99982
99981 99979
99978 99978
99977 99975
99974 99974
99973 99977
99976 99976
99975 99973
999...

result:

ok answer = 1

Test #28:

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

input:

99997

output:

POSSIBLE
99997 99997
99996 99994
99993 99993
99992 99996
99995 99995
99994 99992
99991 99991
99990 99988
99987 99987
99986 99990
99989 99989
99988 99986
99985 99985
99984 99982
99981 99981
99980 99984
99983 99983
99982 99980
99979 99979
99978 99976
99975 99975
99974 99978
99977 99977
99976 99974
999...

result:

ok answer = 1

Test #29:

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

input:

99998

output:

POSSIBLE
99998 99998
99997 99995
99994 99994
99993 99997
99996 99996
99995 99993
99992 99992
99991 99989
99988 99988
99987 99991
99990 99990
99989 99987
99986 99986
99985 99983
99982 99982
99981 99985
99984 99984
99983 99981
99980 99980
99979 99977
99976 99976
99975 99979
99978 99978
99977 99975
999...

result:

ok answer = 1

Test #30:

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

input:

99999

output:

POSSIBLE
99999 99999
99998 99996
99995 99995
99994 99998
99997 99997
99996 99994
99993 99993
99992 99990
99989 99989
99988 99992
99991 99991
99990 99988
99987 99987
99986 99984
99983 99983
99982 99986
99985 99985
99984 99982
99981 99981
99980 99978
99977 99977
99976 99980
99979 99979
99978 99976
999...

result:

ok answer = 1

Test #31:

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

input:

100000

output:

POSSIBLE
100000 100000
99999 99997
99996 99996
99995 99999
99998 99998
99997 99995
99994 99994
99993 99991
99990 99990
99989 99993
99992 99992
99991 99989
99988 99988
99987 99985
99984 99984
99983 99987
99986 99986
99985 99983
99982 99982
99981 99979
99978 99978
99977 99981
99980 99980
99979 99977
9...

result:

ok answer = 1

Test #32:

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

input:

74615

output:

POSSIBLE
74615 74615
74614 74612
74611 74611
74610 74614
74613 74613
74612 74610
74609 74609
74608 74606
74605 74605
74604 74608
74607 74607
74606 74604
74603 74603
74602 74600
74599 74599
74598 74602
74601 74601
74600 74598
74597 74597
74596 74594
74593 74593
74592 74596
74595 74595
74594 74592
745...

result:

ok answer = 1

Test #33:

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

input:

25027

output:

POSSIBLE
25027 25027
25026 25024
25023 25023
25022 25026
25025 25025
25024 25022
25021 25021
25020 25018
25017 25017
25016 25020
25019 25019
25018 25016
25015 25015
25014 25012
25011 25011
25010 25014
25013 25013
25012 25010
25009 25009
25008 25006
25005 25005
25004 25008
25007 25007
25006 25004
250...

result:

ok answer = 1

Test #34:

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

input:

40852

output:

POSSIBLE
40852 40852
40851 40849
40848 40848
40847 40851
40850 40850
40849 40847
40846 40846
40845 40843
40842 40842
40841 40845
40844 40844
40843 40841
40840 40840
40839 40837
40836 40836
40835 40839
40838 40838
40837 40835
40834 40834
40833 40831
40830 40830
40829 40833
40832 40832
40831 40829
408...

result:

ok answer = 1

Test #35:

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

input:

31411

output:

POSSIBLE
31411 31411
31410 31408
31407 31407
31406 31410
31409 31409
31408 31406
31405 31405
31404 31402
31401 31401
31400 31404
31403 31403
31402 31400
31399 31399
31398 31396
31395 31395
31394 31398
31397 31397
31396 31394
31393 31393
31392 31390
31389 31389
31388 31392
31391 31391
31390 31388
313...

result:

ok answer = 1

Test #36:

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

input:

37332

output:

POSSIBLE
37332 37332
37331 37329
37328 37328
37327 37331
37330 37330
37329 37327
37326 37326
37325 37323
37322 37322
37321 37325
37324 37324
37323 37321
37320 37320
37319 37317
37316 37316
37315 37319
37318 37318
37317 37315
37314 37314
37313 37311
37310 37310
37309 37313
37312 37312
37311 37309
373...

result:

ok answer = 1

Test #37:

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

input:

80435

output:

POSSIBLE
80435 80435
80434 80432
80431 80431
80430 80434
80433 80433
80432 80430
80429 80429
80428 80426
80425 80425
80424 80428
80427 80427
80426 80424
80423 80423
80422 80420
80419 80419
80418 80422
80421 80421
80420 80418
80417 80417
80416 80414
80413 80413
80412 80416
80415 80415
80414 80412
804...

result:

ok answer = 1

Test #38:

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

input:

90457

output:

POSSIBLE
90457 90457
90456 90454
90453 90453
90452 90456
90455 90455
90454 90452
90451 90451
90450 90448
90447 90447
90446 90450
90449 90449
90448 90446
90445 90445
90444 90442
90441 90441
90440 90444
90443 90443
90442 90440
90439 90439
90438 90436
90435 90435
90434 90438
90437 90437
90436 90434
904...

result:

ok answer = 1

Test #39:

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

input:

1796

output:

POSSIBLE
1796 1796
1795 1793
1792 1792
1791 1795
1794 1794
1793 1791
1790 1790
1789 1787
1786 1786
1785 1789
1788 1788
1787 1785
1784 1784
1783 1781
1780 1780
1779 1783
1782 1782
1781 1779
1778 1778
1777 1775
1774 1774
1773 1777
1776 1776
1775 1773
1772 1772
1771 1769
1768 1768
1767 1771
1770 1770
1...

result:

ok answer = 1

Test #40:

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

input:

55809

output:

POSSIBLE
55809 55809
55808 55806
55805 55805
55804 55808
55807 55807
55806 55804
55803 55803
55802 55800
55799 55799
55798 55802
55801 55801
55800 55798
55797 55797
55796 55794
55793 55793
55792 55796
55795 55795
55794 55792
55791 55791
55790 55788
55787 55787
55786 55790
55789 55789
55788 55786
557...

result:

ok answer = 1

Test #41:

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

input:

97013

output:

POSSIBLE
97013 97013
97012 97010
97009 97009
97008 97012
97011 97011
97010 97008
97007 97007
97006 97004
97003 97003
97002 97006
97005 97005
97004 97002
97001 97001
97000 96998
96997 96997
96996 97000
96999 96999
96998 96996
96995 96995
96994 96992
96991 96991
96990 96994
96993 96993
96992 96990
969...

result:

ok answer = 1

Test #42:

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

input:

77938

output:

POSSIBLE
77938 77938
77937 77935
77934 77934
77933 77937
77936 77936
77935 77933
77932 77932
77931 77929
77928 77928
77927 77931
77930 77930
77929 77927
77926 77926
77925 77923
77922 77922
77921 77925
77924 77924
77923 77921
77920 77920
77919 77917
77916 77916
77915 77919
77918 77918
77917 77915
779...

result:

ok answer = 1

Test #43:

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

input:

87884

output:

POSSIBLE
87884 87884
87883 87881
87880 87880
87879 87883
87882 87882
87881 87879
87878 87878
87877 87875
87874 87874
87873 87877
87876 87876
87875 87873
87872 87872
87871 87869
87868 87868
87867 87871
87870 87870
87869 87867
87866 87866
87865 87863
87862 87862
87861 87865
87864 87864
87863 87861
878...

result:

ok answer = 1

Test #44:

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

input:

61687

output:

POSSIBLE
61687 61687
61686 61684
61683 61683
61682 61686
61685 61685
61684 61682
61681 61681
61680 61678
61677 61677
61676 61680
61679 61679
61678 61676
61675 61675
61674 61672
61671 61671
61670 61674
61673 61673
61672 61670
61669 61669
61668 61666
61665 61665
61664 61668
61667 61667
61666 61664
616...

result:

ok answer = 1

Test #45:

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

input:

32567

output:

POSSIBLE
32567 32567
32566 32564
32563 32563
32562 32566
32565 32565
32564 32562
32561 32561
32560 32558
32557 32557
32556 32560
32559 32559
32558 32556
32555 32555
32554 32552
32551 32551
32550 32554
32553 32553
32552 32550
32549 32549
32548 32546
32545 32545
32544 32548
32547 32547
32546 32544
325...

result:

ok answer = 1

Test #46:

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

input:

53441

output:

POSSIBLE
53441 53441
53440 53438
53437 53437
53436 53440
53439 53439
53438 53436
53435 53435
53434 53432
53431 53431
53430 53434
53433 53433
53432 53430
53429 53429
53428 53426
53425 53425
53424 53428
53427 53427
53426 53424
53423 53423
53422 53420
53419 53419
53418 53422
53421 53421
53420 53418
534...

result:

ok answer = 1

Test #47:

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

input:

19197

output:

POSSIBLE
19197 19197
19196 19194
19193 19193
19192 19196
19195 19195
19194 19192
19191 19191
19190 19188
19187 19187
19186 19190
19189 19189
19188 19186
19185 19185
19184 19182
19181 19181
19180 19184
19183 19183
19182 19180
19179 19179
19178 19176
19175 19175
19174 19178
19177 19177
19176 19174
191...

result:

ok answer = 1

Test #48:

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

input:

77260

output:

POSSIBLE
77260 77260
77259 77257
77256 77256
77255 77259
77258 77258
77257 77255
77254 77254
77253 77251
77250 77250
77249 77253
77252 77252
77251 77249
77248 77248
77247 77245
77244 77244
77243 77247
77246 77246
77245 77243
77242 77242
77241 77239
77238 77238
77237 77241
77240 77240
77239 77237
772...

result:

ok answer = 1

Test #49:

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

input:

6699

output:

POSSIBLE
6699 6699
6698 6696
6695 6695
6694 6698
6697 6697
6696 6694
6693 6693
6692 6690
6689 6689
6688 6692
6691 6691
6690 6688
6687 6687
6686 6684
6683 6683
6682 6686
6685 6685
6684 6682
6681 6681
6680 6678
6677 6677
6676 6680
6679 6679
6678 6676
6675 6675
6674 6672
6671 6671
6670 6674
6673 6673
6...

result:

ok answer = 1

Test #50:

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

input:

72561

output:

POSSIBLE
72561 72561
72560 72558
72557 72557
72556 72560
72559 72559
72558 72556
72555 72555
72554 72552
72551 72551
72550 72554
72553 72553
72552 72550
72549 72549
72548 72546
72545 72545
72544 72548
72547 72547
72546 72544
72543 72543
72542 72540
72539 72539
72538 72542
72541 72541
72540 72538
725...

result:

ok answer = 1

Test #51:

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

input:

60412

output:

POSSIBLE
60412 60412
60411 60409
60408 60408
60407 60411
60410 60410
60409 60407
60406 60406
60405 60403
60402 60402
60401 60405
60404 60404
60403 60401
60400 60400
60399 60397
60396 60396
60395 60399
60398 60398
60397 60395
60394 60394
60393 60391
60390 60390
60389 60393
60392 60392
60391 60389
603...

result:

ok answer = 1

Test #52:

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

input:

78243

output:

POSSIBLE
78243 78243
78242 78240
78239 78239
78238 78242
78241 78241
78240 78238
78237 78237
78236 78234
78233 78233
78232 78236
78235 78235
78234 78232
78231 78231
78230 78228
78227 78227
78226 78230
78229 78229
78228 78226
78225 78225
78224 78222
78221 78221
78220 78224
78223 78223
78222 78220
782...

result:

ok answer = 1

Test #53:

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

input:

93055

output:

POSSIBLE
93055 93055
93054 93052
93051 93051
93050 93054
93053 93053
93052 93050
93049 93049
93048 93046
93045 93045
93044 93048
93047 93047
93046 93044
93043 93043
93042 93040
93039 93039
93038 93042
93041 93041
93040 93038
93037 93037
93036 93034
93033 93033
93032 93036
93035 93035
93034 93032
930...

result:

ok answer = 1

Test #54:

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

input:

72060

output:

POSSIBLE
72060 72060
72059 72057
72056 72056
72055 72059
72058 72058
72057 72055
72054 72054
72053 72051
72050 72050
72049 72053
72052 72052
72051 72049
72048 72048
72047 72045
72044 72044
72043 72047
72046 72046
72045 72043
72042 72042
72041 72039
72038 72038
72037 72041
72040 72040
72039 72037
720...

result:

ok answer = 1

Test #55:

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

input:

10561

output:

POSSIBLE
10561 10561
10560 10558
10557 10557
10556 10560
10559 10559
10558 10556
10555 10555
10554 10552
10551 10551
10550 10554
10553 10553
10552 10550
10549 10549
10548 10546
10545 10545
10544 10548
10547 10547
10546 10544
10543 10543
10542 10540
10539 10539
10538 10542
10541 10541
10540 10538
105...

result:

ok answer = 1

Test #56:

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

input:

56368

output:

POSSIBLE
56368 56368
56367 56365
56364 56364
56363 56367
56366 56366
56365 56363
56362 56362
56361 56359
56358 56358
56357 56361
56360 56360
56359 56357
56356 56356
56355 56353
56352 56352
56351 56355
56354 56354
56353 56351
56350 56350
56349 56347
56346 56346
56345 56349
56348 56348
56347 56345
563...

result:

ok answer = 1

Test #57:

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

input:

44898

output:

POSSIBLE
44898 44898
44897 44895
44894 44894
44893 44897
44896 44896
44895 44893
44892 44892
44891 44889
44888 44888
44887 44891
44890 44890
44889 44887
44886 44886
44885 44883
44882 44882
44881 44885
44884 44884
44883 44881
44880 44880
44879 44877
44876 44876
44875 44879
44878 44878
44877 44875
448...

result:

ok answer = 1

Test #58:

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

input:

69941

output:

POSSIBLE
69941 69941
69940 69938
69937 69937
69936 69940
69939 69939
69938 69936
69935 69935
69934 69932
69931 69931
69930 69934
69933 69933
69932 69930
69929 69929
69928 69926
69925 69925
69924 69928
69927 69927
69926 69924
69923 69923
69922 69920
69919 69919
69918 69922
69921 69921
69920 69918
699...

result:

ok answer = 1

Test #59:

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

input:

24192

output:

POSSIBLE
24192 24192
24191 24189
24188 24188
24187 24191
24190 24190
24189 24187
24186 24186
24185 24183
24182 24182
24181 24185
24184 24184
24183 24181
24180 24180
24179 24177
24176 24176
24175 24179
24178 24178
24177 24175
24174 24174
24173 24171
24170 24170
24169 24173
24172 24172
24171 24169
241...

result:

ok answer = 1

Test #60:

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

input:

13677

output:

POSSIBLE
13677 13677
13676 13674
13673 13673
13672 13676
13675 13675
13674 13672
13671 13671
13670 13668
13667 13667
13666 13670
13669 13669
13668 13666
13665 13665
13664 13662
13661 13661
13660 13664
13663 13663
13662 13660
13659 13659
13658 13656
13655 13655
13654 13658
13657 13657
13656 13654
136...

result:

ok answer = 1

Test #61:

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

input:

47780

output:

POSSIBLE
47780 47780
47779 47777
47776 47776
47775 47779
47778 47778
47777 47775
47774 47774
47773 47771
47770 47770
47769 47773
47772 47772
47771 47769
47768 47768
47767 47765
47764 47764
47763 47767
47766 47766
47765 47763
47762 47762
47761 47759
47758 47758
47757 47761
47760 47760
47759 47757
477...

result:

ok answer = 1

Test #62:

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

input:

36022

output:

POSSIBLE
36022 36022
36021 36019
36018 36018
36017 36021
36020 36020
36019 36017
36016 36016
36015 36013
36012 36012
36011 36015
36014 36014
36013 36011
36010 36010
36009 36007
36006 36006
36005 36009
36008 36008
36007 36005
36004 36004
36003 36001
36000 36000
35999 36003
36002 36002
36001 35999
359...

result:

ok answer = 1

Test #63:

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

input:

50675

output:

POSSIBLE
50675 50675
50674 50672
50671 50671
50670 50674
50673 50673
50672 50670
50669 50669
50668 50666
50665 50665
50664 50668
50667 50667
50666 50664
50663 50663
50662 50660
50659 50659
50658 50662
50661 50661
50660 50658
50657 50657
50656 50654
50653 50653
50652 50656
50655 50655
50654 50652
506...

result:

ok answer = 1

Test #64:

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

input:

26644

output:

POSSIBLE
26644 26644
26643 26641
26640 26640
26639 26643
26642 26642
26641 26639
26638 26638
26637 26635
26634 26634
26633 26637
26636 26636
26635 26633
26632 26632
26631 26629
26628 26628
26627 26631
26630 26630
26629 26627
26626 26626
26625 26623
26622 26622
26621 26625
26624 26624
26623 26621
266...

result:

ok answer = 1

Test #65:

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

input:

56969

output:

POSSIBLE
56969 56969
56968 56966
56965 56965
56964 56968
56967 56967
56966 56964
56963 56963
56962 56960
56959 56959
56958 56962
56961 56961
56960 56958
56957 56957
56956 56954
56953 56953
56952 56956
56955 56955
56954 56952
56951 56951
56950 56948
56947 56947
56946 56950
56949 56949
56948 56946
569...

result:

ok answer = 1

Test #66:

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

input:

53401

output:

POSSIBLE
53401 53401
53400 53398
53397 53397
53396 53400
53399 53399
53398 53396
53395 53395
53394 53392
53391 53391
53390 53394
53393 53393
53392 53390
53389 53389
53388 53386
53385 53385
53384 53388
53387 53387
53386 53384
53383 53383
53382 53380
53379 53379
53378 53382
53381 53381
53380 53378
533...

result:

ok answer = 1

Test #67:

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

input:

24772

output:

POSSIBLE
24772 24772
24771 24769
24768 24768
24767 24771
24770 24770
24769 24767
24766 24766
24765 24763
24762 24762
24761 24765
24764 24764
24763 24761
24760 24760
24759 24757
24756 24756
24755 24759
24758 24758
24757 24755
24754 24754
24753 24751
24750 24750
24749 24753
24752 24752
24751 24749
247...

result:

ok answer = 1

Test #68:

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

input:

35433

output:

POSSIBLE
35433 35433
35432 35430
35429 35429
35428 35432
35431 35431
35430 35428
35427 35427
35426 35424
35423 35423
35422 35426
35425 35425
35424 35422
35421 35421
35420 35418
35417 35417
35416 35420
35419 35419
35418 35416
35415 35415
35414 35412
35411 35411
35410 35414
35413 35413
35412 35410
354...

result:

ok answer = 1

Test #69:

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

input:

89877

output:

POSSIBLE
89877 89877
89876 89874
89873 89873
89872 89876
89875 89875
89874 89872
89871 89871
89870 89868
89867 89867
89866 89870
89869 89869
89868 89866
89865 89865
89864 89862
89861 89861
89860 89864
89863 89863
89862 89860
89859 89859
89858 89856
89855 89855
89854 89858
89857 89857
89856 89854
898...

result:

ok answer = 1

Test #70:

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

input:

99986

output:

POSSIBLE
99986 99986
99985 99983
99982 99982
99981 99985
99984 99984
99983 99981
99980 99980
99979 99977
99976 99976
99975 99979
99978 99978
99977 99975
99974 99974
99973 99971
99970 99970
99969 99973
99972 99972
99971 99969
99968 99968
99967 99965
99964 99964
99963 99967
99966 99966
99965 99963
999...

result:

ok answer = 1

Test #71:

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

input:

6094

output:

POSSIBLE
6094 6094
6093 6091
6090 6090
6089 6093
6092 6092
6091 6089
6088 6088
6087 6085
6084 6084
6083 6087
6086 6086
6085 6083
6082 6082
6081 6079
6078 6078
6077 6081
6080 6080
6079 6077
6076 6076
6075 6073
6072 6072
6071 6075
6074 6074
6073 6071
6070 6070
6069 6067
6066 6066
6065 6069
6068 6068
6...

result:

ok answer = 1