QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#687769#692. Delete the Points0xyzAC ✓2ms3860kbC++141.4kb2024-10-29 21:07:282024-10-29 21:07:29

Judging History

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

  • [2024-10-29 21:07:29]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3860kb
  • [2024-10-29 21:07:28]
  • 提交

answer

#include<bits/stdc++.h>
#define F first
#define S second
using namespace std;
typedef pair<int,int> P;
int T=1,n;
set<P>s;
void ouc(P a,P b){
	cout<<b.F<<' '<<b.S<<' '<<b.F+max(a.F-b.F,b.S-a.S)<<' '<<b.S-max(a.F-b.F,b.S-a.S)<<'\n';
	s.erase(a);s.erase(b);
}
void oul(P a,P b){
	cout<<a.F<<' '<<a.S<<' '<<a.F+a.S-b.S<<' '<<b.S<<'\n';
	s.erase(a);s.erase(b); 
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	//cin>>T;
	while(T--){
		cin>>n;
		for(int i=1,x,y;i<=n;i++)cin>>x>>y,s.insert({x,y});
		cout<<"Yes\n";
		while(s.size()){
			set<P>::iterator p=s.end();
			P a,b,c;
			p--;a=*p;p--;b=*p;
			if(a.F==b.F)oul(a,b);
			else if(a.S>=b.S){
				cout<<b.F<<' '<<b.S<<' '<<b.F+max(a.F-b.F,a.S-b.S)<<' '<<b.S+max(a.F-b.F,a.S-b.S)<<'\n';
				s.erase(a);s.erase(b);
			}else if(s.size()==2)ouc(a,b);
			else{
				p--;c=*p;
				if(c.F!=b.F)ouc(a,b);
				else if(c.S<a.S){
					if(b.S-a.S>=a.F-b.F)ouc(a,b);
					else{
						cout<<a.F<<' '<<a.S<<' '<<b.F<<' '<<a.S+a.F-b.F<<'\n';
						s.erase(a);s.erase(b);
					}
				}else if(c.S>a.S)oul(b,c);
				else if(a.F-c.F>b.S-c.S)oul(b,c);
				else if(a.F-c.F<b.S-c.S){
					cout<<c.F<<' '<<c.S<<' '<<a.F<<' '<<c.S+a.F-c.F<<'\n';
					s.erase(a);s.erase(c);
				}else{
					cout<<b.F-1<<".5 "<<b.S<<' '<<b.F+b.S-c.S-1<<".5 "<<c.S<<'\n';
					s.erase(b);s.erase(c);
				}
			}
		}
	}
	return 0;
}

详细

Test #1:

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

input:

4
1 1
2 2
5 5
6 6

output:

Yes
5 5 6 6
1 1 2 2

result:

ok OK

Test #2:

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

input:

4
0 0
1 2
2 1
4 4

output:

Yes
2 1 5 4
0 0 2 2

result:

ok OK

Test #3:

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

input:

4
1 2
3 2
2 1
2 3

output:

Yes
2 3 3 2
1 2 2 1

result:

ok OK

Test #4:

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

input:

6
12 9
1 5
10 14
20 14
15 4
7 9

output:

Yes
15 4 25 14
10 14 15 9
1 5 7 11

result:

ok OK

Test #5:

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

input:

10
39 72
59 52
23 17
2 31
30 0
25 88
2 36
61 23
4 96
59 76

output:

Yes
59 76 83 52
39 72 88 23
25 88 113 0
4 96 83 17
2 36 7 31

result:

ok OK

Test #6:

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

input:

10
53 95
37 51
84 11
3 39
31 20
37 84
42 27
95 38
6 6
16 19

output:

Yes
84 11 111 38
42 27 110 95
37 84 70 51
16 19 31 34
3 39 36 6

result:

ok OK

Test #7:

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

input:

3000
997371332 135791687
997371332 135791686
997371332 135791685
997371333 135791685
997371333 135791687
997371334 135791687
997371333 135791688
997371331 135791686
997371333 135791689
997371334 135791686
997371334 135791689
997371333 135791684
997371332 135791689
997371331 135791685
997371334 13579...

output:

Yes
997371369.5 135791685 997371370.5 135791684
997371370 135791683 997371371 135791684
997371370 135791678 997371371 135791677
997371370 135791676 997371372 135791674
997371369 135791685 997371370 135791684
997371369 135791683 997371373 135791679
997371369 135791678 997371370 135791677
997371369 13...

result:

ok OK

Test #8:

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

input:

36
199 305
199 307
202 306
203 309
201 308
203 308
199 304
198 307
198 304
201 304
200 307
200 305
203 307
203 304
203 305
201 305
201 307
200 309
202 309
201 309
198 306
199 306
200 304
198 309
198 305
200 306
202 304
201 306
199 309
203 306
198 308
202 308
199 308
202 305
202 307
200 308

output:

Yes
203 309 204 308
203 307 204 306
203 305 204 304
202 309 203 308
202 307 203 306
202 305 203 304
201 309 202 308
201 307 202 306
201 305 202 304
200 309 201 308
200 307 201 306
200 305 201 304
199 309 200 308
199 307 200 306
199 305 200 304
198 309 199 308
198 307 199 306
198 305 199 304

result:

