QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#71765#3553. Hamburg SteakHe_Ren21 1947ms11352kbC++143.3kb2023-01-12 01:00:542023-01-12 01:00:57

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-12 01:00:57]
  • 评测
  • 测评结果:21
  • 用时:1947ms
  • 内存:11352kb
  • [2023-01-12 01:00:54]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = 2e5 + 5;
const int MAXD = 4 + 5;
const int C = 1e9;
const ll linf = 0x3f3f3f3f3f3f3f3f;

struct Rec
{
	int xl, xr, yl, yr;
	bool valid(void) const { return xl <= xr && yl <= yr;}
	bool isin(int x,int y) const { return xl <= x && x <= xr && yl <= y && y <= yr;}
	ll area(void) const { return (ll)(xr - xl + 1) * (yr - yl + 1);}
	void read_self(void){ scanf("%d%d%d%d",&xl,&yl,&xr,&yr);}
};

Rec operator + (const Rec &a,const Rec &b)
{
	return Rec{max(a.xl, b.xl), min(a.xr, b.xr), max(a.yl, b.yl), min(a.yr, b.yr)};
}

int n,d;
Rec p[MAXN], dat[MAXD];
bool valid[MAXN];

vector<int> solve1(vector<pii> vec)
{
	sort(vec.begin(), vec.end(), [] (pii x,pii y){
		return x.second < y.second;
	});
	
	vector<int> res;
	int lst = -C;
	for(pii t: vec) if(t.first > lst)
		res.push_back(lst = t.second);
	return res;
}

int dsc[MAXN * 2], dcnt = 0;

void print(int cur)
{
	for(int i=1; i<=cur; ++i)
		printf("%d %d\n",dsc[dat[i].xl],dsc[dat[i].yl]);
	for(int i=cur+1; i<=d; ++i)
		printf("1 1\n");
	exit(0);
}

void dfs(int cur)
{
	if(cur >= d) return;
	
	Rec lim = {-C, C, -C, C};
	for(int i=1; i<=n; ++i) if(!valid[i])
		lim = lim + p[i];
	if(lim.valid())
	{
		dat[++cur] = lim;
		print(cur);
	}
	
	if(lim.xl <= lim.xr)
	{
		vector<pii> vec;
		for(int i=1; i<=n; ++i) if(!valid[i])
			vec.emplace_back(p[i].yl, p[i].yr);
		vector<int> res = solve1(vec);
		if(cur + (int)res.size() > d) return;
		for(int y: res) dat[++cur] = {lim.xl, lim.xr, y, y};
		print(cur);
	}
	if(lim.yl <= lim.yr)
	{
		vector<pii> vec;
		for(int i=1; i<=n; ++i) if(!valid[i])
			vec.emplace_back(p[i].xl, p[i].xr);
		vector<int> res = solve1(vec);
		if(cur + (int)res.size() > d) return;
		for(int x: res) dat[++cur] = {x, x, lim.yl, lim.yr};
		print(cur);
	}
	
	auto chs = [&] (int x,int y)
	{
		vector<int> use;
		for(int i=1; i<=n; ++i)
			if(!valid[i] && p[i].isin(x,y))
				valid[i] = 1, use.push_back(i);
		if(!use.size()) return;
		dat[cur+1] = {x,x,y,y};
		dfs(cur+1);
		for(int i: use) valid[i] = 0;
	};
	
	chs(lim.xl, lim.yl);
	chs(lim.xr, lim.yl);
	chs(lim.xl, lim.yr);
	chs(lim.xr, lim.yr);
}

int main(void)
{
	srand((unsigned long long)new char ^ time(0));
	
	scanf("%d%d",&n,&d);
	for(int i=1; i<=n; ++i) p[i].read_self();
	
	for(int i=1; i<=n; ++i)
		dsc[++dcnt] = p[i].xl,
		dsc[++dcnt] = p[i].yl;
	sort(dsc+1,dsc+dcnt+1);
	dcnt = unique(dsc+1,dsc+dcnt+1) - dsc - 1;
	for(int i=1; i<=n; ++i)
	{
		p[i].xl = lower_bound(dsc+1,dsc+dcnt+1, p[i].xl) - dsc;
		p[i].yl = lower_bound(dsc+1,dsc+dcnt+1, p[i].yl) - dsc;
		p[i].xr = upper_bound(dsc+1,dsc+dcnt+1, p[i].xr) - dsc - 1;
		p[i].yr = upper_bound(dsc+1,dsc+dcnt+1, p[i].yr) - dsc - 1;
	}
	
	dfs(0);
	
	while(1)
	{
		random_shuffle(p+1,p+n+1);
		for(int i=1; i<=d; ++i) dat[i] = {1,dcnt,1,dcnt};
		
		bool ok = 1;
		for(int i=1; i<=n && ok; ++i)
		{
			int pos = -1;
			ll mndec = linf;
			for(int j=1; j<=d; ++j)
			{
				Rec nxt = dat[j] + p[i];
				if(!nxt.valid()) continue;
				ll dec = dat[j].area() - nxt.area();
				if(dec < mndec) pos = j, mndec = dec;
			}
			if(pos == -1)
			{
				ok = 0;
				break;
			}
			dat[pos] = dat[pos] + p[i];
		}
		
		if(ok) print(d);
	}
	return 0;
}

详细

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 4ms
memory: 5772kb

input:

1936 1
275634612 269663887 525116613 936487725
97408668 7442476 814869170 687312206
436819238 107950642 958111100 591552952
7518596 205530980 782566587 854412425
496572510 309198877 998274921 764947740
205948014 311140816 696959672 600779117
332275583 5172242 984611829 780400859
404519140 226954535 ...

output:

500095467 495713566

result:

ok good solution

Test #2:

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

input:

1918 1
101495422 186906933 732615030 881441564
458968315 389772762 517376914 972253676
310129691 156509236 593443672 871966220
91341901 261855863 618682147 864249047
98953032 286357489 522693657 556560771
364790412 127843696 903079225 858654564
329423949 270896020 835948130 589093351
409677593 11179...

output:

508672104 489724537

result:

ok good solution

Test #3:

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

input:

1934 1
149390016 218273120 829091825 943957108
465523240 256616763 562611479 561076814
346779336 19349510 498782244 682919444
355187765 473117629 640518942 857154270
428523527 118919644 980443851 505620423
466172753 4854201 565577102 807575992
63057309 306335591 995966133 973208230
277575294 4065971...

output:

484482652 483569842

result:

ok good solution

Test #4:

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

input:

1943 1
447209427 299197697 579958454 975073773
487022253 6405471 553460639 504906460
483616875 87124408 626036564 533315255
33872888 223251549 940210689 985284538
357235178 224597124 537290418 632810537
45568075 166890122 737266711 881843529
465884824 148626173 976612493 608624682
90616486 330697147...

output:

499714107 499094214

result:

ok good solution

Subtask #2:

score: 1
Accepted

Test #5:

score: 1
Accepted
time: 1ms
memory: 5768kb

input:

1928 2
257715250 61165602 852430884 888048968
291121137 322570367 570606015 908598504
418176729 319924920 611676731 632485660
33180758 215166338 468783003 795212414
441068331 188624227 750676748 613482091
344172819 322492096 940801573 568738370
246507550 338324125 785514636 678843646
100885653 12352...

output:

553348827 550579979
376616176 496147660

result:

ok good solution

Test #6:

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

input:

1997 2
56211994 316470697 834713588 994523430
210478797 475173819 947781150 830967427
165103446 297758631 889994221 924850963
249357370 47257846 820487698 384771182
162610336 510100040 380663547 767626913
508466455 49691754 723323852 412277960
131060304 545781419 581816995 764877614
379085656 131818...

output:

374987445 635182732
566952159 276650359

result:

ok good solution

Test #7:

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

input:

1983 2
204160868 21434609 619569093 419612823
650017460 281474754 895990764 785667819
380641696 236469916 877153850 852686897
203449277 387435289 686969401 635759001
132439030 195606237 794176973 706698986
236398621 327500497 916585457 568573045
442492121 47713234 731946311 876216894
101329270 20133...

output:

654278063 611122488
341548270 380173393

result:

ok good solution

Test #8:

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

input:

1927 2
84940980 522277093 260891524 793244990
384934285 38785843 900770889 434210128
199669511 213031387 453964414 825455871
290488834 165464958 702318022 734713302
319378907 206155011 899116385 411844223
673210281 272100440 968736716 922477775
499361810 316451568 937970665 408881023
402763794 13667...

output:

256099697 689846929
675273190 355377171

result:

ok good solution

Subtask #3:

score: 3
Accepted

Test #9:

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

input:

1980 3
580358104 434053443 986861108 684634218
125969708 5379869 593299091 644204766
366688051 54873592 662708561 602035535
211630750 166795940 981075947 676159693
524950613 414516203 951984898 573261034
10925143 210994662 543601795 609644115
82102881 63393894 401995062 922075556
245641393 276511435...

output:

