QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#455845#5239. Mędrcy [A]JohnAlfnov0 137ms8072kbC++141.9kb2024-06-26 21:32:382024-06-26 21:32:39

Judging History

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

  • [2024-06-26 21:32:39]
  • 评测
  • 测评结果:0
  • 用时:137ms
  • 内存:8072kb
  • [2024-06-26 21:32:38]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int n,m,k;
int mp[1005][1005];
int vist[1005],deg[1005];
vector<int>g[1005];
int an,ans[1005];
int aa[1005],ac[1005];
int ab[1005],vv[1005],ba;
void dfss(int x){
	ab[++ba]=x;vv[x]=1;
	for(auto cu:g[x]){
		if(vv[cu])continue;
		dfss(cu);
	}
}
void dfs(int z){
	if(z<0)return;
	int mx=-1,wz=0;
	for(int i=1;i<=n;++i)if(!vist[i]){
		if(mx<deg[i])mx=deg[i],wz=i;
	}
	if(mx<=2){
		for(int i=1;i<=n;++i)vv[i]=vist[i],ac[i]=aa[i];
		int he=0;
		for(int i=1;i<=n;++i)if(!vv[i]&&deg[i]==1){
			ba=0;dfss(i);
			he+=ba/2;
			if(ba%2)for(int j=2;j<=ba;j+=2)ac[ab[j]]=1;
			else for(int j=1;j<=ba;++j)ac[ab[j]]=1;
		}
		for(int i=1;i<=n;++i)if(!vv[i]&&deg[i]==2){
			ba=0;dfss(i);
			he+=(ba+1)/2;
			for(int j=1;j<=ba;++j)ac[ab[j]]=1;
		}
		if(z<he)return;
		int na=k-(z-he);
		if(an>na){
			an=na;
			for(int i=1;i<=n;++i)ans[i]=0;
		}
		if(an==na){
			for(int i=1;i<=n;++i)ans[i]|=ac[i];
		}
		return;
	}
	vist[wz]=1;aa[wz]=1;
	for(auto cu:g[wz])if(!vist[cu])--deg[cu];
	dfs(z-1);
	vist[wz]=0;aa[wz]=0;
	for(auto cu:g[wz])if(!vist[cu])++deg[cu];
	vist[wz]=1;
	int gs=0;
	vector<int>vc;
	for(auto cu:g[wz])if(!vist[cu]){
		++gs;
		vist[cu]=1;aa[cu]=1;--deg[cu];
		vc.emplace_back(cu);
	}
	dfs(z-gs);
	vist[wz]=0;
	for(auto cu:vc){
		vist[cu]=0;aa[cu]=0;++deg[cu];
	}
}
int main(){
	int T;
	scanf("%d",&T);
	while(T--){
		scanf("%d%d%d",&n,&m,&k);
		for(int i=1;i<=n;++i)vist[i]=0,deg[i]=0,aa[i]=0,g[i].clear();
		for(int i=1;i<n;++i)for(int j=i+1;j<=n;++j)mp[i][j]=0;
		for(int i=1;i<=m;++i){
			int a,b;
			scanf("%d%d",&a,&b);
			if(mp[a][b])continue;
			mp[a][b]=1;
			++deg[a],++deg[b];
			g[a].emplace_back(b);
			g[b].emplace_back(a);
		}
		an=k+1;
		dfs(k);
		if(an>k)puts("-1");
		else{
			int he=0;
			for(int i=1;i<=n;++i)he+=ans[i];
			printf("%d %d\n",an,he);
			for(int i=1;i<=n;++i)if(ans[i])printf("%d ",i);
			printf("\n");
		}
	}
	return 0;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3776kb

input:

136
9 37 11
2 7
2 5
2 5
6 8
2 4
2 9
4 5
6 8
6 7
3 9
3 6
3 8
1 9
2 9
4 6
2 4
1 4
7 9
7 9
4 7
3 6
4 5
2 7
1 5
6 9
4 9
4 5
2 7
3 9
1 9
2 7
5 7
1 2
2 3
1 8
3 8
1 3
7 1 13
4 6
3 36 2
2 3
2 3
1 2
2 3
1 3
1 3
1 3
1 2
1 2
1 2
1 2
1 2
1 3
1 2
1 3
1 3
1 2
1 3
1 2
1 3
1 2
2 3
1 2
1 3
1 3
2 3
1 3
2 3
2 3
1 2
1 ...

output:

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

result:

wrong answer 9th lines differ - expected: '5 5', found: '6 9'

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 1ms
memory: 3920kb

input:

139
11 16 6
3 4
1 3
5 7
3 6
3 9
7 10
3 8
1 2
4 8
1 11
4 8
4 9
3 6
4 9
5 9
1 6
8 23 11
2 4
4 8
3 6
4 5
1 3
5 7
3 8
2 5
1 6
1 5
5 8
6 7
1 3
3 5
6 7
7 8
6 8
5 8
4 6
4 8
2 3
1 5
2 8
11 31 1
5 11
3 11
5 7
1 9
3 5
3 5
1 2
1 5
5 7
9 10
2 6
2 7
2 9
5 9
1 11
5 8
4 8
5 6
4 10
3 10
2 9
7 11
5 9
2 6
8 9
9 10
8 ...

output:

5 8
1 3 4 5 7 8 9 10 
5 7
1 2 3 4 5 6 8 
-1
-1
7 7
2 6 7 8 9 10 11 
5 5
1 3 4 6 8 
4 5
2 3 4 5 6 
-1
1 1
10 
2 3
1 2 3 
2 4
5 6 9 10 
-1
4 5
1 2 3 4 5 
4 4
1 4 5 6 
3 4
1 2 3 4 
7 10
1 2 3 4 5 6 7 8 9 11 
2 3
1 2 3 
3 3
1 4 5 
3 4
2 3 4 5 
2 3
1 2 3 
-1
2 4
1 2 3 7 
6 8
1 2 3 5 7 8 9 10 
5 8
1 2 3 5...

result:

wrong answer 40th lines differ - expected: '6 10', found: '6 8'

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 1ms
memory: 4068kb

input:

66
20 51 30
2 4
5 8
19 20
10 11
7 12
1 20
5 13
12 14
13 15
11 14
4 5
9 16
14 15
5 9
6 14
5 6
3 16
9 18
6 8
14 19
7 8
12 15
8 17
11 14
4 9
11 20
2 13
3 18
5 20
11 13
13 18
3 17
15 20
8 13
4 10
1 6
3 5
7 8
12 14
2 20
4 15
3 20
8 9
3 20
2 16
3 10
2 7
5 19
3 8
8 20
7 10
15 58 30
7 15
8 13
3 13
3 8
4 8
1...

output:

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

result:

wrong answer 1st lines differ - expected: '12 17', found: '12 15'

Subtask #4:

score: 0
Wrong Answer

Test #36:

score: 0
Wrong Answer
time: 0ms
memory: 3888kb

input:

67
11 28 30
1 7
1 5
4 11
1 2
2 10
9 11
8 9
7 9
4 8
4 9
5 8
5 7
5 8
2 11
8 10
1 3
2 11
5 8
2 4
7 10
8 11
6 11
2 4
2 11
1 6
10 11
8 11
3 8
10 44 30
5 8
1 4
1 4
3 9
1 4
6 7
3 8
6 7
4 8
4 6
1 2
4 7
1 8
1 5
9 10
2 10
7 8
2 8
1 9
1 5
5 10
1 7
4 6
7 10
2 5
4 8
6 8
8 9
7 10
6 10
4 10
3 5
2 9
6 10
4 8
5 10
5...

output:

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

result:

wrong answer 9th lines differ - expected: '9 13', found: '9 12'

Subtask #5:

score: 0
Wrong Answer

Test #47:

score: 0
Wrong Answer
time: 1ms
memory: 3852kb

input:

64
16 32 30
8 13
8 11
5 12
3 10
3 8
6 15
12 13
5 7
1 2
8 14
2 4
8 16
14 15
3 13
6 9
1 11
4 8
15 16
9 12
10 16
4 8
4 5
3 6
3 15
6 14
5 11
3 11
1 15
4 15
6 13
8 14
7 13
15 42 30
1 4
5 13
12 13
9 12
4 9
10 11
9 11
5 6
2 6
3 11
5 14
8 11
4 7
1 15
6 14
2 14
4 11
1 5
6 8
1 7
1 5
9 14
7 15
7 8
5 7
3 9
12 1...

output:

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

result:

wrong answer 1st lines differ - expected: '9 10', found: '10 15'

Subtask #6:

score: 0
Wrong Answer

Test #58:

score: 0
Wrong Answer
time: 26ms
memory: 3892kb

input:

32
23 77 30
4 18
1 20
11 20
6 22
7 18
2 17
10 14
3 6
15 22
3 13
14 17
4 16
14 23
1 10
9 14
6 20
4 9
11 16
20 22
5 13
3 23
8 20
2 16
12 16
5 20
1 19
3 8
9 17
15 21
18 23
1 6
3 16
2 6
16 22
16 22
6 15
14 21
4 22
12 19
10 21
2 18
1 10
15 22
7 20
6 19
13 22
5 16
7 22
21 23
14 15
5 16
11 20
10 16
18 19
5...

output:

13 14
2 3 6 9 10 13 14 16 17 18 19 20 21 22 
12 13
1 3 6 7 9 10 11 14 15 16 17 19 20 
25 37
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 
19 20
1 2 3 4 5 6 7 10 11 12 15 16 18 19 21 22 24 25 26 29 
19 22
1 3 4 5 6 8 9 10 11 12 15 16 17 18 20 2...

result:

wrong answer 3rd lines differ - expected: '12 14', found: '12 13'

Subtask #7:

score: 0
Wrong Answer

Test #78:

score: 0
Wrong Answer
time: 15ms
memory: 3936kb

input:

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

output:

12 12
1 2 3 5 7 10 11 12 16 17 18 20 
17 24
1 2 3 4 5 6 7 8 10 11 12 13 15 16 19 20 21 22 24 25 26 27 28 29 
17 20
1 2 3 5 6 7 8 10 11 12 14 15 16 17 18 19 20 22 23 24 
21 30
1 4 5 6 7 8 9 11 14 15 17 19 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 
17 28
1 4 5 6 7 8 9 10 11 12 15 16 17 18 ...

result:

wrong answer 1st lines differ - expected: '12 15', found: '12 12'

Subtask #8:

score: 0
Wrong Answer

Test #97:

score: 1
Accepted
time: 2ms
memory: 7936kb

input:

1
1000 3000 30
82 508
127 347
370 658
350 586
486 863
28 99
293 422
427 710
731 936
555 856
91 374
133 676
351 806
780 992
132 686
73 813
212 971
161 919
402 666
59 106
682 766
288 570
199 882
332 428
633 693
306 694
319 882
356 582
546 916
305 665
336 534
608 901
222 228
422 860
406 869
457 524
114...

output:

-1

result:

ok single line: '-1'

Test #98:

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

input:

1
1000 3000 30
266 447
201 576
363 986
110 318
382 520
182 339
5 235
676 781
736 919
396 814
265 779
677 862
67 354
154 603
440 751
642 911
422 642
23 154
110 861
167 400
316 619
778 789
461 668
621 677
339 419
154 248
354 550
398 701
73 940
461 829
547 923
643 986
339 985
110 901
96 461
560 856
552...

output:

30 30
73 110 154 167 178 201 235 265 266 316 339 354 396 398 432 440 461 520 560 565 581 642 677 761 778 781 873 919 923 986 

result:

ok 2 lines

Test #99:

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

input:

1
1000 3000 30
644 655
62 723
103 222
738 939
567 903
47 644
281 383
450 498
115 414
487 502
173 383
115 515
596 886
27 712
191 200
392 769
218 940
117 304
86 861
427 511
16 234
77 448
366 870
11 879
113 366
47 502
38 832
712 769
85 147
492 826
448 718
383 670
58 596
686 732
234 943
268 427
610 976
...

output:

30 30
11 38 86 115 117 147 200 218 222 234 366 383 392 427 448 498 502 566 572 596 610 644 712 723 732 738 826 865 895 903 

result:

ok 2 lines

Test #100:

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

input:

1
1000 2997 30
345 954
228 863
24 467
652 853
49 389
58 921
144 824
477 947
431 981
349 746
625 915
166 274
443 548
353 756
87 901
31 622
450 672
27 57
518 608
354 825
142 974
40 916
214 798
601 950
155 923
186 830
895 959
270 474
602 798
300 491
20 982
876 935
774 811
91 294
387 965
277 803
47 478
...

output:

-1

result:

ok single line: '-1'

Test #101:

score: 0
Accepted
time: 137ms
memory: 7608kb

input:

1
1000 1500 30
18 964
877 952
462 797
179 209
788 895
735 848
196 745
111 781
570 626
424 898
369 575
528 751
493 948
404 890
74 303
419 729
20 764
243 839
46 544
171 803
369 483
165 714
43 103
354 905
145 453
222 280
685 930
235 773
892 972
544 588
329 571
221 796
300 977
125 610
309 976
480 741
73...

output:

-1

result:

ok single line: '-1'

Test #102:

score: 0
Accepted
time: 135ms
memory: 7616kb

input:

1
1000 750 30
119 648
202 950
47 294
284 817
341 611
247 652
128 285
354 892
638 926
604 721
302 720
132 308
414 645
407 929
490 866
362 896
39 441
189 898
253 725
140 602
53 305
842 881
58 649
240 640
177 366
82 794
710 736
112 787
335 576
728 965
466 525
58 471
441 490
29 972
469 893
212 775
521 8...

output:

-1

result:

ok single line: '-1'

Test #103:

score: -1
Wrong Answer
time: 8ms
memory: 6004kb

input:

10
105 288 30
80 84
30 51
51 60
4 51
25 51
69 96
15 20
51 96
85 97
68 97
51 96
75 96
14 30
51 96
50 90
96 98
51 77
88 98
43 98
58 75
71 96
35 96
38 51
32 56
51 96
82 96
37 75
51 96
6 96
12 82
50 86
25 51
14 96
51 96
71 84
14 51
12 98
6 44
51 52
46 51
51 52
51 75
51 96
12 51
36 51
51 71
40 51
17 33
6...

output:

-1
30 38
2 4 8 9 10 11 15 16 18 21 25 27 28 30 37 38 39 43 45 46 49 54 56 58 61 62 66 67 68 69 70 73 74 79 83 88 89 90 
28 38
6 12 15 19 20 22 23 26 27 29 30 33 34 39 40 46 47 48 50 55 56 59 63 69 70 72 83 92 93 94 95 96 99 100 101 107 108 109 
24 31
2 3 10 11 12 16 17 18 19 30 41 42 48 51 52 54 61 ...

result:

wrong answer 10th lines differ - expected: '27 36', found: '27 34'

Subtask #9:

score: 0
Wrong Answer

Test #109:

score: 1
Accepted
time: 2ms
memory: 7664kb

input:

1
1000 3000 30
126 407
55 812
361 478
617 796
500 641
338 450
587 739
1 159
753 795
521 995
313 981
35 595
364 914
334 672
615 802
466 789
262 852
258 867
475 686
543 902
334 795
470 899
146 823
713 850
305 574
201 332
119 298
387 747
187 999
95 981
349 731
749 883
829 895
380 818
568 856
738 981
69...

output:

-1

result:

ok single line: '-1'

Test #110:

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

input:

1
1000 3000 30
534 661
174 197
306 990
51 215
197 622
327 560
503 769
462 503
88 327
150 713
77 876
441 755
150 354
14 974
35 281
441 537
501 766
621 657
309 568
234 854
278 657
115 503
162 501
976 990
121 618
441 814
439 854
447 876
197 509
604 925
632 849
281 382
15 319
211 854
258 281
56 501
296 ...

output:

30 30
14 51 139 150 177 197 281 296 302 309 319 327 338 395 441 501 503 534 593 594 618 632 657 706 854 876 884 891 925 990 

result:

ok 2 lines

Test #111:

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

input:

1
1000 3000 30
28 492
748 963
638 861
276 350
314 741
263 425
38 147
23 899
28 310
661 725
128 691
160 622
519 691
28 594
79 659
293 427
76 404
425 725
111 246
300 408
189 691
311 673
263 497
691 888
616 895
246 392
157 748
616 640
147 606
147 866
119 431
350 521
119 208
691 867
883 945
246 984
173 ...

output:

29 29
28 41 79 119 147 246 263 293 314 350 404 408 489 525 587 610 616 622 638 673 688 691 725 748 810 825 899 933 945 

result:

ok 2 lines

Test #112:

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

input:

1
1000 3000 30
400 785
352 391
159 261
432 622
156 416
153 767
17 551
89 423
15 247
320 957
114 666
378 851
276 533
151 700
98 445
841 897
840 967
315 379
51 677
162 166
57 130
481 880
251 503
308 703
365 427
193 339
721 730
577 586
67 528
65 251
181 403
104 472
264 920
377 400
395 439
603 902
150 8...

output:

-1

result:

ok single line: '-1'

Test #113:

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

input:

1
1000 2000 30
706 736
103 344
208 727
115 564
23 627
51 274
151 467
684 732
521 618
669 993
665 893
56 357
426 709
624 666
326 555
167 211
57 767
139 305
37 430
347 640
479 506
531 717
512 642
380 416
266 662
46 144
601 946
291 447
327 862
123 213
493 975
686 767
209 497
95 873
110 252
616 832
129 ...

output:

-1

result:

ok single line: '-1'

Test #114:

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

input:

1
1000 800 30
379 588
182 956
785 891
58 420
186 597
41 935
543 845
264 615
211 973
30 217
516 632
376 414
305 337
666 960
19 35
354 679
413 597
32 812
182 940
335 591
125 653
370 851
627 645
268 854
323 824
12 708
411 648
90 734
292 894
609 981
89 584
154 753
663 963
617 860
636 767
25 991
829 984
...

output:

-1

result:

ok single line: '-1'

Test #115:

score: -1
Wrong Answer
time: 7ms
memory: 6092kb

input:

10
103 315 30
28 70
2 15
12 62
37 72
15 44
74 103
18 80
15 49
2 80
5 74
2 74
2 74
44 58
21 99
74 99
37 66
2 44
2 58
44 74
15 58
44 74
12 74
74 99
10 15
12 74
2 74
35 80
15 44
15 49
33 95
89 101
15 35
54 55
44 47
44 74
2 46
74 80
10 74
15 82
20 56
47 74
58 74
9 74
74 100
54 74
5 74
13 74
66 74
54 80
...

output:

30 37
2 10 12 13 14 15 18 20 21 28 33 35 37 38 40 43 44 47 48 54 57 58 61 62 63 64 72 74 76 80 82 89 90 91 95 99 101 
26 30
5 8 13 15 16 21 23 27 29 36 37 46 49 50 57 62 65 66 68 71 77 80 81 82 83 88 90 92 93 94 
26 32
1 6 16 17 18 22 23 24 25 30 33 38 41 45 46 47 52 57 58 59 60 63 64 68 69 73 74 77...

result:

wrong answer 11th lines differ - expected: '29 44', found: '29 43'

Subtask #10:

score: 0
Wrong Answer

Test #121:

score: 1
Accepted
time: 2ms
memory: 7716kb

input:

1
1000 3000 30
530 695
780 873
245 704
66 567
435 786
5 536
743 895
374 505
283 773
10 50
250 840
100 416
321 704
390 1000
786 921
374 549
490 626
362 759
661 929
589 704
390 446
123 725
371 447
380 930
10 106
661 876
615 695
410 695
421 695
390 561
10 209
338 780
18 345
41 123
121 773
345 384
558 9...

output:

29 29
5 10 66 123 250 345 352 368 374 390 416 447 462 622 626 647 661 691 695 704 714 743 759 773 780 786 853 922 930 

result:

ok 2 lines

Test #122:

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

input:

1
1000 3000 30
79 286
325 945
25 566
629 751
523 566
398 742
769 793
622 706
91 484
287 880
321 966
436 966
119 618
243 349
119 894
398 692
249 287
444 733
400 831
815 902
155 693
356 597
455 966
22 119
486 597
232 444
482 878
91 467
461 831
605 894
39 966
598 966
287 592
243 722
170 398
392 831
383...

output:

30 30
91 119 128 155 158 223 243 277 286 287 325 332 368 398 444 461 482 566 594 597 622 629 682 761 793 815 831 894 919 966 

result:

ok 2 lines

Test #123:

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

input:

1
1000 3000 30
69 502
36 140
484 840
882 978
399 605
79 902
566 615
486 675
54 768
367 671
532 762
886 972
882 978
158 255
903 943
16 607
46 548
60 555
133 226
240 704
172 341
543 714
261 855
482 664
541 632
22 47
23 520
242 471
411 947
387 440
460 510
197 290
617 881
64 890
784 793
507 709
679 686
...

output:

-1

result:

ok single line: '-1'

Test #124:

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

input:

1
1000 999 30
658 792
12 345
663 977
286 866
424 606
210 876
285 859
29 537
242 687
475 498
440 690
159 689
150 663
369 856
34 382
16 20
87 518
71 485
353 532
104 515
259 479
7 101
86 171
710 982
90 312
125 895
623 867
704 774
618 682
104 399
529 702
221 740
364 814
272 517
199 844
274 437
572 754
4...

output:

-1

result:

ok single line: '-1'

Test #125:

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

input:

1
1000 666 30
91 706
198 897
145 973
151 544
437 750
817 944
723 759
770 991
413 993
352 776
170 483
332 612
498 852
552 671
43 465
278 668
537 808
583 774
814 1000
321 614
71 651
110 167
213 399
361 980
351 641
264 524
346 480
810 924
357 845
240 950
314 581
758 882
458 764
11 194
232 948
60 630
64...

output:

-1

result:

ok single line: '-1'

Test #126:

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

input:

1
1000 3000 30
710 833
132 710
518 710
637 710
412 710
710 777
303 710
32 710
337 710
693 710
510 710
547 710
83 710
373 710
61 710
326 710
238 710
386 710
83 710
710 718
49 710
710 949
466 710
151 710
191 710
710 813
710 915
541 710
710 748
569 710
710 876
211 710
710 818
417 710
365 710
592 710
71...

output:

1 1
710 

result:

ok 2 lines

Test #127:

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

input:

9
99 284 30
31 43
12 31
12 33
43 96
31 61
52 89
31 43
31 67
31 43
34 76
31 34
8 44
7 89
67 88
31 43
31 46
31 34
25 39
43 46
34 88
22 62
9 67
31 50
34 70
52 89
31 73
67 78
43 63
37 43
43 89
7 88
52 86
43 67
31 45
31 61
38 70
31 88
9 43
31 52
52 87
31 34
1 43
31 52
40 67
34 76
31 52
43 93
31 70
52 88
...

output:

24 34
1 4 5 7 8 9 12 14 15 20 22 26 31 34 39 42 43 44 50 51 52 61 67 70 73 77 85 87 88 89 94 96 98 99 
26 35
1 6 8 9 11 14 20 21 26 27 29 33 39 48 50 51 53 54 55 56 61 64 65 67 68 71 72 76 82 86 87 89 90 91 92 
-1
27 39
5 10 12 19 20 22 26 27 28 31 33 35 36 40 42 49 51 54 55 57 59 61 64 65 67 68 69 ...

result:

ok 15 lines

Test #128:

score: -1
Wrong Answer
time: 4ms
memory: 4236kb

input:

9
104 262 30
80 103
9 57
38 56
77 93
47 57
44 77
52 93
77 78
38 102
34 38
28 77
37 75
35 38
47 77
38 77
18 77
77 97
57 103
56 84
57 96
22 52
57 77
55 77
9 57
57 77
26 77
36 74
57 77
35 102
12 57
75 80
78 100
38 57
32 52
38 57
38 52
30 38
52 68
52 77
9 57
18 38
56 77
32 77
31 57
38 74
1 77
29 38
19 5...

output:

26 36
6 9 18 19 25 30 32 35 36 37 38 41 44 47 48 49 51 52 54 55 56 57 68 74 75 77 78 79 80 84 85 87 90 93 100 103 
28 40
5 6 7 9 11 12 15 21 22 25 28 32 34 36 37 40 41 44 52 53 54 56 59 61 62 64 67 70 74 75 77 82 89 90 92 93 95 96 97 99 
-1
27 40
2 3 4 5 6 8 13 16 17 18 24 34 36 37 38 40 41 43 44 45...

result:

wrong answer 6th lines differ - expected: '27 41', found: '27 40'