ok OK

Test #9:

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

input:

128
6357 4491
6356 4510
6357 4490
6357 4498
6356 4492
6355 4502
6357 4506
6356 4499
6355 4508
6355 4493
6355 4516
6358 4510
6357 4497
6357 4515
6357 4513
6358 4512
6357 4509
6357 4494
6356 4500
6355 4491
6356 4497
6355 4501
6358 4503
6357 4501
6356 4515
6358 4513
6355 4499
6355 4505
6358 4517
6358 4...

output:

Yes
6358 4520 6359 4519
6358 4518 6359 4517
6358 4516 6359 4515
6358 4514 6359 4513
6358 4512 6359 4511
6358 4510 6359 4509
6358 4508 6359 4507
6358 4506 6359 4505
6358 4504 6359 4503
6358 4502 6359 4501
6358 4500 6359 4499
6358 4498 6359 4497
6358 4496 6359 4495
6358 4494 6359 4493
6358 4492 6359 4...

result:

ok OK

Test #10:

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

input:

1444
122394525 884625474
122394544 884625449
122394537 884625450
122394534 884625441
122394526 884625452
122394541 884625446
122394523 884625443
122394529 884625461
122394521 884625462
122394535 884625470
122394521 884625444
122394507 884625440
122394508 884625448
122394537 884625463
122394507 88462...

output:

Yes
122394544 884625474 122394545 884625473
122394544 884625472 122394545 884625471
122394544 884625470 122394545 884625469
122394544 884625468 122394545 884625467
122394544 884625466 122394545 884625465
122394544 884625464 122394545 884625463
122394544 884625462 122394545 884625461
122394544 884625...

result:

ok OK

Test #11:

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

input:

2048
104790855 978585926
104790853 978585917
104790847 978585935
104790807 978585934
104790869 978585939
104790813 978585932
104790832 978585922
104790840 978585944
104790813 978585930
104790806 978585918
104790847 978585943
104790836 978585933
104790810 978585916
104790830 978585920
104790857 97858...

output:

Yes
104790869 978585945 104790870 978585944
104790869 978585943 104790870 978585942
104790869 978585941 104790870 978585940
104790869 978585939 104790870 978585938
104790869 978585937 104790870 978585936
104790869 978585935 104790870 978585934
104790869 978585933 104790870 978585932
104790869 978585...

result:

ok OK

Test #12:

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

input:

1000
378405767 3269747
378405743 3269785
378405740 3269786
378405763 3269757
378405763 3269781
378405765 3269757
378405742 3269768
378405767 3269751
378405763 3269741
378405738 3269730
378405749 3269739
378405745 3269733
378405745 3269759
378405764 3269778
378405741 3269729
378405759 3269755
3784057...

output:

Yes
378405769 3269785 378405771 3269783
378405769 3269781 378405771 3269779
378405769 3269777 378405771 3269775
378405769 3269773 378405771 3269771
378405769 3269769 378405771 3269767
378405769 3269765 378405771 3269763
378405769 3269761 378405771 3269759
378405769 3269757 378405771 3269755
37840576...

result:

ok OK

Test #13:

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

input:

100
11771 17392
11771 17393
11770 17393
11771 17394
11772 17392
11772 17393
11769 17393
11773 17393
11769 17392
11768 17392
11769 17394
11773 17392
11768 17391
11767 17391
11767 17392
11774 17393
11766 17391
11774 17392
11766 17390
11770 17394
11771 17395
11769 17391
11774 17391
11771 17396
11770 17...

output:

Yes
11777 17393 11778 17392
11777 17391 11778 17390
11776 17391 11778 17389
11775 17393 11776 17392
11775 17391 11776 17390
11775 17389 11776 17388
11774 17396 11775 17395
11774 17394 11775 17393
11774 17392 11775 17391
11774 17390 11775 17389
11773 17396 11775 17394
11773 17393 11774 17392
11773 17...

result:

ok OK

Test #14:

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

input:

410
380814730 2133815
380814730 2133814
380814729 2133814
380814731 2133814
380814731 2133815
380814731 2133816
380814729 2133813
380814732 2133816
380814730 2133816
380814728 2133814
380814732 2133817
380814731 2133813
380814732 2133813
380814732 2133812
380814728 2133815
380814733 2133816
38081473...

output:

Yes
380814743 2133809 380814744 2133810
380814742 2133810 380814743 2133809
380814741 2133819 380814742 2133818
380814741 2133817 380814742 2133816
380814741 2133814 380814743 2133812
380814741 2133810 380814743 2133808
380814740 2133818 380814741 2133817
380814740 2133816 380814741 2133815
38081474...

result:

ok OK

Test #15:

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

input:

1106
31879487 28769582
31879486 28769582
31879487 28769581
31879486 28769581
31879486 28769583
31879487 28769583
31879487 28769580
31879488 28769580
31879488 28769583
31879485 28769582
31879488 28769579
31879485 28769583
31879488 28769582
31879486 28769580
31879486 28769584
31879486 28769585
3187948...

output:

Yes
31879508 28769578 31879513 28769573
31879507 28769578 31879508 28769577
31879507 28769576 31879509 28769574
31879507 28769573 31879510 28769570
31879506 28769578 31879507 28769577
31879506 28769576 31879508 28769574
31879506 28769573 31879507 28769572
31879505 28769578 31879506 28769577
31879505...