275355682 497455773
437786479 497455773
816253792 497455773

result:

ok good solution

Test #10:

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

input:

1979 3
166188766 501732855 696148516 858594442
448642394 649848030 826585058 892841834
227996253 41181673 597994927 735947663
496120536 146174371 797127295 937876819
142223416 54620669 692019448 761376043
155423015 310182182 964649015 766725969
149600215 175625826 795416544 456728413
409645085 19620...

output:

502336852 173446283
502336852 417006429
502336852 779897623

result:

ok good solution

Test #11:

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

input:

1970 3
6326130 464942284 388518354 882271741
66547837 401410194 771818574 964118705
431296737 152301456 768358217 594183143
100119464 369214977 761673174 593619290
554322598 400289117 890806483 611831145
468030782 120235085 570300617 574227571
536074322 234244025 972122902 923424073
23842325 1375292...

output:

183975187 505601682
503115886 505601682
840903510 505601682

result:

ok good solution

Test #12:

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

input:

1902 3
46256098 223546319 976063314 679892427
208941639 360798602 514564801 525784990
495657906 481262200 583411507 834786567
114474902 217453369 507936464 977145349
438812862 137761110 659874190 748450508
150051630 320174167 709890617 749271580
461931817 349133710 721176664 894961254
191481592 2311...

output:

505976751 463511684
505976751 494442549
505976751 702759714

result:

ok good solution

Test #13:

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

input:

1907 3
529222873 269079360 606281098 544233180
314098028 205582496 956371826 693781800
597306909 130431170 803836008 957760548
408036487 187293717 724824626 505243368
350711336 299117505 435879209 571407168
174973325 274977214 964591728 872823303
510414120 308728615 922852742 648065611
189182981 254...

output:

425510600 493167932
553268752 493167932
756539307 493167932

result:

ok good solution

Test #14:

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

input:

1970 3
247787183 554327787 833105239 866790305
120159458 77503852 873229562 905079773
185669053 286943969 889204476 523300675
380807551 291006183 835038004 557132574
75131701 112833287 948346627 443744421
354678253 96682911 955772616 484278967
433630055 398080908 741228310 947667112
3270468 34884373...

output:

504095743 385721557
504095743 455015020
504095743 816980623

result:

ok good solution

Test #15:

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

input:

1932 3
63246664 100992328 708815832 279735345
587087611 695076361 990493105 950911045
51692549 99485997 687018700 357429553
152292750 738983462 949997376 855566683
342538620 308426803 888779255 910042046
240526865 363218287 878993972 988330889
270212614 40812223 790412608 864162583
25359443 83389322...

output:

736731527 771629864
640705316 606145173
176213793 189284457

result:

ok good solution

Test #16:

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

input:

1916 3
177572158 724583533 540234450 904554416
267369796 380070616 780117040 973060129
271971234 17096943 908591131 436843715
343216202 326902387 763886033 489700904
77694275 111501224 554830396 834241644
305611167 222890871 895960336 810316211
274217306 278623998 739543117 517845242
98047272 523947...

output:

351327481 172138060
457757921 724583533
631243423 412816534

result:

ok good solution

Test #17:

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

input:

1986 3
50370685 564974141 517447899 626859754
290403857 439740409 966398613 890084642
363701202 30452895 449830367 554343663
294071422 123301420 755546036 483953457
618526954 292249067 929008451 802553666
153152857 418218642 397240018 615340111
127901474 131047582 985814369 846609868
758940033 25544...

output:

815554782 765102090
318567292 607143603
442116145 186361309

result:

ok good solution

Test #18:

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

input:

1980 3
49055418 26594830 878065955 458992721
175565587 140992858 860081861 483037333
592310645 231160044 935143231 390319308
591563377 140688524 804292136 554239155
15503825 311227505 566477369 897233076
305007998 761677 476149155 806208238
100347880 212400147 798013078 400347267
152200691 414691841...

output:

741919218 292379778
512060727 820887208
361569557 458623119

result:

ok good solution

Test #19:

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

input:

1946 3
553964876 198366022 735961267 747973965
126751558 350666112 820185374 737833681
526593879 168920877 936585720 482184996
366274354 276431252 778301302 723859870
3906875 159531834 681152746 954186370
5409777 349752268 338727431 846372910
177333228 107627879 561372804 901194257
705266251 1996475...

output:

214819322 587203190
717435782 452117665
544649083 446520816

result:

ok good solution

Test #20:

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

input:

1966 3
471416424 17433287 993040479 864827577
514017599 212295643 811651444 423813323
59041160 164066307 680540326 813041079
1873174 132734550 891643182 759831555
265634109 229785629 980700938 778640532
394907240 298883493 805132161 822619876
139436176 403381320 868556470 494816116
440721489 1135386...

output:

213791895 657511646
509787502 473732048
551291376 317349374

result:

ok good solution

Subtask #4:

score: 6
Accepted

Test #21:

score: 6
Accepted
time: 4ms
memory: 5928kb

input:

1989 4
20688201 462820019 870557654 779905491
299122723 258293216 630017062 521792413
430322558 33567880 691187720 757852374
104994597 262388698 979697437 904439328
237383344 375297588 673858769 638443621
715773360 364818076 896724313 888051478
235043050 422124296 833892854 936850257
434942952 25412...

output:

302871638 495357540
433193317 495357540
489301131 495357540
740481982 495357540

result:

ok good solution

Test #22:

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

input:

1913 4
447764235 131766500 662143128 594925961
175752030 143370745 850970381 604940594
315760617 440375785 908808188 914216196
111980814 70287311 781633529 646769135
18056623 198611867 512791707 850722100
131263504 97431361 865097956 701669444
262211923 224930035 533039033 706346045
107163409 354652...

output:

507482141 232977509
507482141 464549938
507482141 596063455
507482141 600026992

result:

ok good solution

Test #23:

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

input:

1920 4
403612171 130212084 610839654 977155495
174635909 382477705 375033887 769530611
340136940 313829516 474317741 726135356
143616239 178727187 803624314 507947866
577185790 343964260 782890837 795447335
110525706 212833414 627795187 902056221
422130567 424467473 774573585 903486772
3517217 11536...

output:

239694881 493355384
430918444 493355384
701564602 493355384
753054834 493355384

result:

ok good solution

Test #24:

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

input:

1976 4
7843810 299539661 895205452 838927376
179469298 530734693 839498393 906942557
425264917 463297089 997915975 587521801
215733519 172023687 820614514 421745698
382289292 316607805 946907834 645956684
102596607 119790611 920274659 594156596
145606189 94403987 789918902 982580694
85701841 3496293...

output:

516004179 230445290
516004179 306641042
516004179 520737534
516004179 620914908

result:

ok good solution

Test #25:

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

input:

1968 4
569762634 413660945 933413828 907592006
553091331 263501907 981114109 510693822
407556498 479794645 954385716 677978739
77839764 401024402 183593148 732012557
616679205 368473631 728570013 616691885
452758528 188719816 688654834 653247648
319982735 473076444 920731787 879714237
362388115 4204...

output:

129392334 493681669
467581076 493681669
676207502 493681669
784152404 493681669

result:

ok good solution

Test #26:

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

input:

1970 4
308538176 235176379 968596168 680491401
241796248 642213758 896200579 966943854
34154047 430842591 988563099 762275468
127220131 391604701 725954185 805334309
406770564 392602905 660975191 797637410
405127709 114423654 637785229 245574946
249335622 304910296 692529558 647952360
279608285 3767...

output:

499057790 232638246
499057790 476392522
499057790 505431008
499057790 717993694

result:

ok good solution

Test #27:

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

input:

1995 4
218769975 589730993 868473449 983195504
99642551 105395469 263017574 322188569
10919242 366513432 998689738 441858800
242833555 350501403 626327785 862719993
98060564 109694549 535508020 957577096
282072403 179186084 803555658 952336184
272714476 245127036 731196128 684098817
551460894 513882...

output:

695139406 751282560
491696792 546211507
467269428 387429400
155513147 211870480

result:

ok good solution

Test #28:

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

input:

1982 4
426949385 131714564 807283432 920017811
681701387 341683408 962502629 853492031
150366255 58801937 994183172 506912367
170582291 304917278 573455982 749277224
258634785 197971430 663392013 592199945
61772927 246608932 801989071 909214540
108026935 615182713 831539950 841653460
293024629 23604...

output:

352103002 347195601
409529635 433195718
560692614 647566206
861767133 519371631

result:

ok good solution

Test #29:

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

input:

1900 4
617520846 117107209 809472403 913200812
426498070 381113687 770146243 522259248
549730872 94684770 835269469 881681730
563441545 623964334 929665007 758099214
5962426 286476650 461123705 552654478
563935094 369388433 825054455 821111560
218014430 244951533 505453507 652014993
528168480 265162...

output:

688323334 648724363
327115420 357707049
422375404 518755987
680760485 388449489

result:

ok good solution

Test #30:

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

input:

