QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#201620#5160. Kebab Pizzanameless_story#AC ✓35ms14304kbC++201.7kb2023-10-05 15:33:462023-10-05 15:33:47

Judging History

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

  • [2023-10-05 15:33:47]
  • 评测
  • 测评结果:AC
  • 用时:35ms
  • 内存:14304kb
  • [2023-10-05 15:33:46]
  • 提交

answer

#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
template<class T1,class T2> bool cmin(T1 &x,const T2 &y) { if (y<x) { x=y; return 1; }return 0; }
template<class T1,class T2> bool cmax(T1 &x,const T2 &y) { if (x<y) { x=y; return 1; }return 0; }
#define all(x) (x).begin(),(x).end()
int main()
{
	ios::sync_with_stdio(0); cin.tie(0);
	cout<<fixed<<setprecision(15);
	auto cal=[&]()
		{
			int n,m,i,j;
			cin>>m>>n;
			vector<pair<int,int>> eg;
			vector<int> single(n+1);
			while (m--)
			{
				int x,y;
				// cin>>x>>y;
				cin>>x>>y;
				if (x==y) single[x]=1;
				else
				{
					if (x>y) swap(x,y);
					eg.push_back({x,y});
				}
			}
			sort(all(eg)); eg.resize(unique(all(eg))-eg.begin());
			vector<int> cnt(n+1);
			for (auto [x,y]:eg) ++cnt[x],++cnt[y];
			vector e(n+1,vector<int>());
			vector<int> f(n+1);
			iota(all(f),0);
			function<int(int)> getf=[&](int u) { return f[u]==u?u:f[u]=getf(f[u]); };
			vector id(n+1,vector<int>());
			vector<int> sum(n+1);
			for (auto [x,y]:eg) if (cnt[x]+single[x]>1&&cnt[y]+single[y]>1)
			{
				e[x].push_back(y);
				e[y].push_back(x);
				f[getf(x)]=getf(y);
			}
			for (i=1; i<=n; i++) if (e[i].size()>=3) return 0;
			for (i=1; i<=n; i++) sum[getf(i)]+=e[i].size(),id[getf(i)].push_back(i);
			vector<int> loop;
			for (i=1; i<=n; i++) if (id[i].size()>1&&sum[i]==id[i].size()*2) loop.push_back(i);
			if (loop.size()>=2) return 0;
			if (loop.size()==1)
			{
				int x=loop[0];
				for (i=1; i<=n; i++) if ((e[i].size()||single[i])&&getf(i)!=x) return 0;
				int rt=x;
				for (auto [x,y]:eg) if (getf(x)!=rt&&getf(y)!=rt) return 0;
				return 1;
			}
			return 1;
		};
	if (cal()) cout<<"possible\n";
	else cout<<"impossible\n";
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

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

output:

possible

result:

ok single line: 'possible'

Test #2:

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

input:

5 5
1 3
1 5
2 3
2 5
3 4

output:

possible

result:

ok single line: 'possible'

Test #3:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #4:

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

input:

8 4
1 1
1 2
2 1
2 2
3 3
3 4
4 3
4 4

output:

possible

result:

ok single line: 'possible'

Test #5:

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

input:

4 4
1 2
2 1
3 4
4 3

output:

possible

result:

ok single line: 'possible'

Test #6:

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

input:

5 4
1 1
1 4
2 2
2 4
3 4

output:

possible

result:

ok single line: 'possible'

Test #7:

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

input:

6 4
1 1
1 4
2 2
2 4
3 3
3 4

output:

impossible

result:

ok single line: 'impossible'

Test #8:

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

input:

4 5
1 2
3 4
4 5
5 3

output:

impossible

result:

ok single line: 'impossible'

Test #9:

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

input:

4 4
1 1
2 3
3 4
4 2

output:

impossible

result:

ok single line: 'impossible'

Test #10:

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

input:

3 4
1 2
2 3
3 1

output:

possible

result:

ok single line: 'possible'

Test #11:

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

input:

4 3
1 2
2 3
3 1
1 2

output:

possible

result:

ok single line: 'possible'

Test #12:

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

input:

5 4
1 2
2 3
3 1
1 4
4 4

output:

impossible

result:

ok single line: 'impossible'

Test #13:

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

input:

4 3
1 2
2 3
3 1
1 1

output:

possible

result:

ok single line: 'possible'

Test #14:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #15:

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

input:

4 6
1 2
2 3
4 5
5 6

output:

possible

result:

ok single line: 'possible'

Test #16:

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

input:

4 8
1 2
3 4
5 6
7 8

output:

possible

result:

ok single line: 'possible'

Test #17:

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

input:

3 3
1 2
2 3
1 2

output:

possible

result:

ok single line: 'possible'

Test #18:

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

input:

13 11
11 7
8 6
4 8
1 2
6 7
6 2
2 9
3 8
11 8
6 11
8 2
9 1
9 11

output:

impossible

result:

ok single line: 'impossible'

Test #19:

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

input:

1635 131
40 13
22 72
98 70
81 118
124 122
90 12
24 5
86 61
45 75
91 80
14 1
28 74
84 27
120 83
75 117
44 130
127 38
58 64
22 17
12 48
107 87
37 131
41 15
11 48
5 46
127 50
123 75
43 124
93 5
17 83
26 130
66 122
55 105
36 119
116 49
98 89
73 86
119 99
16 24
39 90
33 72
94 22
19 13
101 9
116 8
33 95
8...

output:

impossible

result:

ok single line: 'impossible'

Test #20:

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

input:

1803 1766
967 1468
1305 1669
617 36
1564 714
53 1045
1536 80
467 373
375 1173
1750 210
1433 81
667 798
1345 825
274 85
1107 1425
1576 560
30 405
1324 129
612 332
506 1708
87 1587
337 891
503 786
1140 304
1439 966
841 234
1270 696
1557 1607
763 1422
196 461
1485 557
1509 44
511 1050
623 1587
687 1758...

output:

impossible

result:

ok single line: 'impossible'

Test #21:

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

input:

39505 78410
3175 40148
52846 78310
27128 59546
19323 44017
2534 68741
70302 1985
11003 6218
54155 11195
34079 21458
44804 11586
56941 46235
76524 20594
62563 17285
45626 5887
42683 63518
60306 151
25930 34002
19196 26270
3757 34394
60466 29619
32474 33236
59760 26098
11678 74638
51383 12205
16010 45...

output:

impossible

result:

ok single line: 'impossible'

Test #22:

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

input:

8364 43972
17102 14140
29056 23018
21282 40801
16760 27492
17370 13743
20137 31183
37298 39871
39916 31212
2472 25458
10766 38742
27020 14591
40426 32321
8831 30814
19561 2976
30423 21646
21760 2454
19103 43674
38828 43679
42838 37929
24460 3928
24227 35224
11041 27999
43445 11000
29465 16355
2591 2...

output:

impossible

result:

ok single line: 'impossible'

Test #23:

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

input:

62138 58240
56929 31261
38519 49289
3011 27909
9851 14304
38929 33991
48684 39971
18479 4049
22461 52271
20936 40010
7797 20153
44481 10183
14006 35620
30917 829
40099 53767
8041 16634
52764 57279
30667 3334
15542 23939
19932 25368
53529 51386
9452 45573
55315 41467
39172 3995
43732 4915
21116 28286...

output:

impossible

result:

ok single line: 'impossible'

Test #24:

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

input:

96147 6603
5405 3128
1267 2523
352 4758
3190 3000
1108 3762
2150 3562
3704 1748
5120 5883
1240 1219
731 6400
2477 6176
3583 474
562 3046
2864 730
1048 3532
4002 1102
3424 1197
3034 478
3828 1494
5543 5660
6478 4998
1650 2397
549 2073
3667 1440
266 4790
2118 4951
3993 3619
3383 6127
3748 6174
416 757...

output:

impossible

result:

ok single line: 'impossible'

Test #25:

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

input:

59974 62084
32353 28539
59280 13133
49252 34406
61223 21059
42029 57591
29291 9619
43338 58447
43639 4549
52967 11881
57304 46567
51189 42869
38788 9223
40539 8837
48395 28893
8002 40786
8531 48490
59796 34964
1120 1788
3282 26976
9492 14840
26847 20287
5078 50996
26323 42319
46119 339
38541 32471
2...

output:

impossible

result:

ok single line: 'impossible'

Test #26:

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

input:

66303 31218
11606 28363
6297 26839
14830 4154
7429 23837
8049 26652
19828 30249
25628 29398
25551 16332
9419 1805
22735 10642
26312 15045
22346 29624
28230 24039
5367 3575
12948 20105
22260 4125
20861 4699
19171 10016
14977 6636
29361 30501
2793 25021
17148 23728
623 20838
595 6709
26966 23795
15754...

output:

impossible

result:

ok single line: 'impossible'

Test #27:

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

input:

6 5
3 5
1 4
1 5
1 5
3 5
1 4

output:

possible

result:

ok single line: 'possible'

Test #28:

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

input:

57 33
29 3
3 3
15 3
3 15
10 9
9 10
9 3
3 29
9 10
9 9
15 3
3 29
10 9
3 3
3 3
9 9
9 10
3 3
9 16
9 9
3 3
10 9
15 3
3 3
9 9
9 16
9 3
3 3
9 3
3 3
3 3
3 29
3 9
3 15
3 3
9 9
3 3
3 3
3 3
3 3
3 29
3 3
16 9
16 9
3 3
29 3
9 9
3 15
3 3
3 3
3 3
9 16
29 3
3 15
9 10
29 3
3 15

output:

possible

result:

ok single line: 'possible'

Test #29:

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

input:

749 5820
4064 4001
100 3402
2357 1581
5035 706
3879 3357
123 4811
903 4490
1526 3240
2789 2743
5665 4251
4431 5665
2709 1238
521 5759
4251 44
2186 3391
3568 1309
3737 3145
268 2671
1404 2625
776 2307
2302 5521
4568 4568
85 4427
75 3592
5417 829
5723 3057
4276 2016
4602 1713
3910 819
3832 4519
2330 8...

output:

possible

result:

ok single line: 'possible'

Test #30:

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

input:

3959 28593
20802 427
10098 17983
7801 25453
15913 27977
6712 57
1968 8174
21031 15236
4992 572
24524 13948
9929 9033
26523 22817
25555 10087
16719 3570
2780 18164
6274 381
8503 14510
959 18943
9511 28334
6738 378
23560 681
27886 27479
27516 6213
19283 9299
22984 5750
8254 19879
16914 17851
4029 8313...

output:

possible

result:

ok single line: 'possible'

Test #31:

score: 0
Accepted
time: 26ms
memory: 12356kb

input:

99399 92859
74766 37233
74159 84535
20438 47217
43527 9495
59116 24081
49662 85445
75811 77418
12642 27876
7551 7551
2889 2889
89996 89996
58701 58701
73693 48184
86413 35809
27339 27339
30081 30081
38709 38709
32389 32389
78694 78694
26987 62008
17043 17043
51047 63444
61948 63760
46627 46627
39926...

output:

possible

result:

ok single line: 'possible'

Test #32:

score: 0
Accepted
time: 27ms
memory: 13728kb

input:

100000 100000
4221 70876
83659 82360
76546 57431
52984 13491
67093 50354
45696 47209
13834 5026
59591 84161
25767 45244
79549 5072
196 87287
71460 26849
93550 41510
47917 6692
58057 16111
6696 9732
98214 91644
33331 32910
7489 70817
79070 58308
8706 82959
19912 34565
72975 47825
67260 88349
94706 56...

output:

possible

result:

ok single line: 'possible'

Test #33:

score: 0
Accepted
time: 23ms
memory: 13216kb

input:

100000 100000
53179 52915
92061 59672
56992 61893
40554 30555
51405 43038
65334 65597
69856 64594
59785 59785
52126 52126
31300 64188
84340 36630
63678 89019
45826 70767
47398 47398
56062 66842
94919 55258
18178 69692
53167 53167
2648 80889
59802 31697
74133 98055
12886 12886
3805 3805
16087 46800
8...

output:

possible

result:

ok single line: 'possible'

Test #34:

score: 0
Accepted
time: 26ms
memory: 13288kb

input:

100000 100000
31056 80555
65441 71433
65418 54677
91147 91147
33844 9848
10076 77868
89769 76362
21472 88348
66457 4067
90111 90111
32499 68785
88280 33193
79700 43182
85714 85714
6709 72619
88551 13539
41307 64783
96732 54780
86940 86940
14464 29075
66020 85023
92411 98904
8411 8411
51335 51335
589...

output:

possible

result:

ok single line: 'possible'

Test #35:

score: 0
Accepted
time: 20ms
memory: 13436kb

input:

100000 100000
95643 55854
186 25072
39736 39736
2602 30302
80961 59862
50398 31158
70917 43140
57329 82139
66272 66272
43616 90400
34448 69555
14676 68886
78859 81700
22124 53819
99224 45205
7478 7478
37656 21473
3759 47797
95880 44158
84911 97469
32305 53104
5192 46635
20851 72284
41081 37627
1296 ...

output:

possible

result:

ok single line: 'possible'

Test #36:

score: 0
Accepted
time: 26ms
memory: 13404kb

input:

100000 100000
13652 8066
57875 83986
60259 52686
15011 43681
97556 56883
28237 37382
49822 11714
52975 50810
54450 95084
55797 64651
21013 63411
17970 83461
28037 35631
44818 40167
92343 1530
44999 21109
88067 52916
8889 62329
26372 99120
11166 45351
55793 17462
32165 64458
13073 28925
11289 58246
7...

output:

possible

result:

ok single line: 'possible'

Test #37:

score: 0
Accepted
time: 27ms
memory: 14304kb

input:

100000 100000
28485 8751
12468 12261
90763 52540
28147 6118
73685 98529
32123 8950
51701 43492
89381 95934
93326 13055
65300 52963
50890 84845
12414 38138
86361 80808
84808 3521
42619 49565
42782 38213
9508 80198
43384 64587
18322 48253
13436 16985
27847 32842
69004 86332
67720 36522
48614 4644
5034...

output:

possible

result:

ok single line: 'possible'

Test #38:

score: 0
Accepted
time: 31ms
memory: 14020kb

input:

100000 100000
17865 69589
90190 55859
42137 45223
91854 7713
14947 44267
67370 73576
97138 10121
24985 30145
86918 9116
78435 37640
65897 37795
70733 4242
106 4505
5622 95419
60676 35934
96927 97236
16678 45920
8786 52909
91730 28876
56005 20195
61983 24018
28541 46818
50680 99601
25390 25804
64479 ...

output:

impossible

result:

ok single line: 'impossible'

Test #39:

score: 0
Accepted
time: 31ms
memory: 14284kb

input:

99999 100000
99803 45557
30 31980
19990 3130
37327 55410
17415 8772
6136 93487
58811 9461
24619 92709
19179 42895
631 38137
86882 79876
77597 21400
41920 12379
73335 61668
52758 15520
96160 72339
27267 57077
5124 11754
58434 51951
66521 65944
71003 97070
66270 65598
40822 90093
10226 71145
88266 806...

output:

possible

result:

ok single line: 'possible'

Test #40:

score: 0
Accepted
time: 31ms
memory: 14020kb

input:

99998 100000
96376 2032
68858 34454
34647 97550
82255 72318
9233 30229
18908 89065
96686 10525
99933 15770
77683 93551
13302 37966
18222 2605
10653 11158
2737 33427
99090 61578
96274 5337
82030 44792
89357 27936
4434 74688
17566 54714
17807 34810
51027 75941
91997 95747
19912 63915
81632 80443
70013...

output:

possible

result:

ok single line: 'possible'

Test #41:

score: 0
Accepted
time: 32ms
memory: 13968kb

input:

99999 100000
84304 46412
31958 56493
72753 83643
35625 58986
73995 72435
59267 14592
24254 91413
44389 49724
24197 31183
69259 88768
95426 87755
36987 89205
29290 3029
5231 76110
59905 89067
51621 1695
51400 82722
46777 54962
40462 78458
47869 74129
61138 98722
51015 33999
58425 86378
51298 74126
86...

output:

impossible

result:

ok single line: 'impossible'

Test #42:

score: 0
Accepted
time: 31ms
memory: 14040kb

input:

99998 100000
28643 30750
38275 1364
52896 18840
84532 18666
15023 85347
66603 38546
50965 80117
2368 13055
31284 46820
50250 9491
33265 20894
88694 30828
16649 88218
96020 96780
8245 24246
15773 53950
63808 73174
69197 54137
92906 81492
53431 49499
82980 57606
3547 18633
30919 74768
7031 59614
96534...

output:

impossible

result:

ok single line: 'impossible'

Test #43:

score: 0
Accepted
time: 35ms
memory: 14264kb

input:

99999 100000
3944 59862
77156 3481
90138 41619
98931 16883
65022 82546
25937 1221
18804 21598
77052 44032
54156 28785
75575 21338
79909 42794
59487 83795
88229 83404
12177 20374
26344 87529
40185 18566
20178 37374
18930 58960
23380 22336
52823 86857
31840 76285
94592 81782
59532 26239
31651 1669
408...

output:

impossible

result:

ok single line: 'impossible'

Test #44:

score: 0
Accepted
time: 28ms
memory: 14276kb

input:

99998 100000
39260 89530
96198 36405
75550 43789
83773 69905
83278 45784
94222 37115
59527 64226
49413 39024
77886 79022
48645 53885
18821 33878
58260 73768
33966 96093
1704 91355
28963 89647
75674 42756
93334 21360
37439 20403
12392 16081
75359 64065
38908 70368
13140 40614
14536 13928
5483 21110
8...

output:

possible

result:

ok single line: 'possible'

Test #45:

score: 0
Accepted
time: 28ms
memory: 13896kb

input:

100000 99000
52549 29343
60087 53398
35615 80330
32492 27508
44619 33168
49816 35964
61958 54839
36937 54500
71998 61981
86285 4187
80281 18918
54827 49317
50624 80594
11609 84508
80449 80449
59304 43559
52041 17168
76323 90128
11472 76070
23799 7449
63555 13596
18496 26827
39678 89123
76055 32338
9...

output:

possible

result:

ok single line: 'possible'

Test #46:

score: 0
Accepted
time: 28ms
memory: 12880kb

input:

88443 88107
17714 4557
30971 81163
16284 24480
59830 7486
45808 24487
72033 16251
35412 77645
17552 73750
63925 75997
49388 48814
81780 56644
22603 68150
42517 20875
33202 45394
75154 88086
81443 34930
78377 39851
77174 87526
60866 18443
36908 14758
22025 63988
81981 32797
10191 75615
1620 44088
175...

output:

impossible

result:

ok single line: 'impossible'

Test #47:

score: 0
Accepted
time: 35ms
memory: 14024kb

input:

99999 99000
67827 72395
50468 10126
4874 6954
51742 84443
1638 57752
14288 96896
26702 12182
98557 81650
14578 10367
1894 53076
32116 3993
50713 53523
47112 59758
57454 91551
69066 24200
5545 50051
25005 16549
85150 53342
97701 61414
6030 54074
53509 35021
58720 62814
27184 93907
71881 11872
16751 2...

output:

possible

result:

ok single line: 'possible'

Test #48:

score: 0
Accepted
time: 31ms
memory: 13736kb

input:

99966 98968
60427 79201
52586 15916
87221 48688
85699 63867
44931 85309
78809 4865
20880 20880
49564 80082
4283 41832
93977 96259
49056 39808
935 28459
59360 64614
37821 47697
74611 84950
49394 32985
4857 92562
17717 84458
13310 76745
98416 38085
69097 55532
8858 93700
38990 83507
7048 76360
91857 5...

output:

possible

result:

ok single line: 'possible'

Test #49:

score: 0
Accepted
time: 32ms
memory: 14264kb

input:

99999 100000
9718 74460
82528 25609
82058 64889
69737 53172
10163 6383
10431 30718
58924 71607
83210 85966
68224 24015
69827 4852
66368 77953
24134 38872
7224 69350
85220 71056
24723 92025
97922 10713
12643 10672
45429 32438
861 29256
81312 95789
18732 72803
98336 33234
82437 12645
85078 86013
28086...

output:

possible

result:

ok single line: 'possible'

Test #50:

score: 0
Accepted
time: 29ms
memory: 14212kb

input:

100000 100000
62199 55258
7487 92899
12356 92995
31071 73054
99872 73388
26768 7605
81742 154
31916 68644
80767 50642
59599 49997
72683 7868
71816 68777
26848 50854
51041 13697
7847 68887
32619 90488
34374 57139
42468 52769
13134 52133
24049 10932
68178 1156
11071 60420
69128 92155
36710 19117
29417...

output:

impossible

result:

ok single line: 'impossible'

Test #51:

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

input:

100000 100000
23919 23919
75375 34411
12501 12501
16324 4296
97618 60524
50454 12823
2012 2012
87087 98640
3926 3926
56541 5104
95739 19160
80299 47746
98375 55074
83378 33246
58611 58611
27839 27839
54691 41182
77923 77923
10733 10733
90307 90307
10587 98312
76210 76210
44794 94365
44493 66105
3687...

output:

possible

result:

ok single line: 'possible'

Test #52:

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

input:

100000 100000
52761 52761
14946 14946
45586 45586
36780 36780
64961 64961
16008 16008
76708 76708
2413 2413
11610 11610
13437 13437
59684 59684
4709 4709
32283 32283
73413 73413
8070 8070
44960 44960
63802 63802
47911 47911
90236 90236
95669 95669
94355 94355
71930 71930
20803 20803
18712 18712
2074...

output:

possible

result:

ok single line: 'possible'

Test #53:

score: 0
Accepted
time: 26ms
memory: 13804kb

input:

92879 99237
47628 66662
43597 47998
83951 21603
65127 72564
16394 96243
88944 54920
81107 15464
72287 75865
64366 53732
61807 60056
32418 9098
57701 12006
51896 28533
78924 97256
79471 65838
75317 52559
41551 48482
38244 52643
68157 40637
4393 4393
23948 65175
79485 79485
10149 81493
38988 13266
613...

output:

possible

result:

ok single line: 'possible'

Test #54:

score: 0
Accepted
time: 26ms
memory: 13140kb

input:

99900 98602
64784 3758
66477 66372
63908 52079
57241 48379
28761 66169
2830 19939
75318 6034
22481 29256
85161 69061
1818 86478
39438 91896
12805 62513
82676 28442
29307 94369
83780 67377
85500 30979
56946 11348
96719 56152
90443 26904
31252 66748
96924 45755
86064 13144
47721 97783
54493 54098
8693...

output:

impossible

result:

ok single line: 'impossible'

Test #55:

score: 0
Accepted
time: 28ms
memory: 12148kb

input:

88449 88111
4604 73834
53497 15723
3829 35248
18599 29739
39584 55842
35804 60510
51293 30823
10193 64123
16841 15271
3882 17909
77551 31636
59747 39391
7930 6405
31630 76710
28400 23289
9303 80014
71787 65686
68562 20839
58394 37158
64998 58770
9798 60946
70979 17942
36914 14198
6109 83538
53971 34...

output:

impossible

result:

ok single line: 'impossible'

Test #56:

score: 0
Accepted
time: 31ms
memory: 12952kb

input:

99094 98314
3326 62842
6685 83006
41793 44136
8462 8346
4853 50689
14522 60208
63698 13247
1389 17849
80647 5357
72252 79118
1671 70194
32203 44762
49649 15918
93423 75591
53640 69069
78733 2061
10027 47264
46588 11810
93115 76111
67801 42445
71086 32913
50859 91742
74725 48645
55233 76218
3042 6798...

output:

impossible

result:

ok single line: 'impossible'

Test #57:

score: 0
Accepted
time: 27ms
memory: 12956kb

input:

99972 98972
76058 65987
26204 20858
20744 57047
58195 12238
53336 59191
40078 91059
61912 64452
82821 11146
68698 58920
74997 66041
17488 16255
98390 56907
41612 16195
32600 27906
59122 45104
84501 51264
5932 16152
25896 80391
5925 49247
91053 84387
43845 46743
53311 9643
37113 7857
65443 40730
7386...

output:

impossible

result:

ok single line: 'impossible'

Test #58:

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

input:

94899 92198
55149 55149
42841 42841
62438 54679
13604 88785
1914 1914
5858 5858
58134 37490
90217 90217
67901 67901
82534 82534
78716 91356
57773 68988
80162 80162
36411 59578
47955 35041
3979 3979
40813 78007
3051 3051
30111 30111
50858 50858
4115 42107
86641 64550
35203 35203
6975 35109
65043 1639...

output:

impossible

result:

ok single line: 'impossible'

Test #59:

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

input:

100000 100000
55655 55655
33218 33218
49103 49103
17493 17493
77342 77342
56814 56814
3411 3411
69018 69018
52587 52587
28363 28363
90768 90768
88868 88868
35793 35793
52337 52337
83350 83350
99889 99889
96467 96467
88716 88716
76989 76989
42553 42553
27927 27927
12649 12649
43048 43048
43889 43889
...

output:

impossible

result:

ok single line: 'impossible'

Test #60:

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

input:

92885 99241
65835 66103
73207 73207
64753 61808
80766 94148
32961 43555
73222 45810
47592 25546
54542 24403
97006 97183
60515 1796
68276 75788
79262 81166
87706 49028
23849 23849
20364 7698
71362 40999
75410 75410
20246 89772
23969 877
45259 91635
35796 11632
32895 79748
17679 56122
89890 63614
6507...

output:

impossible

result:

ok single line: 'impossible'

Test #61:

score: 0
Accepted
time: 19ms
memory: 4868kb

input:

99681 447
331 80
379 25
12 319
67 210
110 230
433 33
32 280
244 28
444 389
252 8
437 4
167 79
254 295
187 409
73 333
28 355
23 361
155 11
307 382
144 136
201 139
55 208
333 405
127 282
60 96
206 25
321 17
276 81
60 240
200 430
326 83
111 53
256 88
406 159
388 395
160 261
353 402
362 52
40 316
78 101...

output:

impossible

result:

ok single line: 'impossible'

Test #62:

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

input:

99856 316
303 179
240 211
177 189
244 111
150 18
282 110
299 93
13 234
42 171
190 306
35 141
63 48
273 278
106 116
228 196
238 83
260 12
197 106
134 109
316 90
79 229
263 17
174 302
227 191
58 200
257 21
283 240
107 204
120 29
163 111
174 308
282 289
270 61
41 283
250 4
86 156
22 75
89 226
107 150
1...

output:

impossible

result:

ok single line: 'impossible'

Test #63:

score: 0
Accepted
time: 22ms
memory: 10252kb

input:

99933 85539
67373 81841
33921 2375
49742 5082
31976 24349
72858 70705
50661 79570
67362 63249
79524 1181
45829 33858
55134 5206
1764 38572
54066 72426
80387 67362
16516 73600
68551 23052
9642 4053
68429 5391
23068 48159
38743 67016
5915 2192
81039 68923
62467 25867
79524 9788
38743 55248
380 41788
5...

output:

impossible

result:

ok single line: 'impossible'

Test #64:

score: 0
Accepted
time: 21ms
memory: 9508kb

input:

99457 80057
67560 23480
79074 15654
67781 15078
70655 71340
3342 656
72635 52225
45040 75473
30687 72635
76221 41130
71099 59992
6759 75916
77204 44716
38958 59967
28510 32907
80009 6335
77621 64309
51174 75484
38269 44740
8273 75473
1679 28995
78774 49993
71099 49467
62739 53314
19081 10036
64169 7...

output:

impossible

result:

ok single line: 'impossible'

Test #65:

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

input:

5 4
1 2
3 1
4 4
3 1
3 2

output:

impossible

result:

ok single line: 'impossible'

Test #66:

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

input:

4 5
2 1
3 2
1 3
5 5

output:

impossible

result:

ok single line: 'impossible'

Test #67:

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

input:

11 7
5 4
7 7
3 2
4 4
4 4
7 1
6 4
4 7
6 2
6 4
1 1

output:

possible

result:

ok single line: 'possible'

Test #68:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #69:

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

input:

7 4
4 2
1 3
3 3
3 1
3 3
1 3
2 2

output:

possible

result:

ok single line: 'possible'

Test #70:

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

input:

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

output:

possible

result:

ok single line: 'possible'

Test #71:

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

input:

19 10
3 3
3 3
3 3
3 3
3 8
3 3
3 3
3 2
3 3
3 3
3 3
3 2
3 3
3 3
3 8
3 3
2 3
3 3
2 2

output:

possible

result:

ok single line: 'possible'

Test #72:

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

input:

12 6
1 4
6 5
5 6
1 1
2 5
5 5
1 2
3 4
5 5
1 5
5 5
5 1

output:

impossible

result:

ok single line: 'impossible'

Test #73:

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

input:

22 7
4 4
5 2
7 7
6 6
5 5
3 6
4 3
5 5
5 5
7 7
7 4
5 5
3 4
5 5
4 4
7 4
3 3
5 7
3 3
7 7
7 7
7 7

output:

possible

result:

ok single line: 'possible'

Test #74:

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

input:

13 10
4 9
6 1
6 5
2 10
4 10
3 8
4 4
5 8
1 3
9 9
10 2
1 2
6 9

output:

impossible

result:

ok single line: 'impossible'

Test #75:

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

input:

6 9
8 9
9 2
7 5
8 7
9 8
7 8

output:

possible

result:

ok single line: 'possible'

Test #76:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #77:

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

input:

17 8
8 1
1 7
1 1
5 6
6 5
7 7
5 5
4 8
8 1
5 7
5 5
6 6
6 8
1 1
7 1
6 5
6 1

output:

impossible

result:

ok single line: 'impossible'

Test #78:

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

input:

12 8
5 5
3 8
6 8
4 1
4 4
5 8
7 3
3 4
5 1
7 7
6 7
8 8

output:

impossible

result:

ok single line: 'impossible'

Test #79:

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

input:

12 7
7 6
2 6
5 6
1 7
4 5
5 1
5 5
7 7
5 4
2 2
2 3
3 5

output:

impossible

result:

ok single line: 'impossible'

Test #80:

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

input:

14 6
3 5
5 6
6 2
5 1
5 1
5 5
5 5
5 3
5 5
5 3
5 1
1 5
5 3
5 5

output:

possible

result:

ok single line: 'possible'

Test #81:

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

input:

5 3
2 1
2 1
1 3
3 1
1 3

output:

possible

result:

ok single line: 'possible'

Test #82:

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

input:

9 4
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 1

output:

possible

result:

ok single line: 'possible'

Test #83:

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

input:

10 3
1 3
2 3
3 1
2 3
2 3
3 2
2 3
1 3
3 3
3 2

output:

possible

result:

ok single line: 'possible'

Test #84:

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

input:

24 9
2 2
2 2
2 2
2 2
2 8
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 2
2 7
2 2
2 2
2 2
2 2
2 2
2 2

output:

possible

result:

ok single line: 'possible'

Test #85:

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

input:

10 9
9 9
7 8
9 9
9 8
7 8
7 8
3 6
9 9
7 3
1 2

output:

possible

result:

ok single line: 'possible'

Test #86:

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

input:

9 3
2 2
1 2
1 1
2 2
2 3
1 3
1 1
3 2
3 3

output:

possible

result:

ok single line: 'possible'

Test #87:

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

input:

7 5
1 4
2 1
2 3
2 4
2 3
3 1
4 5

output:

impossible

result:

ok single line: 'impossible'

Test #88:

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

input:

10 7
7 3
5 1
5 3
4 6
1 4
4 5
4 7
6 2
4 3
6 3

output:

impossible

result:

ok single line: 'impossible'

Test #89:

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

input:

15 10
7 10
5 3
3 3
8 10
4 8
8 4
9 1
4 4
3 4
6 8
3 3
7 7
10 6
4 5
10 5

output:

impossible

result:

ok single line: 'impossible'

Test #90:

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

input:

18 8
5 5
5 5
3 3
6 3
3 3
6 1
4 4
5 5
5 6
3 8
3 3
6 1
3 8
4 7
6 3
3 3
3 3
6 3

output:

possible

result:

ok single line: 'possible'

Test #91:

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

input:

9 6
4 4
2 4
5 5
1 5
5 5
5 4
6 5
5 5
4 1

output:

possible

result:

ok single line: 'possible'

Test #92:

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

input:

8 4
2 1
1 3
3 4
1 1
2 4
4 4
1 2
4 4

output:

possible

result:

ok single line: 'possible'

Test #93:

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

input:

11 3
2 1
3 3
1 1
2 1
2 2
3 3
2 2
3 3
3 1
3 3
3 3

output:

possible

result:

ok single line: 'possible'

Test #94:

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

input:

8 7
1 1
2 1
4 5
1 5
1 1
1 1
1 2
2 5

output:

possible

result:

ok single line: 'possible'

Test #95:

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

input:

16 7
7 2
1 4
7 2
2 7
6 4
7 6
7 6
4 1
2 4
5 1
2 2
2 2
2 4
6 2
5 3
6 7

output:

impossible

result:

ok single line: 'impossible'

Test #96:

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

input:

19 6
6 4
4 2
2 5
2 5
6 6
1 1
4 6
2 1
1 1
1 1
3 3
6 5
5 1
5 2
6 5
1 4
1 1
2 5
1 1

output:

impossible

result:

ok single line: 'impossible'

Test #97:

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

input:

7 3
2 2
3 1
2 2
3 3
2 1
2 1
2 3

output:

possible

result:

ok single line: 'possible'

Test #98:

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

input:

13 5
5 1
1 1
4 5
1 1
1 5
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 2

output:

possible

result:

ok single line: 'possible'

Test #99:

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

input:

28 9
6 6
6 6
3 4
6 6
6 6
4 4
2 2
4 4
6 6
6 6
6 6
4 4
2 2
4 4
2 2
6 6
6 6
6 2
4 4
6 6
2 2
2 2
4 4
6 6
4 4
4 4
2 4
6 2

output:

possible

result:

ok single line: 'possible'

Test #100:

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

input:

17 6
6 6
5 5
6 3
5 5
5 6
6 6
5 6
6 6
5 5
1 5
5 5
6 3
2 5
6 6
6 5
5 5
5 5

output:

possible

result:

ok single line: 'possible'

Test #101:

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

input:

10 4
2 2
2 4
2 2
2 2
2 2
2 4
2 4
2 2
2 1
3 2

output:

possible

result:

ok single line: 'possible'

Test #102:

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

input:

8 4
2 1
4 3
4 2
1 3
1 2
2 4
2 1
2 1

output:

possible

result:

ok single line: 'possible'

Test #103:

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

input:

5 7
5 5
1 5
1 5
2 7
2 6

output:

possible

result:

ok single line: 'possible'

Test #104:

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

input:

15 7
2 2
2 6
2 3
2 2
2 2
2 2
6 1
2 2
4 4
4 2
2 2
2 2
2 2
5 3
2 7

output:

impossible

result:

ok single line: 'impossible'

Test #105:

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

input:

4 4
3 1
1 3
2 4
1 3

output:

possible

result:

ok single line: 'possible'

Test #106:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #107:

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

input:

4 5
4 2
2 2
2 4
4 2

output:

possible

result:

ok single line: 'possible'

Test #108:

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

input:

10 3
2 2
2 2
1 1
2 2
2 1
1 1
2 3
1 1
3 1
3 1

output:

possible

result:

ok single line: 'possible'

Test #109:

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

input:

27 9
4 4
3 3
4 4
4 3
4 4
3 1
3 3
4 4
5 4
3 4
1 1
3 3
5 9
3 3
4 4
1 4
3 3
6 3
4 3
8 4
7 4
3 3
4 4
4 4
3 3
4 4
3 3

output:

impossible

result:

ok single line: 'impossible'

Test #110:

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

input:

4 4
1 3
2 1
1 3
1 3

output:

possible

result:

ok single line: 'possible'

Test #111:

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

input:

18 5
4 2
3 1
4 3
4 4
3 1
2 2
3 4
5 1
4 4
5 3
4 4
1 5
2 3
5 1
2 1
4 2
2 3
4 4

output:

impossible

result:

ok single line: 'impossible'

Test #112:

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

input:

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

output:

possible

result:

ok single line: 'possible'

Test #113:

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

input:

11 5
3 2
5 5
5 2
2 2
2 2
2 5
2 3
2 2
2 4
5 5
2 2

output:

possible

result:

ok single line: 'possible'

Test #114:

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

input:

7 9
5 1
8 6
3 8
3 9
3 7
8 5
1 9

output:

possible

result:

ok single line: 'possible'

Test #115:

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

input:

23 8
3 3
3 3
3 3
3 3
3 3
3 3
3 3
5 3
3 3
5 3
4 8
1 3
3 3
3 3
3 2
3 3
3 3
3 3
5 3
3 3
3 4
4 3
2 3

output:

possible

result:

ok single line: 'possible'

Test #116:

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

input:

16 7
3 3
3 1
2 7
3 2
4 5
3 6
2 2
7 7
1 2
3 5
2 2
7 7
3 1
4 7
3 3
3 5

output:

impossible

result:

ok single line: 'impossible'

Test #117:

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

input:

6 8
8 7
7 8
7 6
2 1
1 6
8 1

output:

possible

result:

ok single line: 'possible'

Test #118:

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

input:

3 4
2 2
2 2
2 2

output:

possible

result:

ok single line: 'possible'

Test #119:

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

input:

13 5
5 4
4 3
4 5
4 2
1 3
2 4
5 4
1 3
4 4
3 1
4 4
4 3
4 4

output:

possible

result:

ok single line: 'possible'

Test #120:

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

input:

22 9
6 6
7 4
5 6
2 2
2 7
5 5
7 7
5 5
2 2
1 1
1 5
8 8
7 7
8 8
8 2
4 6
6 6
6 6
2 2
7 7
1 8
6 6

output:

possible

result:

ok single line: 'possible'

Test #121:

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

input:

8 5
5 2
5 3
4 4
2 4
5 5
1 3
1 5
4 1

output:

impossible

result:

ok single line: 'impossible'

Test #122:

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

input:

13 4
4 4
4 4
4 4
3 3
1 3
3 4
2 4
3 1
4 4
3 3
3 4
4 4
4 4

output:

possible

result:

ok single line: 'possible'

Test #123:

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

input:

18 9
3 8
4 4
9 7
9 6
6 6
4 4
8 8
2 9
2 9
4 4
2 2
4 4
4 7
4 8
1 2
2 4
6 6
4 4

output:

impossible

result:

ok single line: 'impossible'

Test #124:

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

input:

11 9
9 8
5 2
1 9
5 4
6 9
3 9
9 5
4 2
3 1
8 4
1 6

output:

impossible

result:

ok single line: 'impossible'

Test #125:

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

input:

13 5
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1
1 1

output:

possible

result:

ok single line: 'possible'

Test #126:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #127:

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

input:

22 7
6 6
5 5
3 3
5 6
2 7
2 4
5 5
5 7
5 7
4 2
1 1
3 2
4 1
3 6
7 1
1 4
4 5
1 1
5 6
1 4
2 1
7 5

output:

impossible

result:

ok single line: 'impossible'

Test #128:

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

input:

7 5
5 2
5 2
3 5
2 4
2 4
5 4
4 1

output:

possible

result:

ok single line: 'possible'

Test #129:

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

input:

15 5
3 4
2 4
3 2
3 2
2 4
2 4
2 3
3 4
2 3
2 4
2 4
3 4
4 3
2 3
2 3

output:

possible

result:

ok single line: 'possible'

Test #130:

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

input:

11 4
1 1
4 2
4 2
1 1
2 2
2 2
3 2
4 1
1 1
1 1
1 2

output:

possible

result:

ok single line: 'possible'

Test #131:

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

input:

20 5
3 3
3 3
4 4
1 1
2 4
4 4
3 3
1 1
3 3
4 4
1 3
5 3
4 4
2 4
1 4
1 1
5 5
3 3
4 5
5 1

output:

impossible

result:

ok single line: 'impossible'

Test #132:

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

input:

16 5
5 5
5 2
3 3
4 1
1 5
3 2
1 2
1 1
1 1
3 3
1 1
4 4
1 2
4 3
2 3
4 5

output:

impossible

result:

ok single line: 'impossible'

Test #133:

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

input:

7 3
2 3
2 1
2 2
1 2
2 2
2 2
2 2

output:

possible

result:

ok single line: 'possible'

Test #134:

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

input:

10 4
2 3
4 2
2 2
2 2
2 1
3 4
2 2
2 2
4 2
2 2

output:

possible

result:

ok single line: 'possible'

Test #135:

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

input:

9 5
2 2
3 2
3 1
3 3
5 3
3 5
2 2
3 4
2 3

output:

possible

result:

ok single line: 'possible'

Test #136:

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

input:

9 6
4 1
4 3
4 4
4 3
4 3
1 3
4 3
3 1
1 3

output:

possible

result:

ok single line: 'possible'

Test #137:

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

input:

26 10
3 3
5 6
3 3
3 3
2 2
3 3
3 8
10 4
6 5
5 6
9 9
2 2
10 4
1 2
8 3
5 6
8 8
6 6
8 8
8 8
8 8
8 3
9 2
6 8
9 4
1 3

output:

possible

result:

ok single line: 'possible'

Test #138:

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

input:

26 9
7 7
6 6
9 5
9 9
9 9
6 6
5 5
9 9
5 5
7 7
8 5
7 7
8 6
9 9
9 9
6 7
6 7
7 7
5 5
9 9
4 9
7 7
7 7
7 9
6 6
7 7

output:

possible

result:

ok single line: 'possible'

Test #139:

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

input:

19 9
8 5
9 9
6 8
4 9
9 4
3 6
8 5
1 9
6 6
8 6
6 6
6 7
4 9
8 3
6 3
6 3
9 8
6 8
6 7

output:

impossible

result:

ok single line: 'impossible'

Test #140:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #141:

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

input:

5 3
1 3
1 1
2 1
3 1
2 1

output:

possible

result:

ok single line: 'possible'

Test #142:

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

input:

5 3
3 3
3 1
2 2
2 3
2 2

output:

possible

result:

ok single line: 'possible'

Test #143:

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

input:

30 10
6 6
2 8
1 6
3 7
5 5
5 5
10 8
9 6
10 9
1 1
6 6
6 6
7 7
10 1
5 7
5 5
5 5
9 9
9 10
1 7
2 8
1 1
10 8
9 10
2 5
5 5
6 1
9 10
6 6
7 5

output:

impossible

result:

ok single line: 'impossible'

Test #144:

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

input:

9 4
2 4
3 1
4 2
1 4
2 3
2 3
2 3
4 1
4 2

output:

possible

result:

ok single line: 'possible'

Test #145:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #146:

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

input:

7 4
3 4
4 3
2 2
2 3
1 1
1 1
2 3

output:

possible

result:

ok single line: 'possible'

Test #147:

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

input:

11 3
3 1
1 1
2 1
3 3
1 1
1 3
3 1
2 2
2 1
1 1
1 1

output:

possible

result:

ok single line: 'possible'

Test #148:

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

input:

27 10
5 10
3 1
4 7
4 7
3 1
10 7
3 1
10 7
4 7
10 7
6 3
3 1
10 5
3 1
7 4
4 7
4 5
3 1
3 1
5 10
3 6
7 4
5 10
5 10
9 10
5 10
3 6

output:

impossible

result:

ok single line: 'impossible'

Test #149:

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

input:

13 7
3 3
5 5
4 6
6 4
1 2
7 6
3 6
6 6
6 5
6 5
7 5
3 5
6 2

output:

impossible

result:

ok single line: 'impossible'

Test #150:

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

input:

10 6
2 1
5 3
6 3
3 6
3 5
4 4
1 3
4 6
5 4
6 3

output:

impossible

result:

ok single line: 'impossible'

Test #151:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #152:

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

input:

13 10
1 6
9 10
9 1
7 3
7 9
3 3
4 1
3 10
8 10
3 10
1 4
10 4
1 8

output:

impossible

result:

ok single line: 'impossible'

Test #153:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #154:

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

input:

11 4
3 3
2 2
2 2
2 1
1 1
3 3
3 1
2 2
3 3
3 3
3 1

output:

possible

result:

ok single line: 'possible'

Test #155:

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

input:

9 6
3 3
5 3
3 3
2 3
3 3
5 3
3 2
3 5
5 3

output:

possible

result:

ok single line: 'possible'

Test #156:

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

input:

10 7
3 5
4 5
2 2
2 7
1 3
3 3
3 3
5 5
3 5
6 7

output:

possible

result:

ok single line: 'possible'

Test #157:

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

input:

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

output:

possible

result:

ok single line: 'possible'

Test #158:

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

input:

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

output:

possible

result:

ok single line: 'possible'

Test #159:

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

input:

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

output:

impossible

result:

ok single line: 'impossible'

Test #160:

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

input:

14 7
1 3
2 7
4 4
2 3
4 3
3 3
7 6
3 3
5 6
4 4
3 3
1 1
1 6
4 3

output:

impossible

result:

ok single line: 'impossible'

Test #161:

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

input:

15 5
3 1
3 5
2 4
4 2
5 3
1 3
3 5
4 1
4 1
4 2
5 2
5 3
3 5
3 1
5 3

output:

possible

result:

ok single line: 'possible'

Test #162:

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

input:

10 3
1 2
3 3
3 3
3 3
3 3
3 3
1 3
3 3
3 3
3 3

output:

possible

result:

ok single line: 'possible'

Test #163:

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

input:

12 6
5 1
5 4
3 1
4 6
1 3
4 3
2 4
2 4
2 6
4 5
3 3
5 6

output:

impossible

result:

ok single line: 'impossible'

Test #164:

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

input:

8 5
4 4
4 5
3 2
5 4
4 3
5 2
4 4
3 2

output:

possible

result:

ok single line: 'possible'

Test #165:

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

input:

6 10
9 3
8 8
2 8
10 3
2 7
8 7

output:

impossible

result:

ok single line: 'impossible'

Test #166:

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

input:

14 7
1 4
5 1
6 1
7 7
6 6
6 6
7 2
4 4
7 2
3 2
3 2
7 7
1 4
6 5

output:

impossible

result:

ok single line: 'impossible'