result:

ok OK

Test #16:

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

input:

1682
199151236 118971535
199151236 118971534
199151236 118971533
199151236 118971532
199151237 118971533
199151237 118971534
199151238 118971534
199151238 118971535
199151237 118971535
199151236 118971536
199151235 118971534
199151239 118971535
199151235 118971536
199151239 118971536
199151240 11897...

output:

Yes
199151266 118971542 199151267 118971541
199151265 118971543 199151266 118971542
199151264 118971542 199151265 118971541
199151264 118971532 199151269 118971527
199151264 118971526 199151265 118971525
199151263 118971541 199151264 118971540
199151263 118971532 199151264 118971531
199151263 118971...

result:

ok OK

Test #17:

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

input:

1120
66329602 172836461
66329603 172836461
66329604 172836461
66329604 172836460
66329603 172836460
66329602 172836462
66329601 172836462
66329602 172836460
66329602 172836459
66329601 172836461
66329601 172836460
66329602 172836463
66329600 172836461
66329603 172836463
66329603 172836459
66329603 1...

output:

Yes
66329624 172836462 66329625 172836461
66329623 172836463 66329624 172836462
66329622.5 172836461 66329623.5 172836460
66329623 172836459 66329624 172836460
66329622 172836462 66329623 172836461
66329622 172836459 66329623 172836458
66329621 172836474 66329622 172836473
66329621 172836463 6632962...

result:

ok OK

Test #18:

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

input:

2364
14502323 4917115
14502322 4917115
14502321 4917115
14502323 4917114
14502321 4917114
14502324 4917115
14502321 4917113
14502323 4917116
14502324 4917114
14502322 4917114
14502321 4917112
14502324 4917113
14502322 4917116
14502324 4917112
14502323 4917113
14502325 4917113
14502321 4917111
145023...

output:

Yes
14502347 4917114 14502348 4917113
14502346 4917114 14502347 4917113
14502346 4917112 14502353 4917105
14502346 4917101 14502347 4917100
14502345.5 4917099 14502346.5 4917098
14502345 4917121 14502351 4917115
14502345 4917114 14502346 4917113
14502345 4917111 14502347 4917109
14502345 4917108 145...

result:

ok OK

Test #19:

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

input:

1000
984711605 721217148
984711606 721217148
984711605 721217149
984711604 721217148
984711604 721217147
984711603 721217147
984711605 721217147
984711606 721217147
984711605 721217146
984711603 721217146
984711602 721217146
984711602 721217147
984711601 721217146
984711603 721217148
984711606 72121...

output:

Yes
984711625 721217154 984711626 721217155
984711625 721217153 984711631 721217147
984711624 721217156 984711625 721217155
984711624 721217154 984711625 721217153
984711624 721217152 984711627 721217149
984711624 721217148 984711625 721217147
984711623 721217156 984711624 721217155
984711623 721217...

result:

ok OK

Test #20:

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

input:

2000
843557823 928504418
843557822 928504418
843557823 928504417
843557823 928504416
843557824 928504417
843557822 928504419
843557823 928504415
843557823 928504414
843557824 928504414
843557824 928504413
843557821 928504419
843557824 928504415
843557823 928504413
843557822 928504417
843557822 92850...

output:

Yes
843557847 928504417 843557857 928504407
843557846 928504425 843557852 928504419
843557846 928504418 843557847 928504417
843557846 928504415 843557850 928504411
843557846 928504407 843557847 928504406
843557845 928504425 843557846 928504424
843557845 928504423 843557846 928504422
843557845 928504...

result:

ok OK

Test #21:

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

input:

3000
326952474 119559920
326952475 119559920
326952474 119559921
326952475 119559919
326952474 119559922
326952473 119559921
326952475 119559921
326952476 119559920
326952474 119559919
326952473 119559922
326952475 119559922
326952476 119559922
326952473 119559919
326952476 119559919
326952473 11955...

output:

Yes
326952513 119559903 326952514 119559902
326952513 119559901 326952514 119559902
326952512 119559902 326952513 119559901
326952511 119559904 326952512 119559903
326952509.5 119559903 326952510.5 119559902
326952510 119559901 326952511 119559902
326952509 119559907 326952513 119559903
326952509 11...

result:

ok OK

Test #22:

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

input:

3000
380232772 174172185
380232771 174172185
380232772 174172184
380232771 174172184
380232771 174172186
380232773 174172185
380232770 174172186
380232773 174172184
380232769 174172186
380232772 174172186
380232774 174172184
380232774 174172185
380232770 174172184
380232774 174172186
380232769 17417...

output:

Yes
380232809 174172188 380232810 174172187
380232808 174172187 380232812 174172183
380232807.5 174172179 380232808.5 174172178
380232808 174172177 380232809 174172178
380232807 174172188 380232808 174172187
380232807 174172186 380232809 174172184
380232807 174172183 380232811 174172179
380232806 17...

result:

ok OK

Test #23:

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

input:

3000
140198268 469838596
140198268 469838597
140198267 469838597
140198267 469838596
140198267 469838595
140198268 469838595
140198269 469838595
140198267 469838594
140198267 469838593
140198266 469838593
140198268 469838594
140198266 469838592
140198270 469838595
140198269 469838594
140198269 46983...

output:

Yes
140198312 469838596 140198313 469838595
140198310 469838596 140198311 469838597
140198309 469838598 140198310 469838597
140198308 469838601 140198310 469838599
140198308 469838596 140198309 469838597
140198307 469838602 140198308 469838601
140198306.5 469838599 140198307.5 469838598
140198307 46...

result:

ok OK

Test #24:

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

input:

3000
901816252 637962925
901816253 637962925
901816251 637962925
901816253 637962924
901816252 637962926
901816253 637962926
901816254 637962924
901816253 637962923
901816255 637962924
901816254 637962923
901816252 637962924
901816250 637962925
901816255 637962923
901816256 637962924
901816249 63796...

output:

Yes
901816292 637962926 901816293 637962925
901816291 637962926 901816292 637962925
901816290 637962928 901816291 637962927
901816290 637962926 901816291 637962925
901816290 637962924 901816291 637962925
901816289 637962931 901816290 637962930
901816289 637962925 901816290 637962924
901816289 637962...

result:

ok OK

Test #25:

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

input:

3000
255021346 678545164
255021346 678545163
255021346 678545162
255021347 678545162
255021346 678545161
255021345 678545164
255021347 678545164
255021347 678545161
255021345 678545162
255021344 678545164
255021346 678545165
255021344 678545162
255021347 678545165
255021348 678545164
255021348 67854...

output:

Yes
255021381 678545162 255021382 678545161
255021379 678545161 255021380 678545162
255021378 678545162 255021379 678545161
255021378 678545160 255021379 678545161
255021377 678545182 255021393 678545166
255021377 678545163 255021378 678545162
255021377 678545161 255021378 678545160
255021377 678545...

result:

ok OK

Test #26:

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

input:

3000
19944320 886552614
19944321 886552614
19944322 886552614
19944322 886552615
19944319 886552614
19944322 886552613
19944323 886552613
19944320 886552615
19944320 886552613
19944321 886552615
19944321 886552613
19944321 886552616
19944318 886552614
19944318 886552613
19944322 886552612
19944322 8...

output:

Yes
19944359 886552618 19944360 886552617
19944358 886552619 19944359 886552618
19944358 886552617 19944365 886552610
19944357 886552625 19944358 886552624
19944357 886552623 19944359 886552621
19944357 886552620 19944358 886552619
19944357 886552618 19944358 886552617
19944356 886552624 19944357 88...

result:

ok OK

Test #27:

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

input:

3000
81487100 672050647
81487099 672050647
81487099 672050646
81487101 672050647
81487101 672050646
81487102 672050647
81487100 672050646
81487098 672050647
81487100 672050648
81487103 672050647
81487102 672050646
81487101 672050648
81487098 672050648
81487103 672050648
81487099 672050645
81487097 6...

output:

Yes
81487132 672050655 81487134 672050653
81487132 672050652 81487133 672050653
81487132 672050651 81487134 672050649
81487131 672050659 81487133 672050657
81487131 672050656 81487132 672050655
81487131 672050654 81487132 672050653
81487131 672050652 81487133 672050650
81487131 672050649 81487132 67...

result:

ok OK

Test #28:

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

input:

3000
849715052 230047603
849715052 230047604
849715053 230047604
849715054 230047604
849715051 230047603
849715054 230047605
849715052 230047602
849715051 230047604
849715054 230047603
849715054 230047602
849715053 230047605
849715053 230047602
849715051 230047605
849715051 230047602
849715055 23004...

output:

Yes
849715090 230047610 849715091 230047609
849715089 230047612 849715091 230047610
849715089 230047607 849715090 230047606
849715089 230047604 849715090 230047605
849715088 230047614 849715090 230047612
849715088 230047611 849715089 230047610
849715088 230047608 849715089 230047607
849715088 230047...

result:

ok OK

Test #29:

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

input:

3000
209530154 278800866
209530153 278800866
209530152 278800866
209530152 278800865
209530152 278800864
209530154 278800865
209530152 278800867
209530152 278800863
209530152 278800862
209530153 278800867
209530151 278800864
209530154 278800864
209530155 278800865
209530155 278800866
209530154 27880...

output:

Yes
209530189 278800862 209530190 278800861
209530188 278800862 209530189 278800861
209530187 278800863 209530188 278800862
209530187 278800861 209530188 278800860
209530186 278800867 209530188 278800865
209530186 278800863 209530187 278800862
209530185 278800869 209530186 278800868
209530185 278800...

result:

ok OK

Test #30:

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

input:

1178
12036052 24560933
21423541 11553906
22039558 4415857
23774109 25917119
22044001 13002902
31309918 29279529
8964688 15596053
11410338 12655701
30962336 24981123
23719511 23001628
32303421 20203888
27683917 11732630
6617793 24802588
5498165 32274901
31289416 9043570
15258992 14700379
12898925 104...

output:

Yes
32468069 5861307 36382267 1947109
32388137 28070509 52227283 8231363
32303421 20203888 40532239 11975070
32256122 15927218 33324267 14859073
32203463 7502155 38842968 862650
32158877 12869805 42890287 2138395
32043072 27026832 36670949 22398955
32012626 25562778 32362997 25212407
31995076 130900...

result:

ok OK

Test #31:

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

input:

1640
136484178 126444841
333101398 24563753
71900946 274700249
342347449 78130816
137545314 249684257
3978345 197411412
351325646 34261775
114797111 24597769
204418733 80935388
253315894 323061249
275452404 23866183
300224575 181211404
210308333 247063610
232250470 250178870
73813893 171299008
14893...

output:

Yes
355081926 149362606 367841328 136603204
354281670 239354027 393938164 279010521
354037559 30194837 446309723 122467001
353481229 269248904 448417005 174313128
352816056 29430388 634011619 310625951
352235378 270109448 364927691 282801761
351908411 16028215 657113281 321233085
351697504 241873808...

result:

ok OK

Test #32:

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

input:

1068
22972267 15624488
3609926 352020
15859748 942114
4129039 13232083
5255597 2745286
14744090 13828379
6721218 20429790
21615183 6393625
14867543 7106305
11670448 15856912
17239714 9145856
4801574 1380878
14742712 10568492
10788638 11349169
3274001 20392589
17512458 1229743
11271738 17261101
69220...

output:

Yes
23513559 19099235 28434120 14178674
23474915 11933325 25141343 10266897
23370111 8890733 28775842 14296464
23347245 12214271 31827079 3734437
23338691 16071528 25078620 17811457
23254447 1569563 24405251 2720367
23234526 8732426 34126465 19624365
23205614 23418417 32930937 13693094
23041715 2112...

result:

ok OK

Test #33:

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

input:

2346
5106504 12992174
28324161 23077950
31282743 28091380
15471270 7172663
5834371 27697056
30571017 29290634
10984757 5646217
25467203 13831678
19375353 25171512
29760131 17759277
27811534 7932009
24724810 620438
33227130 7646942
25885038 10977438
7953540 30531147
1580379 12094874
4779928 20164107
...

output:

Yes
35319855 2442389 45651792 12774326
35263749 615085 48943877 14295213
35229529 30870099 36331076 29768552
35147612 25307947 43594691 16860868
35081338 706397 45580416 11205475
35054718 26866786 47239540 14681964
35049636 16167848 36686705 17804917
35023498 21782698 46456497 10349699
35012599 1370...

result:

ok OK

Test #34:

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

input:

3000
683106201 983926110
843148391 805989213
836994236 936775150
365544627 182465452
971191966 454024291
324209406 160614301
221579201 265101387
323328424 687447836
370817474 204756248
531455117 722397735
407043762 8442038
993889971 529650114
811679540 832460203
211643757 811851921
74551573 64978210...

output:

Yes
999766621 461289064 1043866587 505389030
999219435 99882638 1759005254 859668457
998522873 357692237 1506681626 865850990
997862765 560810090 1049016529 611963854
997793501 790471986 1067514731 720750756
997001756 306207953 1019967461 329173658
996278446 727920736 1407452300 316746882
996186796 ...

result:

ok OK

Test #35:

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

input:

3000
666015912 944186906
559506019 69880292
334305525 858767592
260009982 538399886
297439837 121287219
548720363 311940451
791919679 387558470
538097110 777349827
413142538 880728370
962786801 744372206
996002495 642091949
840969860 218092379
130107154 232228642
905230983 754847989
856665759 449863...

output:

Yes
999084988 908728007 1288743530 619069465
998179768 672885086 1478726259 192338595
997271910 838521602 1653295987 182497525
996505572 983998806 1171907447 808596931
996402695 203018270 1172204413 27216552
996002495 642091949 1174503489 820592943
995832623 525038991 1167986484 352885130
995520278 ...

result:

ok OK

Test #36:

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

input:

3000
899219025 883166269
252416949 807118950
58545263 784658716
507922984 120077805
640190744 31950566
452226800 648461331
662629882 782992198
996084861 162035735
774449765 586698284
162697507 106589626
995069394 35550283
92948378 753494977
850163289 708771226
545079679 929941109
337684793 74650580
...

output:

Yes
999949911 77991913 1043299155 121341157
998361984 72932945 1784571903 859142864
998024658 162426525 1393302133 557704000
997429760 634072512 1336806019 973448771
996190192 841500526 1209320868 628369850
996047366 632601157 1466612788 162035735
995664072 59950809 1035144351 20470530
995235209 429...

result:

ok OK

Test #37:

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

input:

3000
429041923 989570855
498826239 265614730
31752237 670873303
752188766 531419142
728334407 724514897
396132770 325253757
518301099 927683516
31829507 124485601
258994250 149933106
668897134 547511143
450218328 636666376
939805041 457992850
217565517 81722057
719531799 986010199
427017597 15671367...

output:

Yes
999526222 58543515 1671192992 730210285
998822018 428666027 1356073319 785917328
998334715 297434359 1003253111 302352755
998003462 71004719 1449426290 522427547
997427853 746340299 1702739355 41028797
996695412 336346737 1167473380 507124705
996510299 434133845 1437579831 875203377
995743147 79...

result:

ok OK

Test #38:

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

input:

2350
669921077 534606025
552118333 864198237
782904332 559420536
959934513 22425261
533913163 693669933
579655813 146503402
11610899 931837076
82393253 239182467
164866246 882450737
786994205 79179134
100191130 979339386
1287777 423231449
188654873 474544247
913211914 630669045
152620566 487333040
6...

output:

Yes
997775518 967307513 1822811715 142271316
995892624 886022519 1205897456 676017687
993496055 387048863 1536382888 929935696
991869222 428457717 1433966809 870555304
991460971 566430239 1251388681 306502529
990277045 402334689 1518326469 930384113
989826342 462917108 1218505334 691596100
988735020...

result:

ok OK

Test #39:

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

input:

2772
133522836 531726711
780626175 498140109
846829644 644666632
95506593 586594761
681984762 665722293
472789396 189731192
58567055 683091213
882951886 830403131
593170977 50295650
487567270 661280887
514756971 953539148
356708952 579557396
899493708 161785126
67805317 806856449
223880516 60460432
...

output:

Yes
998620907 46569608 1293792992 341741693
998285283 468930723 1401930398 65285608
997232188 511908365 1367144579 141995974
996966789 420530680 1239758233 663322124
996438766 285262217 1162635455 119065528
996175372 663634064 1131766769 528042667
995171536 514498734 1245897782 765224980
994367943 7...

result:

ok OK

Test #40:

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

input:

2206
957795769 672280342
652243290 302901367
944707345 546396328
355709391 601189703
611957341 88239586
406708314 881483524
564332431 12102240
478093918 254412675
583773317 409331377
262325506 994431965
141499498 527135978
803077551 498327548
387123766 678596723
103374687 766707876
342350717 1124364...

output:

Yes
998346554 627734558 1000425296 625655816
997579701 429235602 1454679669 886335570
996608706 334866922 1658499445 996757661
995810707 218418178 1024437276 189791609
995450706 894946150 1655271736 235125120
994667503 393146886 1354724503 33089886
994068284 405344241 1143960364 555236321
993585951 ...

result:

ok OK

Test #41:

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

input:

2628
389685415 594223296
984795236 580001910
69984840 216587835
740542921 957664596
208732802 147643622
602750930 558196865
6048763 287466399
505775712 578287422
364564242 369623336
224061783 783665096
47495049 177271623
683382634 359411102
282948812 319946347
978450856 558245114
918096566 126955568...

output:

Yes
999186466 161315099 1516106844 678235477
998131259 803310451 1497669718 303771992
996916331 252124880 1320627561 575836110
996762346 501701634 1079301691 419162289
995215337 285802025 1020354032 260663330
994831125 222705010 1635690072 863563957
994253826 838490274 1827520315 5223785
993936358 4...

result:

ok OK

Test #42:

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

input:

2076
399065671 442779788
743637008 949773962
12395294 34908944
365105274 981384389
587409243 284397432
176015319 809805811
353318436 984291711
111221472 886727844
965941359 636204219
403173736 504088293
87519414 53689170
732783010 572873469
816893520 495899392
168141862 96767679
246085357 464027569
...

output:

Yes
999266454 169205663 1551615332 721554541
998081336 455333343 1233333328 220081351
997604390 744976390 1576409999 166170781
996730754 156935775 1580026816 740231837
996127257 577396430 1248598466 324925221
994598130 311421120 1581062211 897885201
992500764 816974676 1330576363 478899077
991820785...

result:

ok OK

Test #43:

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

input:

2498
280903830 174718425
813670529 238629463
283725484 38309897
114298365 455529619
747986651 461550776
306370695 341343058
189794912 223957421
294431206 396553413
804251214 799008642
582841885 687146161
261572574 861421289
361344077 390450552
752480589 501423163
613957692 208687502
74581181 6550971...

output:

Yes
999078411 744788654 1095810466 841520709
998965246 729383627 1516482049 211866824
998327322 616430115 1204721130 822823923
997632729 823121871 1117988686 943477828
996928928 386678304 1362266220 21341012
994925883 185337279 1062355141 117908021
993867563 924242687 1044587675 873522575
992798804 ...

result:

ok OK

Test #44:

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

input:

2934
330167197 653129937
604961193 173412303
322404584 140056422
693154888 970034900
575366968 384136343
80551344 152808593
83601607 848405462
55404928 431095245
311370387 563069304
324637057 621253420
541290736 162038821
159000468 790331120
96262616 631484979
899280377 620848473
130427946 693611640...

output:

Yes
999174640 173772872 1190721005 365319237
998730688 893355932 1018511749 913136993
998106564 289419977 1286239706 577553119
998004837 306698185 1245566276 59136746
997127417 954070600 1646332864 304865153
996522248 83355506 1262489584 349322842
996223600 887459403 1490806857 392876146
995125666 8...

result:

ok OK

Test #45:

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

input:

2368
856962170 568179359
512435279 573981782
143300231 765081536
101674855 229932928
184648255 757186803
368591572 439210768
314838186 757405435
904166958 415286366
207199209 338451563
318724290 816434416
206773578 235641446
340809201 837557810
748280615 296150215
239166950 348118255
233484969 79462...

output:

Yes
999289605 86875114 1332486395 420071904
998585233 907305204 1711892984 193997453
997839920 827186470 1010127816 814898574
996824125 608604770 1275864015 329564880
996144584 796110665 1685215940 107039309
995604813 177814924 1458771038 640981149
995332648 461685965 1191751181 658104498
995041759 ...

result:

ok OK

Test #46:

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

input:

2804
874513459 381478591
112802727 268783767
998148331 746740649
44890934 940256360
575830494 170636795
33853513 33905016
926736050 604443462
597296525 182482179
30125759 305024696
903302305 439333735
6285182 240558618
368382170 237163316
836857326 77038340
685163950 633917613
88784933 419758571
407...

output:

Yes
999779059 298736448 1064117798 363075187
998148331 746740649 1028941206 715947774
997971789 497210503 1166189886 328992406
997470344 716992218 1142226006 861747880
997043597 964212289 1004718620 971887312
996666499 917680546 1811134602 103212443
994926507 529958969 1298499972 226385504
993284852...

result:

ok OK

Test #47:

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

input:

2224
469555311 774606068
24361972 939396681
245196227 403455315
407705105 395972525
633815668 34551658
256206442 613560211
971113225 182777725
163157423 51104239
983473563 577886739
130189140 518315163
286610889 471757639
565050490 399212972
628596286 472440192
380733220 449882740
401360494 95561397...

output:

Yes
998985612 54356627 1089149101 144520116
996993243 851538344 1382411204 466120383
995845424 300181785 1438572237 742908598
994382449 401101058 1284235224 690953833
994188427 505000720 1155325337 343863810
993905950 67404535 1690640924 764139509
992868263 787737088 1467933873 312671478
992594681 5...

result:

ok OK

Test #48:

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

input:

2618
933433955 522011329
845775674 603699415
498645297 188329460
985819714 5857128
55699127 70687813
844784136 572652045
504398507 77702153
975614237 581176185
83535978 841238169
971961126 138364276
988188100 627362174
248796993 949934009
550410309 527416012
20018706 439344282
879519555 303750460
98...

output:

Yes
999393135 30435476 1020432186 9396425
998883697 980247807 1477278681 501852823
998717649 799911686 1108457125 690172210
997170527 604326896 1085241117 516256306
996361837 410624482 1095580846 509843491
995510975 418727291 1372586324 795802640
995442758 673420059 1281510992 387351825
995203171 61...

result:

ok OK

Test #49:

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

input:

2052
608532653 302981541
269702941 803607754
174716187 91286529
484031729 148170953
392034093 23176685
24848686 50513669
595214113 267333379
483145263 671916295
938869102 27989442
259602065 354235410
206266411 792055265
738739900 252787875
50253083 506153108
381456211 969158195
189169265 812996889
4...

output:

Yes
999273972 950451956 1582369576 367356352
998640991 285434251 1246472470 533265730
997396692 695449661 1231805810 461040543
996100576 796697662 1194082484 994679570
994223394 965775994 1074543586 885455802
992655650 92957495 1688630055 788931900
992018487 145355594 1114038577 267375684
991367854 ...

result:

ok OK

Test #50:

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

input:

2474
451056557 875690289
4822039 191237344
44831807 867454157
401841859 740910161
805237333 426130401
172069550 218368873
611631390 973475424
273472975 124133897
122778549 521029592
154635724 26188695
853340763 183030191
807843527 301183899
975192707 314460943
447525559 458980286
680904337 152786414...

output:

Yes
998310090 429377681 1242450384 673517975
997762986 486962263 1404603963 80121286
997465421 2758318 1029419074 34711971
997258938 702651488 1334868742 365041684
997068452 737299387 1274017327 460350512
996893555 627279553 1172614417 451558691
996358444 634735428 1476565890 154527982
995422863 459...

result:

ok OK

Test #51:

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

input:

2924
871070968 375012729
461198291 661189068
358965255 802100813
559380743 374009444
295308859 869483642
286446724 961119666
543951460 90729205
641564712 242495204
330598076 910293316
551663022 618982555
634443826 800286914
510800990 790455831
514797467 247306864
353101895 773935396
629914984 838583...

output:

Yes
999484237 871333214 1683544480 187272971
998754205 440155292 1310228580 751629667
998659837 582309853 1131019802 449949888
998463092 288292968 1233586330 53169730
998326645 847766979 1033385898 812707726
998171833 405010583 1172789483 579628233
997534904 447121462 1185084501 259571865
996523628 ...

result:

ok OK

Test #52:

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

input:

2344
163543237 747367664
228766415 301960025
538372090 48115589
841550414 457534094
862248649 353236425
662947543 983798714
955128707 466205603
292453149 874111128
420249437 900813281
707860200 684760558
308189423 107471944
104788497 927073937
167629739 714756177
454669346 672637361
331168537 768582...

output:

Yes
998730246 794080845 1376883373 415927718
998065362 344755588 1640131934 986822160
997629969 297101468 1087880717 206850720
997356807 525138374 1177326058 705107625
995861330 897532241 1335656844 557736727
995033558 223539122 996374590 224880154
993290767 113303315 1737216124 857228672
992842882 ...

result:

ok OK

Test #53:

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

input:

988
851382909 40118653
851382908 40118648
851382923 40118663
851382912 40118676
851382945 40118671
851382923 40118651
851382924 40118664
851382941 40118651
851382954 40118674
851382903 40118653
851382922 40118678
851382905 40118657
851382919 40118667
851382933 40118657
851382916 40118652
851382939 4...

output:

Yes
851382954 40118680 851382956 40118678
851382954 40118676 851382956 40118674
851382954 40118672 851382956 40118670
851382954 40118668 851382956 40118666
851382954 40118664 851382956 40118662
851382954 40118660 851382956 40118658
851382954 40118656 851382956 40118654
851382954 40118652 851382956 4...

result:

ok OK

Test #54:

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

input:

2000
241018020 288568153
241018031 288568140
241018052 288568101
241018029 288568060
241018040 288568153
241018039 288568118
241018054 288568075
241018039 288568080
241018019 288568126
241018058 288568143
241018045 288568074
241018058 288568097
241018026 288568087
241018038 288568115
241018021 28856...

output:

Yes
241018058 288568157 241018060 288568155
241018058 288568153 241018060 288568151
241018058 288568149 241018060 288568147
241018058 288568145 241018060 288568143
241018058 288568141 241018060 288568139
241018058 288568137 241018060 288568135
241018058 288568133 241018060 288568131
241018058 288568...

result:

ok OK

Test #55:

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

input:

170
459989260 497002203
459989266 497002201
459989252 497002203
459989263 497002194
459989259 497002198
459989264 497002203
459989251 497002194
459989258 497002203
459989254 497002203
459989261 497002200
459989260 497002199
459989255 497002194
459989255 497002190
459989264 497002197
459989259 497002...

output:

Yes
459989267 497002206 459989269 497002204
459989267 497002202 459989269 497002200
459989267 497002198 459989269 497002196
459989267 497002194 459989269 497002192
459989266 497002205 459989268 497002203
459989266 497002201 459989268 497002199
459989266 497002197 459989268 497002195
459989266 497002...

result:

ok OK

Test #56:

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

input:

180
400125567 423059125
400125570 423059126
400125566 423059138
400125566 423059136
400125571 423059145
400125565 423059143
400125571 423059139
400125570 423059142
400125561 423059131
400125572 423059130
400125564 423059140
400125568 423059134
400125565 423059129
400125565 423059127
400125571 423059...

output:

Yes
400125572 423059150 400125574 423059148
400125572 423059146 400125574 423059144
400125572 423059142 400125574 423059140
400125572 423059138 400125574 423059136
400125572 423059134 400125574 423059132
400125572 423059130 400125574 423059128
400125572 423059126 400125574 423059124
400125571 423059...

result:

ok OK

Test #57:

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

input:

1280
841397122 99741629
841397119 99741612
841397164 99741619
841397133 99741606
841397133 99741632
841397160 99741631
841397106 99741619
841397133 99741624
841397104 99741607
841397130 99741631
841397151 99741608
841397123 99741624
841397148 99741623
841397152 99741625
841397112 99741625
841397147 ...

output:

Yes
841397167 99741644 841397169 99741642
841397167 99741640 841397169 99741638
841397167 99741636 841397169 99741634
841397167 99741632 841397169 99741630
841397167 99741628 841397169 99741626
841397167 99741624 841397169 99741622
841397167 99741620 841397169 99741618
841397167 99741616 841397169 9...

result:

ok OK

Test #58:

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

input:

1642
955215437 72831116
955215435 72831062
955215457 72831058
955215453 72831066
955215459 72831116
955215454 72831105
955215439 72831090
955215471 72831104
955215451 72831116
955215452 72831053
955215441 72831110
955215478 72831057
955215479 72831068
955215439 72831050
955215475 72831088
955215440 ...

output:

Yes
955215483 72831116 955215485 72831114
955215483 72831112 955215485 72831110
955215483 72831108 955215485 72831106
955215483 72831104 955215485 72831102
955215483 72831100 955215485 72831098
955215483 72831096 955215485 72831094
955215483 72831092 955215485 72831090
955215483 72831088 955215485 7...

result:

ok OK

Test #59:

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

input:

1000
339769684 356922348
339769688 356922316
339769665 356922351
339769669 356922301
339769681 356922301
339769670 356922356
339769687 356922303
339769675 356922355
339769686 356922360
339769684 356922306
339769687 356922369
339769663 356922343
339769678 356922300
339769681 356922363
339769676 35692...

output:

Yes
339769688 356922372 339769690 356922370
339769688 356922368 339769690 356922366
339769688 356922364 339769690 356922362
339769688 356922360 339769690 356922358
339769688 356922356 339769690 356922354
339769688 356922352 339769690 356922350
339769688 356922348 339769690 356922346
339769688 356922...

result:

ok OK

Test #60:

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

input:

2310
471261611 788524318
471261610 788524369
471261614 788524531
471261614 788524360
471261615 788524431
471261609 788524424
471261612 788524320
471261611 788524475
471261610 788524336
471261613 788524490
471261618 788524430
471261610 788524334
471261610 788524356
471261611 788524345
471261614 78852...

output:

Yes
471261618 788524546 471261619 788524545
471261618 788524544 471261619 788524543
471261618 788524542 471261619 788524541
471261618 788524540 471261619 788524539
471261618 788524538 471261619 788524537
471261618 788524536 471261619 788524535
471261618 788524534 471261619 788524533
471261618 788524...

result:

ok OK