1981 4
300187896 102407718 708293808 416146054
259455020 308527790 399142133 746586731
255681108 5321200 478894889 440673528
172630942 62286936 698772181 945787834
248831023 411230403 789152091 871760508
73740044 74951893 436158727 884945481
351127637 300434778 699446627 998101960
630545836 15659997...

output:

371903437 397262875
727160291 453975143
522094003 661466599
467163313 561479700

result:

ok good solution

Test #31:

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

input:

1941 4
198394045 40501208 916852793 467941792
487379800 379216416 897580598 623866329
112442062 249553534 942327554 544679843
332432922 146235393 710647392 776209246
119455665 175492372 454458187 465736425
300289837 84205556 606971096 545736407
285015378 4419205 849221733 961164558
345235452 1055359...

output:

274679662 405489227
372276093 804731267
729325830 551987017
562667288 414203734

result:

ok good solution

Test #32:

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

input:

1981 4
339864661 101587787 800325844 750257893
41052453 410067996 878524623 742949576
418040438 505114475 661154604 893368422
369270081 286991943 742717995 782091382
83633854 288037382 662429215 926186132
708859663 225501229 763792090 708635072
44130106 148564103 799584907 594021945
62174186 3187265...

output:

353230495 499152097
447421182 521490751
496671288 499977778
753208227 499977778

result:

ok good solution

Test #33:

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

input:

1914 4
40324289 463068788 686255624 992706105
212289663 86919854 896629497 506440279
219922144 135411105 873536560 680589305
133956206 633781643 810520929 830212444
565029213 59592821 705728627 727824083
155552392 127921482 980632954 623751529
373600461 502035120 687481784 839166306
116516093 784107...

output:

575607199 754833318
567128158 521354128
360872375 434162482
533493466 219968945

result:

ok good solution

Test #34:

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

input:

1977 4
66610685 179639653 836791382 812555693
408688520 363105163 768496299 694212380
89843734 313691087 537686074 969200777
82828452 442214288 456489920 590434797
14884004 367834652 501863806 543663119
680239044 22615069 899033577 816722401
83423894 68582482 728548810 639462793
52738505 18625559 60...

output:

387674198 385649533
456632780 710133109
352925164 500715003
729084344 685821039

result:

ok good solution

Test #35:

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

input:

1972 4
281913248 534103689 972324271 775389914
179063634 179490281 752451835 912511705
246085611 475666019 984851978 886179832
96950059 188107469 808088839 992211332
204796670 146828775 882215913 621358293
294236758 413935313 579214080 911802982
267125047 241537972 760753880 675372817
58627220 35226...

output:

674648313 609762175
472502683 223703035
420842631 501599828
320052002 465721851

result:

ok good solution

Test #36:

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

input:

1971 4
568716061 91247185 700051722 445205455
176289242 142172799 985052244 953993361
209805919 166298212 430770370 995442523
100211109 183871289 425793481 819072437
208822853 225344411 740324538 657083265
471544734 176232915 826120811 925255360
97311526 428364591 552724783 577287466
383189784 24839...

output:

595170671 258726130
535446593 617738976
483958442 566205138
248321729 335657311

result:

ok good solution

Test #37:

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

input:

1984 4
522109852 167978751 875389385 637959739
394461828 583016362 902173264 964827833
268115028 226739042 948058054 916620565
393040802 79447697 679093510 450139612
391159244 95130115 939410585 668264815
444287924 70729415 929857948 547641024
471306145 171933194 828849331 518150408
391100107 362012...

output:

594910103 434337308
366232298 390294144
408659539 758693302
584607656 191595129

result:

ok good solution

Test #38:

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

input:

1983 4
249607551 306331002 791181318 834069211
381085737 133185132 940179042 623418266
371231210 200639487 800380918 880089801
412667596 192842034 797083746 503794286
90598598 381452849 542244390 775285387
29976914 128890707 792957098 758925921
429550012 112546246 608807097 325990508
91819521 227558...

output:

527648770 297683154
197395058 479463379
468022082 731468091
477702697 524624811

result:

ok good solution

Test #39:

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

input:

1936 4
289232084 23212668 680332163 714137225
326906302 327166868 761003571 583505451
311588544 346526875 665880304 401279122
83594427 477676934 961016577 906473252
187909541 11696956 496621206 611596031
178850106 18727819 814467232 663241110
274282625 390783562 921459247 946587383
23932785 66653109...

output:

838893963 845361969
354262578 382563580
650828438 326208672
445144083 273524662

result:

ok good solution

Test #40:

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

input:

1942 4
59416478 84252025 349762960 375109218
56027695 571624862 453590445 803324210
250033729 65379351 545334477 435506530
66736014 147337520 923297198 227179581
351351067 302818275 931148581 979352613
193315138 570534173 956149633 875302264
7640661 270104734 202844795 676858161
51679408 45519200 38...

output:

621175959 669092734
308794908 210989633
687967315 401614309
172203744 610005648

result:

ok good solution

Test #41:

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

input:

1954 4
3142840 304370969 921291493 668221071
252652405 98889494 832043810 902522079
552815039 639679165 928896096 972906733
307535388 608130381 814832921 927097901
8090800 483512715 529339766 857085085
122203751 60602250 634403977 699191334
411284224 9710596 511004396 793698386
286417513 28509389 66...

output:

698417279 728552751
163291321 559857635
427194882 478466092
596038645 156718167

result:

ok good solution

Test #42:

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

input:

1992 4
322366236 192919951 878734868 882964570
21538742 319514789 200595196 491116985
532553201 147538504 963303693 999052233
62791181 189038860 734732966 937985237
417877264 85435389 546389238 883876189
253893859 25710636 926808513 915022344
654062958 271286919 998467193 709214668
688774595 6731289...

output:

731389764 451163727
633821864 772916545
169564728 463654450
430706895 460786671

result:

ok good solution

Test #43:

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

input:

1930 4
469873509 196184817 692234013 832347021
118016727 20124896 569847672 774011268
133411892 29659801 426702463 657782273
247189048 382945170 637634368 867122020
194687968 4686617 794556448 495229687
83474111 290269405 218151116 668536462
238631467 70987144 990897397 636617145
458921689 81339930 ...

output:

655030706 300393901
133411892 476331930
580549722 801008111
704774685 423732265

result:

ok good solution

Test #44:

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

input:

1941 4
43734802 194716208 624935435 999497361
99526274 371745405 647070235 659758391
467430727 648748 961643395 746695325
250532911 302251642 579153211 906521333
198432889 4217015 745748939 327748955
183875413 192902501 977627628 409257362
432150340 41868390 762695565 568926423
703380766 96134611 92...

output:

846653993 266768037
663113519 305263823
361236544 770831805
274171660 545387660

result:

ok good solution

Test #45:

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

input:

1933 4
128814815 2376542 514971171 992062360
252506690 158355923 695197209 402589925
113349428 402397124 728150290 829517386
60622334 190610136 658249700 674891171
310494982 181074103 864456543 303944347
150905238 278935614 340130389 724782629
187849856 118663444 634733985 773155729
245386647 930404...

output:

198707054 689089468
765153737 533879831
564599209 516532042
364870669 236201656

result:

ok good solution

Test #46:

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

input:

1994 4
688855969 4046020 871826896 637998504
118551561 543385114 297120467 907852500
468303145 399542649 863354198 658620056
363644709 92752685 561309837 696098202
494256092 196329183 548885708 957983615
518452256 272712654 857146498 583274616
336543593 118080569 517093654 496128776
375017713 171038...

output:

130486425 737795493
513289836 246098325
697054626 419507005
704070384 352907028

result:

ok good solution

Test #47:

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

input:

1989 4
441226672 424460637 707920673 506954580
208261759 235953645 545836777 619302024
493200672 124095711 889847719 379576547
7254373 244971947 567651256 936798487
353680949 371357353 770455774 826592159
192642315 171616151 549516590 499707151
281810795 7925758 909776339 664170718
121317797 4690625...

output:

393110097 855254653
536691748 554549651
469133990 486843985
523292484 168248914

result:

ok good solution

Test #48:

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

input:

1936 4
915774 304861960 932637043 448722087
302478474 704825587 398972605 722479723
49929567 253477856 813263965 941854589
71651772 82446883 583664486 999639266
400261295 89518290 901765646 380824770
208679814 240450327 798836953 760823387
302136586 6951075 778130139 765457539
14165207 3424116 81071...

output:

384163541 708239227
835800530 343061724
642351568 544946527
467557568 395422342

result:

ok good solution

Test #49:

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

input:

1946 4
162046254 328802779 836609011 546686583
97615812 99768383 657490130 829975103
223403895 569621312 407071756 852192450
365173306 316214028 742412564 677871008
42433303 489309749 539876758 871877180
430146279 487896841 472685370 567194655
360694921 283112980 819895202 438706468
228680812 183661...

output:

377117755 640315861
445185593 495000420
745616977 445938526
612752833 285849092

result:

ok good solution

Test #50:

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

input:

1917 4
402180205 196028307 789222076 498754655
203606811 275626491 700107319 694087628
122511157 453310561 465997959 992664169
221570890 208098563 619146913 853535131
312658458 154435318 815511524 863410653
30608642 65882244 315718678 876735195
337340672 96852696 611223065 718798921
78736482 7724732...

output:

159064560 872666537
437284681 406405076
586273796 381728781
711671342 369947025

result:

ok good solution

Test #51:

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

input:

1926 4
353748900 302939791 830811801 734782973
123677036 337018900 794089730 570066230
85313225 194391127 689402681 922407483
294850724 98843655 619576637 821429081
196769872 408852024 819850908 661712656
228309696 79858018 598557966 934878151
476464521 380777817 914075939 660635297
241769778 306978...

output:

425215209 724537744
247740524 417998823
605777310 393786334
521376878 314737677

result:

ok good solution

Test #52:

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

input:

1934 4
80541252 51092962 714318797 916100454
434621628 492812692 867419819 863317061
393631799 386025204 746888805 568857458
543934057 395569547 896754278 929475791
355622449 153180482 996688539 809901376
24554833 60056254 854458288 582921015
186476685 331089573 682560544 759752839
356151361 4262733...

output:

445913360 375706602
701582473 458743365
610523934 708260137
408131520 499544901

result:

ok good solution

Test #53:

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

input:

1914 4
43318989 102273641 475179131 634689142
217881733 232110906 468868763 713168967
88598080 386693266 388635184 871739649
111444440 87536374 895416689 767984768
437161413 13517617 892046290 491289820
624489947 6000648 864677732 518650892
171456660 33462127 922790623 505998100
209634184 277809015 ...

output:

660950376 478020468
323712370 660320271
297894496 401280124
564878552 272232571

result:

ok good solution

Test #54:

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

input:

1994 4
420755748 142517654 662489023 290235204
87939660 205967753 738944857 864137739
312327958 116522757 909863591 663894551
584013853 453368937 689508523 747495199
380448409 77350414 703778057 650013078
47862136 367044191 818717320 667519196
483490411 240867053 608398068 908588955
328965401 262407...

output:

506019298 578864410
657038631 478459140
294615698 330185551
489222461 276830929

result:

ok good solution

Test #55:

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

input:

1949 4
380644946 262203170 577180275 643192505
343960511 245774552 818136114 462017744
250659672 510296702 773996867 814158453
217101295 319742679 996964455 629171535
105974012 359400300 679648156 976500323
727917607 298043047 878750593 623546590
512730244 224467739 903867984 372466316
700775391 309...

output:

522471432 364386714
258659410 718976753
860468520 501995916
128502370 573645026

result:

ok good solution

Test #56:

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

input:

1973 4
323991769 46963971 710525952 733370350
370991043 178305655 841678841 806454609
51145711 288038550 909538078 971911351
368646706 344808861 774601261 796692116
278293172 268838371 831452039 495655426
253444461 399362756 582937343 856929186
53741841 7887776 751024094 973687790
118872100 28712998...

output:

568650667 451045999
464404099 278548590
485679060 763553522
381682337 591767223

result:

ok good solution

Test #57:

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

input:

1989 4
484211701 25551182 946011308 722061943
32690781 473846572 968799877 915978045
287128567 371745650 593853402 881417984
177350762 137133107 593938802 440806197
384821551 107079243 749730756 673685010
265223682 638726779 487169341 998652072
363646929 92087034 796985614 642069795
848103536 182850...

output:

676235589 237265644
264605700 354619268
372690841 809140789
864555170 528319317

result:

ok good solution

Test #58:

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

input:

1965 4
28605196 144652484 447607782 476458806
178946117 221700840 835982818 615437410
3917655 285463636 221115222 582268290
143323236 424973611 556543748 792999340
256574735 269248045 869788147 849668152
237967826 239179939 522138993 938453888
106721917 369945844 449123609 570905279
459486264 576161...

output:

478982086 851151821
776503419 523737710
398453909 165987074
146784082 454845565

result:

ok good solution

Test #59:

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

input:

1925 4
230010701 355930691 813152003 653699408
237979032 384402199 834428706 959241804
377100117 556419170 478993738 944324819
323365203 197039502 689020336 763293716
39047617 123883867 736698744 256911283
566775517 225332482 770431595 796576170
372914899 471268936 981507914 675442555
25062382 23022...

output:

592466856 156011028
320483594 541070897
451335226 747491263
603838709 518782174

result:

ok good solution

Test #60:

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

input:

1991 4
40502515 75359746 689538790 647941445
475907358 200589272 979082430 595822761
54624692 184565258 889484904 866683088
127421749 150156486 813276345 781115841
89744087 490858064 391410449 553713097
202766475 366815767 890677991 850375620
527300191 90478197 921590337 518168879
255622286 24569405...

output:

598085403 330409956
537967710 718571000
342387424 493675091
494418817 256073335

result:

ok good solution

Test #61:

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

input:

1990 4
274267715 2698909 917965221 462443028
654930783 484285364 956830908 788814281
443876959 238394634 851532869 871043013
168578329 4644196 483739956 471239329
357135214 67270511 891779548 677114350
470488060 363903925 795676509 449922593
435085998 369121341 870512980 428177722
383595234 27669290...

output:

196609260 394644680
734750308 637946325
531486148 375706176
409151137 644719995

result:

ok good solution

Test #62:

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

input:

1928 4
426711545 3544909 934792514 191968517
166664784 139513255 874374501 553473274
137516642 139137114 756810513 375776213
280852072 104638822 787050753 852825250
169127089 541719899 621620638 799738173
422616374 374770824 693247364 849719724
398455252 17800586 675268765 305193275
102151298 327174...

output:

304387358 357784198
556050465 817300208
429283931 160529808
577811015 674425262

result:

ok good solution

Test #63:

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

input:

1965 4
175771639 710410869 627845639 982060653
48373751 487199049 624315791 915301264
439695578 279243720 798149550 983034508
130927181 262925160 871506809 999025856
105360506 125942980 364197617 627737259
37056660 206443219 750433224 554674057
22012965 268891091 745962772 755527378
482351915 349563...

output:

300094475 583839291
579063146 382363352
510248909 775051275
764271853 541139379

result:

ok good solution

Test #64:

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

input:

1950 4
161677985 230389655 837190933 582484248
500633532 434274224 890756435 979673911
259177938 124275560 793567063 868963621
7661105 159765973 955423475 587730390
268173619 224096879 647061703 692885537
316342219 637398975 659155305 943784474
58436088 416285518 880334410 759942522
92263521 1821519...

output:

573247992 523194991
358766496 338988593
523086557 849394025
138957223 524807825

result:

ok good solution

Test #65:

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

input:

1976 4
106451422 314932750 727918657 735531299
37922358 181645364 572108905 982537974
456702561 425565860 947536260 769565971
184254859 180958279 761322721 683818897
279309262 369377739 466885906 922054068
87503069 571588743 845829834 901510602
307079696 116870935 729312224 470476599
300433012 41609...

output:

394407142 820730168
735485595 612322320
395190369 390253504
553771544 260797634

result:

ok good solution

Test #66:

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

input:

1947 4
626391872 467816233 954868418 707434746
614223781 486506210 879570006 855606799
22720068 99958270 717791540 658994617
221382339 64205949 457314594 386942391
303657344 401850377 542516682 870187657
128427868 25846678 461408282 709055898
230893013 215794077 463498264 676253420
406541266 7256972...

output:

323456721 404331968
550868800 687570336
438655145 199112524
819084834 548645245

result:

ok good solution

Test #67:

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

input:

1951 4
51348661 395636638 410632048 807797005
110387088 479077641 759588153 774001899
354179007 92487351 771967055 401809307
234535522 598541234 911026252 787754657
471751769 162787665 843027445 970518408
613982525 236679343 969787174 370166561
473159525 260095915 657801964 924528049
16201162 523512...

output:

374255179 658906650
654273731 294842581
162730653 586823955
471748049 236611741

result:

ok good solution

Test #68:

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

input:

1913 4
286732618 50643291 559526914 601972539
34297683 284002473 708961642 870006356
281133879 399029414 908442656 576018639
234227737 351617257 933523666 873028494
310419614 15787660 868299521 202969098
100202319 520963608 250581944 727550813
422790628 368266421 964806178 809407740
298292445 729426...

output:

411045429 189052732
675271349 548757132
151835239 584686429
512765829 802021876

result:

ok good solution

Test #69:

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

input:

1969 4
63376295 385586558 818358086 729314797
6019907 439151806 861129339 904444913
263756129 320370258 881987935 708577217
167237209 353583038 479948032 753179596
54496129 178139760 996647025 770804562
119263732 333643950 588882532 506261984
228309174 236135665 661828342 737435293
207781421 3493250...

output:

444801688 847595253
634382735 229621284
381756952 374338255
679520510 393159422

result:

ok good solution

Test #70:

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

input:

1946 4
353485236 350790611 911339588 625282706
30243057 92428983 999018042 567727364
373706006 372354908 934581193 929572719
437981523 367515874 783800081 597187283
27029857 96198401 625350055 778688415
548338873 125124890 769965988 508534870
320573915 529815549 535112207 768623405
274347935 1026108...

output:

453616123 547934961
168947824 333812081
691232855 480069545
247539727 215670809

result:

ok good solution

Test #71:

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

input:

1987 4
198626988 436339613 800287864 958029356
457478798 315697574 846581355 338043142
344697302 43630974 810131150 449000944
236912375 722085850 871843478 863422379
194251165 185941342 516325418 884821556
390182878 66810672 654815008 501000707
386014789 275635280 915960576 851592667
296174467 65700...

output:

315311342 846088379
543218974 325513502
720949951 423789359
171125897 657108753

result:

ok good solution

Test #72:

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

input:

1948 4
93352455 77864463 968068705 594017149
464298950 472243730 738700421 877338339
107537625 399574854 787373876 709995152
358866448 23744901 775662425 444667160
332257620 131264006 930375811 523358817
650391018 324923437 979829812 911958009
336444386 251703919 770820356 694313157
65842357 1067777...

output:

582906382 626946184
370517457 267347917
321703657 520698528
655073386 413379967

result:

ok good solution

Test #73:

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

input:

1933 4
342949856 155873710 554560255 721692918
724703365 199124534 727232254 985836078
373468703 519150369 535457464 723473409
279799889 616082189 737201452 761259904
726218999 343864646 970098680 878225553
458401180 260834570 817860252 871470745
449979539 274045412 721600512 712639852
297512627 376...

output:

139631349 491392928
726387261 517995572
462791406 716371480
480224556 370918716

result:

ok good solution

Test #74:

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

input:

1915 4
383496455 482940404 828327202 924294388
597912557 222109773 842938133 822869479
267451788 168837504 553174045 223545021
387814553 1149054 895031199 758101688
544925848 420660261 768393803 810768527
404463301 654541960 704396478 814627249
280109576 106313027 518632525 916807921
221207703 57628...

output:

140657932 370898977
662490889 728396971
345139315 220880511
785450348 659991352

result:

ok good solution

Test #75:

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

input:

1981 4
521348040 87077628 858375534 610586375
264317950 405182952 720011267 896592444
379809639 106323236 641893330 659744123
23484565 221208527 360307496 900791502
463360083 380208193 839395035 512329821
128081883 723477693 681555904 884161837
212103916 337087875 591874510 496148567
659815247 25637...

output:

350485188 414017222
548750561 171204459
418277491 772339060
675011726 413927161

result:

ok good solution

Test #76:

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

input:

1962 4
542208982 160374412 819805555 638274638
396521239 59469185 624506728 663061404
101413187 749209823 896394704 820600372
263059904 4579883 784968962 544668232
386742878 721875868 904784702 930259929
379766980 744461658 830880996 975046429
341751071 89732082 775232106 537885965
212974722 2273247...

output:

346996809 429121535
545824956 176825050
419793923 770145998
666537100 427854048

result:

ok good solution

Test #77:

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

input:

1911 4
184665914 337738017 581596392 567289108
480671369 166604944 982051051 624000680
211309447 400262954 702493689 866659747
348765258 738731693 628841696 865871495
215499739 327165379 530291929 992233298
317430392 299563916 511430371 960018840
422232904 67089067 662419717 566626833
242626089 7297...

output:

427998846 782653336
354685565 428249841
427413610 177511150
691974822 427964863

result:

ok good solution

Test #78:

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

input:

1919 4
256068170 224505457 685614371 584265571
127303681 148340046 942557397 447250632
258749019 723615271 603515840 882640207
15144698 70144920 756101963 999712169
298874225 410401788 564785413 662422916
164390870 757235579 709048967 877913225
262789118 142243827 815704250 544381914
39089047 772779...

output:

426333413 790573540
555416844 183567405
352143400 437303670
678205439 436558759

result:

ok good solution

Subtask #5:

score: 1
Accepted

Dependency #1:

100%
Accepted

Test #79:

score: 1
Accepted
time: 159ms
memory: 8696kb

input:

199927 1
438629555 351412894 521316748 962909150
4328400 108580550 683171263 836435313
256786425 198212822 578214653 567880535
256673124 384187605 616347107 546662355
17067286 405399036 782995564 759479522
41592585 336223869 779372332 767950897
144763906 27980775 808755799 769950439
190038989 499607...

output:

501216738 500047594

result:

ok good solution

Test #80:

score: 0
Accepted
time: 134ms
memory: 8596kb

input:

199992 1
468369692 51432142 943101549 608968278
127680231 369941094 634667730 516371960
1427728 371977761 569293553 552853223
257885457 347434207 972596280 837837513
12529484 152139714 579576459 897919247
336613920 369023033 998436991 994236118
199517636 485859301 866178585 867603970
240114269 23997...

output:

498944351 501259180

result:

ok good solution

Test #81:

score: 0
Accepted
time: 148ms
memory: 8664kb

input:

199959 1
238817589 70537254 695436468 882043893
416319574 329705088 750294846 997603367
122039910 48189248 775821782 942409460
123142019 92806058 723431298 750522560
4786698 304382499 682308754 815818931
464345660 36298510 907436621 659933836
147740222 250356542 768868832 810218769
141166042 2446879...

output:

497944813 499769052

result:

ok good solution

Test #82:

score: 0
Accepted
time: 181ms
memory: 8352kb

input:

199975 1
140647043 401141353 909868027 932502018
352011992 220163287 771463853 980296352
361128104 404877280 696161321 507368200
4311205 146503975 844576299 861932439
400068006 401139622 794199519 902157094
159967166 324845985 527699521 828787788
305950684 85836346 695843414 724376480
348091458 4722...

output:

500059611 498126287

result:

ok good solution

Subtask #6:

score: 3
Accepted

Dependency #2:

100%
Accepted

Test #83:

score: 3
Accepted
time: 176ms
memory: 9104kb

input:

199918 2
120131346 77408218 385230701 603879422
322694605 316832305 436940285 518702580
43726995 44300408 637761234 611102255
36673853 201875335 606907841 513041506
60233920 335410973 799230724 862894926
90506024 251509758 412928188 650895023
257294249 115745781 657383019 655218942
28527743 28457775...

output:

673198755 759438591
356729536 388996699

result:

ok good solution

Test #84:

score: 0
Accepted
time: 163ms
memory: 9696kb

input:

199908 2
219829579 366385065 765377164 886672156
415640058 268594236 622741172 681125291
420111470 29734676 820714837 570854050
85412885 315473755 606256796 877047556
105801564 412423558 704210784 531046873
290512976 354582925 471919030 915223704
138240289 286539766 938268559 784103062
61222781 4301...

output:

465712862 653939032
625395978 461628728

result:

ok good solution

Test #85:

score: 0
Accepted
time: 183ms
memory: 9108kb

input:

199911 2
313882508 329381056 603290061 845694461
419936367 213120829 725093054 887399996
131300121 81330851 781390832 481335750
441020776 19839413 870685478 719309092
87894202 93156113 868478516 487607115
317269438 13471684 601891293 602620272
303793201 368161050 652869088 878776629
255258735 174078...

output:

508654795 718418463
469049013 324752640

result:

ok good solution

Test #86:

score: 0
Accepted
time: 187ms
memory: 9572kb

input:

199987 2
403722895 187868812 930659884 577565245
11004096 515661078 383764415 979303869
128721411 625119892 953607434 775240188
115675984 686335256 843564384 793048325
589392504 183608781 699797457 724327720
99056359 721261339 611470792 789847488
217584910 49853542 956449750 617367241
144825449 3053...

output:

343173147 754652963
617046978 264362134

result:

ok good solution

Subtask #7:

score: 6
Accepted

Dependency #3:

100%
Accepted

Test #87:

score: 6
Accepted
time: 186ms
memory: 11092kb

input:

199922 3
571969777 254562695 918623645 816086797
358930468 475905065 995704080 647488749
512686956 463907722 850402449 736689193
510191237 472259356 609490636 695329202
693965027 101714888 885704050 903764280
397649948 263682895 679441464 846094420
352660567 83280443 919370051 597304770
47181815 480...

output:

256444264 498793532
594771427 498793532
758825984 498793532

result:

ok good solution

Test #88:

score: 0
Accepted
time: 179ms
memory: 11352kb

input:

199982 3
125069932 730244022 600393848 822830409
104770270 109571324 898938157 714407303
389640254 373558808 507980494 941068826
311386182 33671706 690966920 756822072
280116032 516203406 534857178 580383799
350142508 347513000 778720246 966846924
233504388 24782968 742590944 762362433
486951528 434...

output:

500631433 278305696
500631433 520856622
500631433 792842292

result:

ok good solution

Test #89:

score: 0
Accepted
time: 187ms
memory: 11216kb

input:

199953 3
220078811 271316482 769493773 918803821
254537444 31447893 511297263 574777117
445590644 478757787 982563358 998303404
274787870 489257062 483896581 648589675
154488606 220724908 364620238 971039678
74429945 299333520 778370585 554064969
105103522 124223543 673613241 937564225
58822218 8134...

output:

345947702 499921399
599573870 499921399
809448052 499921399

result:

ok good solution

Test #90:

score: 0
Accepted
time: 166ms
memory: 11092kb

input:

199917 3
33738547 269306936 796596493 384370341
372299033 124537892 648839287 620437396
346543521 353330153 981333957 805487373
484332424 272021826 771775780 571232879
189245319 632709406 832487909 946187311
385434249 248261954 613599933 454320815
212055370 71983635 933395712 748977363
12289078 4044...

output:

500167534 343643336
500167534 532828896
500167534 664171774

result:

ok good solution

Test #91:

score: 0
Accepted
time: 175ms
memory: 11092kb

input:

199997 3
228429727 418172958 983896297 960460213
82670832 200630744 277119060 691840739
195011205 141261488 609998866 629582890
674626998 358925740 929417090 569182554
476289888 157080950 892381532 914407189
154931391 49882007 827404570 683369472
230317595 62195366 530566854 601869200
366093445 4484...

output:

258987784 500207724
392762150 500207724
802319596 500207724

result:

ok good solution

Test #92:

score: 0
Accepted
time: 175ms
memory: 11144kb

input:

199984 3
138594113 53270128 623948377 455465226
381131540 184950917 592034583 931192685
50616061 26242485 844799785 904271638
338950087 296040697 555585886 470757855
440092254 640113456 938176293 712502931
96025265 289390379 730358932 953366820
84945774 51581313 517694956 870008738
220706123 2563396...

output:

500725361 390629784
500725361 453293557
500725361 663093743

result:

ok good solution

Test #93:

score: 0
Accepted
time: 167ms
memory: 9432kb

input:

199974 3
187045577 190823711 670975481 685688527
541752462 448634409 926652306 966507909
307411375 750737677 823228419 931439102
277014997 125868673 538042445 776524157
88039325 236911966 499284258 629349048
462122731 87406558 930198621 877152287
343932817 365073705 729305092 796488121
89778856 1551...

output:

809727857 797926306
387580361 457072927
243180398 420777670

result:

ok good solution

Test #94:

score: 0
Accepted
time: 280ms
memory: 9620kb

input:

199979 3
490068445 357636359 837799421 462845296
43914813 211891100 542086076 384697575
64537836 633273435 846987666 807639224
432210356 127267125 597527821 854150116
83634068 380621 614852444 557862349
285396719 353138768 953386544 775031958
84388986 117642989 732152256 821560074
298310839 61210482...

output:

325203624 318138944
478348235 802441554
724332464 397049428

result:

ok good solution

Test #95:

score: 0
Accepted
time: 178ms
memory: 9704kb

input:

199986 3
199539779 49293635 810000416 969909829
46792918 503569649 994217099 894493133
700724606 479626152 896630037 926045383
228629104 101114641 608903475 666206798
92383128 22963980 741334241 652637211
450423277 140903025 531178213 220977387
31813172 276814232 425209137 797727748
340165937 167187...

output:

830845263 793291551
365432803 491296298
467354665 195397142

result:

ok good solution

Test #96:

score: 0
Accepted
time: 225ms
memory: 9688kb

input:

199974 3
258886342 51834585 877073155 646299674
76824888 599664660 809416703 714960309
356793105 266832085 488071506 955167099
521845986 560074837 685063185 865628837
6754541 152429351 742626652 885958171
280478427 63141727 974868527 778531835
371840578 212011578 429373823 941456269
338796872 246957...

output:

819639228 410790617
531126885 669860894
376048739 436507412

result:

ok good solution

Test #97:

score: 0
Accepted
time: 194ms
memory: 9672kb

input:

199958 3
182465547 254915130 874512749 929088087
232123621 131574651 721805496 612909698
131266050 366156355 231486558 990059296
162613764 67083804 708324949 967008578
348207035 54786641 719300582 443914337
247185552 52429815 995207108 532223449
108023480 249131037 213650215 740744268
443244281 5160...

output:

201325443 718712715
760307487 513035766
526739437 403240450

result:

ok good solution

Test #98:

score: 0
Accepted
time: 199ms
memory: 9716kb

input:

199981 3
164581549 470816785 373781928 961757922
495445627 50762138 911716245 438637296
132910355 490235961 413322097 930602082
175989481 579773055 948153895 945091536
158042750 715027770 690962506 879158354
523180085 152609848 920957501 279101854
357384289 166528232 612396015 384878142
479754089 34...

output:

193930142 765165146
557521151 510429060
597206679 224527424

result:

ok good solution

Subtask #8:

score: 0
Time Limit Exceeded

Dependency #4:

100%
Accepted

Test #99:

score: 79
Accepted
time: 196ms
memory: 11212kb

input:

199951 4
514812861 133932036 696090638 747543537
186397809 370431000 691253347 852254015
344197419 279419397 601368273 743686889
861290650 306570380 923705807 979520253
492524948 392754834 763424718 724376060
236900538 399584349 488193877 998283770
29393095 84255663 568570466 902485429
787323212 226...

output:

188574089 498460610
320131299 498460610
543313360 498460610
866644930 498460610

result:

ok good solution

Test #100:

score: 0
Accepted
time: 175ms
memory: 11352kb

input:

199993 4
314977322 542355105 648321017 858221227
109893266 589205390 913054798 676026063
435324166 332646444 853505336 462677508
111963859 160056938 579701480 529424071
443039784 217869013 677341095 974488123
158784955 206955671 947501485 527171723
85230984 565138719 908863640 799409150
305153208 75...

output:

498963024 279884920
498963024 406999770
498963024 656622665
498963024 808771339

result:

ok good solution

Test #101:

score: 0
Accepted
time: 201ms
memory: 10984kb

input:

199974 4
768958645 250513981 890587364 895384707
683991003 55345261 835616323 837999925
606481543 398854924 851277724 660091656
12360452 104890545 675517450 904348429
283981260 353922108 556809557 745057891
169468431 158000345 970446244 701485879
331661824 428954476 869109802 583546664
642576531 583...

output:

322600920 500468655
407742750 500468655
421901501 500468655
832250271 500468655

result:

ok good solution

Test #102:

score: 0
Accepted
time: 154ms
memory: 11148kb

input:

199967 4
148959429 245083839 897060835 799268075
131539201 405933861 503538304 734783807
329596080 258789680 569537491 666730585
482944036 426634146 971904158 897003298
277761080 317095433 686859773 969274138
123789536 117685982 650874695 748747459
335215647 272111330 520869526 750127992
159824794 8...

output:

500197982 324582934
500197982 383696474
500197982 704513327
500197982 710563015

result:

ok good solution

Test #103:

score: 0
Accepted
time: 168ms
memory: 11068kb

input:

199933 4
304833806 105823144 858677916 953772349
175353118 84094510 682770739 620413269
454696614 240525037 710204502 573800473
171566417 172086710 934025120 611572086
644204652 497584604 704534911 891361641
39229968 306363735 563900337 928278375
139766193 88436080 767388943 909582393
458043188 4265...

output:

172702628 500224373
459495911 500224373
663475225 500224373
676320289 500224373

result:

ok good solution

Test #104:

score: 0
Accepted
time: 170ms
memory: 10972kb

input:

199944 4
41329973 421539969 539403992 896047133
207968039 206130772 551824787 864021945
99103528 151750032 910194907 738210132
431550249 66175840 594402589 727305658
314862082 490323755 834727340 870445099
165968587 63643870 590913550 514277163
99876227 293761446 866241921 445326441
8413119 50960994...

output:

498984230 387742222
498984230 450469487
498984230 470612723
498984230 589632462

result:

ok good solution

Test #105:

score: 0
Accepted
time: 180ms
memory: 9380kb

input:

199960 4
498633198 215283743 913976426 451217469
116927617 145537468 975847475 754303583
229851136 234473881 641743059 802331496
296805134 652917687 716036211 983726809
477530788 187766320 878469045 818864169
539334758 56223966 653558077 976404759
181809882 477974168 595905179 577433912
223309634 97...

output:

625331970 858624358
592770492 551984426
563694467 398450430
260719987 353689034

result:

ok good solution

Test #106:

score: 0
Accepted
time: 573ms
memory: 9740kb

input:

199944 4
550643961 498093705 762741081 699734149
162085814 164056515 651484073 986974728
97549402 37770417 686026028 408760808
298940898 466046246 601210731 934279046
39437042 5271338 846918197 432724873
497629230 329014762 688652215 850633833
83336831 225667880 728605386 615987020
482113663 5760478...

output:

370070552 279190341
470270477 490884440
541564774 775826542
587780201 605467004

result:

ok good solution

Test #107:

score: 0
Accepted
time: 250ms
memory: 9696kb

input:

199904 4
411314591 226373178 565283723 584113791
676079177 221222138 847231268 999779160
26743002 95765165 537586894 918925336
138751380 172539290 761153496 679433695
74864845 77302411 332944953 473023586
4575536 85883844 794528954 982331462
40114356 106628898 762434916 386781409
30866594 157783277 ...

output:

822095236 717736413
123638438 206010783
391897781 576178295
530099236 349605237

result:

ok good solution

Test #108:

score: 0
Accepted
time: 623ms
memory: 9624kb

input:

199997 4
54040938 287198271 696181309 876171140
261366778 448507519 659420611 756281687
642306271 424312733 916989376 673486962
186075171 112032739 737158165 810872112
43946722 177962386 514686602 922658821
268843961 618818899 964698729 912542319
108383662 91920424 699095467 248768064
159438549 8382...

output:

287756624 248439413
714576080 489240138
463876186 829799206
415903194 579214023

result:

ok good solution

Test #109:

score: 0
Accepted
time: 487ms
memory: 9924kb

input:

199920 4
703984912 358598552 980636266 843208739
430473529 787813355 701632877 941898713
191898025 40201805 875615691 819335239
160597561 270028381 596031858 485203795
444653879 318919696 739345275 587609943
286529074 100563662 864904461 696151129
129460967 234316224 972461327 406300363
465862039 44...

output:

283463583 271078839
495596868 888186328
858697712 537981234
581894585 480434672

result:

ok good solution

Test #110:

score: 0
Accepted
time: 469ms
memory: 9728kb

input:

199924 4
278940410 317226691 782291095 894679589
314073454 547958475 612056976 868184233
79311618 60040465 902664750 936581360
226514396 66216476 691334245 768041415
733713971 153785688 972517241 483425177
412049959 226472233 974268904 677149091
375862205 486826176 848515600 683075952
83513840 51542...

output:

186782176 312339203
382333418 690416786
546927248 608713902
757731136 314822786

result:

ok good solution

Test #111:

score: 0
Accepted
time: 175ms
memory: 9592kb

input:

199947 4
606095344 242082858 823935299 897939938
163807619 334981721 604428745 569795575
77768353 48512185 885038688 270285664
168147577 29160652 903035718 602732153
77294037 520081027 687472944 905182483
66275583 537555058 364085249 572116496
163509448 8762269 634790440 185925929
123983103 10966799...

output:

750710473 798943599
706293873 597566327
277921792 554868375
291298463 129614877

result:

ok good solution

Test #112:

score: 0
Accepted
time: 585ms
memory: 9524kb

input:

199937 4
93178496 468320430 520731452 718569174
423823452 445734117 666048965 958234940
243060510 156869609 886104628 447427548
213015777 413495961 353731617 539101636
148928001 99310279 935588866 283904009
601367799 26781170 972240669 752667827
215761618 6554005 862085184 546649503
233601846 568606...

output:

636586960 564614008
290266297 218559941
581798364 787139842
222367572 504373347

result:

ok good solution

Test #113:

score: 0
Accepted
time: 235ms
memory: 9808kb

input:

199944 4
269853793 154952560 740567589 781796358
574229470 196618617 987797824 441288803
317927485 184985965 714702690 516970740
225467225 149989007 934082222 784659617
99107266 267039746 575157161 551270233
140324454 210708230 490120454 600902406
145580588 1872358 891445587 738650976
9067601 161854...

output:

794729559 596291645
644730381 210249979
316293286 555776349
180631408 391689162

result:

ok good solution

Test #114:

score: 0
Accepted
time: 383ms
memory: 9544kb

input:

199946 4
122218394 473175211 657243029 918798223
105105813 177391570 548282073 831910047
426619980 306549486 592349628 814299173
228798758 153551885 763226348 564781862
195629778 540078204 975003531 964973433
544633853 617137478 632198493 926854761
222448764 376851210 635882719 627265998
403060144 3...

output:

759457447 271530389
566075376 870719989
438578609 496213296
188733288 310166832

result:

ok good solution

Test #115:

score: 0
Accepted
time: 1631ms
memory: 9356kb

input:

199967 4
77330119 437109706 482233665 484597284
116823418 364752632 856477248 717239253
461727736 109916258 942333426 837309549
118902153 585501420 627246140 910689244
212153485 613076228 773107639 786772124
317186158 356007789 794943936 687949398
455161457 130212854 660708421 515535624
66437310 258...

output:

385204758 464549870
472174993 215499447
660595899 542147133
424558288 615917936

result:

ok good solution

Test #116:

score: 0
Accepted
time: 506ms
memory: 9876kb

input:

199958 4
213596468 587356423 866293953 787934965
412809046 208317437 887334395 631624927
318834612 635346797 604574647 759159780
51408503 338719153 573637266 806277499
482192500 154072310 759924032 747204986
191633984 176998968 879753822 377362083
33523436 337672401 814614705 988245201
294211689 545...

output:

680034094 228945286
379380654 412438747
394174990 874423493
525581545 717693564

result:

ok good solution

Test #117:

score: 0
Accepted
time: 193ms
memory: 9676kb

input:

199988 4
136877158 194564128 710285670 477991242
463661392 284784131 825998907 666072476
236284423 491911852 431908231 998850192
756274984 605709639 873505907 788140573
133338970 352533476 327471625 836189913
743406479 569935476 890410194 949731899
22365710 388759946 416302248 693049499
45145688 200...

output:

842643737 775864085
285965315 532075787
471654799 372021746
382511659 369292002

result:

ok good solution

Test #118:

score: 0
Accepted
time: 970ms
memory: 8772kb

input:

199981 4
150864383 556979458 579529903 977950920
458026131 454201391 675167387 861689081
360974349 92974551 840584255 520315879
267532957 183460912 808569216 514151209
293292642 206858288 636569165 994653886
134686665 358102564 447377988 580033207
146580101 51718131 981519703 890907556
642020844 298...

output:

504358258 773399276
746465450 457354163
161481619 578807714
374528377 219517439

result:

ok good solution

Test #119:

score: 0
Accepted
time: 199ms
memory: 9680kb

input:

199919 4
695117470 337344810 989189127 795113331
559539099 654032455 896823150 783597820
679866066 505895855 829329938 885949438
108187467 373245497 629300582 510909768
32232757 396254933 375472880 834525482
392690139 13645113 622784913 802696849
321067826 348302849 875473208 888989103
313230523 546...

output:

737028933 742860452
270403375 484943292
404224352 453134724
711641977 255690228

result:

ok good solution

Test #120:

score: 0
Accepted
time: 350ms
memory: 9956kb

input:

199963 4
617824360 7380713 973776622 504546517
299650166 218156048 947923036 600836517
4180555 294734532 278538423 943604482
61519539 381642381 321013664 641824923
14662593 130013487 654397581 829153412
217450637 274849251 925877548 558412528
36213063 248891101 451833418 674304317
395822826 38648987...

output:

698030368 223748334
640974446 669779571
170848260 541445250
459191583 486645792

result:

ok good solution

Test #121:

score: 0
Accepted
time: 732ms
memory: 9072kb

input:

199971 4
677852071 168085353 966987742 934494383
330333027 273975497 891836127 822263588
165026960 252203321 565052067 725382590
355299157 14197273 930781461 802926586
232443636 476663257 489214766 639788145
219573481 72899458 853255049 225086352
315385320 603579866 613707648 767010161
117238054 126...

output:

443029638 681080728
789588673 396843827
273573531 559429286
618280922 211740979

result:

ok good solution

Test #122:

score: 0
Accepted
time: 449ms
memory: 9860kb

input:

199911 4
223860491 328441324 998329035 887437368
588300944 217803456 670884550 437524235
261955357 41451171 773455351 634080076
489056803 255757353 874145271 349101943
470937569 223302078 932525804 552416078
544588115 27506163 712440486 641213374
413949729 23217303 855701953 438498084
229320667 5300...

output:

643293367 289485913
602254075 377434265
385244544 832112867
364357125 558027763

result:

ok good solution

Test #123:

score: 0
Accepted
time: 288ms
memory: 9752kb

input:

200000 4
119978562 20431265 782746504 641510105
415373 709486630 451920344 792074038
224880551 520231465 739263114 975260211
447337677 328937091 993935010 426331985
476625378 395574987 898575401 986714548
470360875 298261912 873504290 565452793
332548271 400176913 861458696 836116613
352248121 24142...

output:

214910822 761521564
618361481 542835773
593454235 368480965
528337736 212093584

result:

ok good solution

Test #124:

score: 0
Accepted
time: 407ms
memory: 9712kb

input:

199974 4
110535316 228535521 869489834 834684973
666340037 295621328 722737042 756705620
377304242 322608648 724003157 586040776
154163076 168879382 714587409 672721028
131679235 136909790 557443190 486608160
310264350 111118223 944553339 492394520
405661898 435972839 761390658 522674285
108733407 1...

output:

410123936 870447105
482135236 303298066
533543173 577450648
703557297 456598959

result:

ok good solution

Test #125:

score: 0
Accepted
time: 263ms
memory: 9944kb

input:

199983 4
455238745 637238931 911521184 759406097
424675778 429275780 916015875 783402043
287026005 498111239 995326467 717244071
120818495 520353147 214193729 892571169
309635824 376660478 579765524 917517545
83196558 48309464 661072710 151411167
120229502 22436470 826644216 391376111
192797399 1328...

output:

203457260 854338199
843642098 639749659
562640838 477962698
627780828 132194012

result:

ok good solution

Test #126:

score: 0
Accepted
time: 358ms
memory: 9772kb

input:

199951 4
178647250 374783567 974647772 848385910
195983252 208226594 484204140 780573254
409307240 464754059 700263422 882753176
61797751 292917453 850692088 797834285
397201052 587995602 784413669 625509499
92190566 677345150 528503247 851287560
36717097 54717937 588227282 486738272
121883993 27069...

output:

334131372 693450439
663465470 277198032
418412550 602769045
355335941 399739046

result:

ok good solution

Test #127:

score: 0
Accepted
time: 283ms
memory: 9568kb

input:

199968 4
333765923 170528753 702287635 650372301
107065769 88293231 847926740 229253207
95726613 226341707 230721416 934797847
12436740 302896448 654196072 820017078
504699367 114556589 796253096 917940328
159809655 496288350 806286214 790528235
287582598 52997619 720076174 464322414
44093336 500581...

output:

215461423 805717334
409231394 619518554
832644838 427034682
541924139 135266446

result:

ok good solution

Test #128:

score: 0
Accepted
time: 337ms
memory: 9932kb

input:

199936 4
362549421 464113420 448043045 801388061
120842614 198601289 552057616 865060254
380707271 475445620 631731636 807338918
77122623 477194614 262819415 874238537
558702319 188890096 714891204 405008114
319126544 245437129 567577613 654723961
183970804 300529074 575845897 954754781
212577858 65...

output:

254903040 846450855
420814215 599031371
695492504 358679195
801874537 174374318

result:

ok good solution

Test #129:

score: 0
Accepted
time: 968ms
memory: 9400kb

input:

199978 4
467528519 190584506 946287881 329413405
200677921 115736126 524379308 765097668
95731644 646964857 466723669 906792317
212771141 529323141 816249251 726216931
368138222 215055962 878461593 435224043
4115542 517814206 516909863 716534395
171077194 657854723 766248354 850834904
339511247 4334...

output:

411323899 723201924
581772717 410497766
250158144 654938486
558171436 261734733

result:

ok good solution

Test #130:

score: 0
Accepted
time: 613ms
memory: 8768kb

input:

199952 4
489199623 219646646 879463508 536349080
236697707 167537170 579688474 622978377
288778882 231848138 915185715 531046168
113317334 75061888 529797081 301267629
690738857 287454254 924755443 943641578
86744474 133919243 612844933 853178149
566808354 139460955 943605506 855027369
58025080 6602...

output:

550128490 749353835
440093092 273755762
159416440 485211946
778339953 329807984

result:

ok good solution

Test #131:

score: 0
Accepted
time: 1568ms
memory: 9308kb

input:

199959 4
188000042 534080909 935288004 970329936
526768920 117991405 827203418 806055855
591643464 12695074 983483366 278481808
413058328 336512137 601077931 819284699
23525772 57485957 915598033 653235354
53139900 99153620 798661973 809938822
287778731 634236301 718323129 861965175
177393795 274906...

output:

651748528 658555455
593056923 274780011
497019084 668069399
274246646 381855428

result:

ok good solution

Test #132:

score: 0
Accepted
time: 1220ms
memory: 9044kb

input:

199969 4
81722636 134056376 939429521 455003442
146444232 6187986 664708372 359988377
289722768 453488652 913338309 987019330
671966666 346391142 927795918 877109122
170110668 11271403 984380210 660292472
320317027 218765788 831874591 855221971
46816500 187111410 584560235 493951672
635663871 246202...

output:

125837263 244833675
689931265 642429688
441118307 17415420
770043189 601230863

result:

ok good solution

Test #133:

score: 0
Accepted
time: 563ms
memory: 9524kb

input:

199924 4
28882055 950942 403475824 635992818
183594048 349671364 927674194 535251142
126501734 109700080 626117501 888591577
37604112 397952330 920497896 431055318
121534737 333112969 360860729 420643815
286089388 52366514 940594871 793570324
5919160 335883613 297330866 686668694
227408128 157982851...

output:

618575816 317905030
198944748 407775407
474983177 851850511
538879507 304423446

result:

ok good solution

Test #134:

score: 0
Accepted
time: 1947ms
memory: 9040kb

input:

199995 4
102228776 350454817 771607154 750879774
286876711 582295130 674348545 961407566
164300238 240210785 919728994 930889464
104744353 284065309 870546646 837469256
151307490 339207794 297209610 680088796
282746545 256165437 942397058 413778780
278103858 454570185 400878604 828102755
478188587 7...

output:

292426972 520384947
584947769 835930254
602394168 316648393
550046153 157634048

result:

ok good solution

Test #135:

score: 0
Accepted
time: 618ms
memory: 9020kb

input:

199996 4
168176915 489665709 855906914 692286927
4444364 484378440 750546108 821822785
255334155 236217686 948318089 782571537
137690366 549867958 948233557 905679091
156523632 214859475 756394621 414927239
291522084 150079847 715022545 574251481
136303375 297340136 405070560 825449890
555285926 109...

output:

786367102 563912216
128966707 513535099
629565610 236428309
388483455 657695660

result:

ok good solution

Test #136:

score: 0
Accepted
time: 827ms
memory: 9304kb

input:

199959 4
728262054 465022574 939317760 738047097
9081326 225324416 973629476 738102281
64613258 192522395 526207483 660514062
179458169 88103031 774203683 502281191
137864953 278538029 652998453 719188286
77343715 326660441 403036530 619668122
391305365 880635 808864044 399104168
448199205 402267484...

output:

387015602 373533848
816229873 486016892
504114413 803374380
391378429 340194750

result:

ok good solution

Test #137:

score: 0
Accepted
time: 676ms
memory: 9496kb

input:

199908 4
218280017 306382441 945831851 548346278
526054420 307900489 641239993 801660929
205908688 421153261 988148534 727255426
482468239 242057202 603528432 479230375
209083771 387218413 892424978 614309865
221409731 121130544 854568876 475225243
304938784 820321227 610600264 896740892
225566570 8...

output:

631108709 402377765
215301762 453544550
337081737 869078244
572417193 306549826

result:

ok good solution

Test #138:

score: 0
Accepted
time: 669ms
memory: 9448kb

input:

199970 4
185242259 238959131 582274441 529421787
444335583 113232220 794715404 794779686
529961263 468051704 827668222 796227477
527622966 356922131 758117758 777257655
234473070 42609861 635521394 611806948
508417014 56930463 842580959 896997952
278594208 292802829 724325460 420388139
26671625 4574...

output:

310524726 313911973
730800417 731745477
226479239 494356092
767920426 484949348

result:

ok good solution

Test #139:

score: 0
Accepted
time: 719ms
memory: 9496kb

input:

199983 4
545954266 209643703 664563759 411151968
136257044 472379885 872228768 904520654
522184654 14023909 968055477 662644966
447786783 14876380 928357379 671876444
91071744 133505462 764149746 706101007
94689373 125635426 825894677 645382489
199072242 18191218 476802318 437706437
79293697 8532715...

output:

553808616 379235161
259346021 403561842
483741474 862337808
583081888 498156759

result:

ok good solution

Test #140:

score: 0
Accepted
time: 1790ms
memory: 8776kb

input:

199952 4
3470765 413572209 826054505 923548855
408267055 199879863 950901085 567851195
281619209 627448105 733617931 871609246
67567095 33302157 496602724 741831992
202452500 288130200 415270156 687727386
4725814 255391084 738293645 618210007
130339739 174410312 769054239 994742240
757704511 3130114...

output:

450999100 205983569
269160517 468247693
488910278 741200515
821389228 545257298

result:

ok good solution

Test #141:

score: 0
Accepted
time: 956ms
memory: 9084kb

input:

199991 4
236037374 70725028 991102590 666963158
355720406 217724817 829651753 594492227
382596222 11468604 801182419 908922060
521197067 27263988 752013477 656380198
318793488 174063646 760576140 826852966
95471402 111579127 807706827 988418593
206934533 586284283 633910416 821281255
282045334 28932...

output:

232999175 533375575
856342318 451219638
640825557 219815289
502699282 635400275

result:

ok good solution

Test #142:

score: -79
Time Limit Exceeded

input:

199945 4
477011813 28948509 969154364 667129914
183649347 105942494 895408186 685121277
314872926 369938511 764110167 604730675
15334856 176988737 631947589 783500762
136853941 277164456 945040054 597745379
542277165 20582152 821224440 537679933
298147734 270950211 662852465 891411256
38281510 66595...

output:


result: