QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#139843#3553. Hamburg SteakZhou_JK100 ✓785ms127412kbC++238.0kb2023-08-14 18:28:092023-08-14 18:28:19

Judging History

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

  • [2023-08-14 18:28:19]
  • 评测
  • 测评结果:100
  • 用时:785ms
  • 内存:127412kb
  • [2023-08-14 18:28:09]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cassert>
#include<set>
#include<stack>
#include<vector>
#include<numeric>
#include<algorithm>
using namespace std;
const int N=200005;
const int INF=1061109567;
int n,k;
int l[N],d[N],r[N],u[N];
bool vis[N];
pair<int,int>p[5];
void dfs(int step)
{
    if(step>k)
    {
        for(int i=1;i<=n;i++)
            if(!vis[i]) return;
        for(int i=1;i<=k;i++)
            printf("%d %d\n",p[i].first,p[i].second);
        exit(0);
    }
    int maxl=0,minr=INF,maxd=0,minu=INF;
    for(int i=1;i<=n;i++)
        if(!vis[i])
        {
            maxl=max(maxl,l[i]);
            minr=min(minr,r[i]);
            maxd=max(maxd,d[i]);
            minu=min(minu,u[i]);
        }
    vector<int>pos;
    int x,y;
    x=maxl,y=maxd;
    for(int i=1;i<=n;i++)
        if(!vis[i])
        {
            if(l[i]<=x&&x<=r[i]&&d[i]<=y&&y<=u[i]) pos.emplace_back(i),vis[i]=true;
        }
    p[step]={x,y};
    dfs(step+1);
    for(int i:pos)
        vis[i]=false;
    x=maxl,y=minu;
    for(int i=1;i<=n;i++)
        if(!vis[i])
        {
            if(l[i]<=x&&x<=r[i]&&d[i]<=y&&y<=u[i]) pos.emplace_back(i),vis[i]=true;
        }
    p[step]={x,y};
    dfs(step+1);
    for(int i:pos)
        vis[i]=false;
    x=minr,y=maxd;
    for(int i=1;i<=n;i++)
        if(!vis[i])
        {
            if(l[i]<=x&&x<=r[i]&&d[i]<=y&&y<=u[i]) pos.emplace_back(i),vis[i]=true;
        }
    p[step]={x,y};
    dfs(step+1);
    for(int i:pos)
        vis[i]=false;
    x=minr,y=minu;
    for(int i=1;i<=n;i++)
        if(!vis[i])
        {
            if(l[i]<=x&&x<=r[i]&&d[i]<=y&&y<=u[i]) pos.emplace_back(i),vis[i]=true;
        }
    p[step]={x,y};
    dfs(step+1);
    for(int i:pos)
        vis[i]=false;
    return;
}
int c[N];
int id[N][2],cnt;
int pos[N][2];
vector<tuple<int,int,int,int>>L,R,D,U;
vector<int>G[N*10];
int dfn[N*10],low[N*10],Index;
int bel[N*10],tot;
void tarjan(int u)
{
    static bool vis[N*10];
    static stack<int>s;
    dfn[u]=low[u]=++Index;
    s.emplace(u);
    vis[u]=true;
    for(int v:G[u])
        if(!dfn[v])
        {
            tarjan(v);
            low[u]=min(low[u],low[v]);
        }
        else if(vis[v]) low[u]=min(low[u],dfn[v]);
    if(dfn[u]==low[u])
    {
        tot++;
        while(s.top()!=u)
        {
            bel[s.top()]=tot;
            vis[s.top()]=false;
            s.pop();
        }
        bel[u]=tot;
        vis[u]=false;
        s.pop();
    }
    return;
}
int val[N];
int main()
{
    scanf("%d%d",&n,&k);
    for(int i=1;i<=n;i++)
        scanf("%d%d%d%d",&l[i],&d[i],&r[i],&u[i]);
    dfs(1);
    if(k==4)
    {
        int maxl=*max_element(l+1,l+n+1),minr=*min_element(r+1,r+n+1),maxd=*max_element(d+1,d+n+1),minu=*min_element(u+1,u+n+1);
        assert(minr<=maxl&&minu<=maxd);
        for(int i=1;i<=n;i++)
        {
            if(l[i]<=minr&&minr<=r[i]) c[i]++;
            if(l[i]<=maxl&&maxl<=r[i]) c[i]++;
            if(d[i]<=minu&&minu<=u[i]) c[i]++;
            if(d[i]<=maxd&&maxd<=u[i]) c[i]++;
            if(c[i]>=3) continue;
            assert(c[i]>0);
            id[i][0]=++cnt,id[i][1]=++cnt;
            if(c[i]==1)
            {
                G[id[i][1]].emplace_back(id[i][0]);
                if(l[i]<=minr&&minr<=r[i]) L.emplace_back(d[i],u[i],id[i][0],id[i][1]),pos[i][0]=1;
                else if(l[i]<=maxl&&maxl<=r[i]) R.emplace_back(d[i],u[i],id[i][0],id[i][1]),pos[i][0]=2;
                else if(d[i]<=minu&&minu<=u[i]) D.emplace_back(l[i],r[i],id[i][0],id[i][1]),pos[i][0]=3;
                else if(d[i]<=maxd&&maxd<=u[i]) U.emplace_back(l[i],r[i],id[i][0],id[i][1]),pos[i][0]=4;
                else assert(false);
            }
            if(c[i]==2)
            {
                for(int j=1;j<=4;j++)
                    for(int k=j+1;k<=4;k++)
                    {
                        bool fj=false;
                        if(j==1) fj=l[i]<=minr&&minr<=r[i];
                        else if(j==2) fj=l[i]<=maxl&&maxl<=r[i];
                        else if(j==3) fj=d[i]<=minu&&minu<=u[i];
                        else if(j==4) fj=d[i]<=maxd&&maxd<=u[i];
                        bool fk=false;
                        if(k==1) fk=l[i]<=minr&&minr<=r[i];
                        else if(k==2) fk=l[i]<=maxl&&maxl<=r[i];
                        else if(k==3) fk=d[i]<=minu&&minu<=u[i];
                        else if(k==4) fk=d[i]<=maxd&&maxd<=u[i];
                        if(fj&&fk)
                        {
                            if(j==1) L.emplace_back(d[i],u[i],id[i][0],id[i][1]),pos[i][0]=1;
                            else if(j==2) R.emplace_back(d[i],u[i],id[i][0],id[i][1]),pos[i][0]=2;
                            else if(j==3) D.emplace_back(l[i],r[i],id[i][0],id[i][1]),pos[i][0]=3;
                            else if(j==4) U.emplace_back(l[i],r[i],id[i][0],id[i][1]),pos[i][0]=4;
                            else assert(false);
                            if(k==1) L.emplace_back(d[i],u[i],id[i][1],id[i][0]),pos[i][1]=1;
                            else if(k==2) R.emplace_back(d[i],u[i],id[i][1],id[i][0]),pos[i][1]=2;
                            else if(k==3) D.emplace_back(l[i],r[i],id[i][1],id[i][0]),pos[i][1]=3;
                            else if(k==4) U.emplace_back(l[i],r[i],id[i][1],id[i][0]),pos[i][1]=4;
                            else assert(false);
                        }
                    }
            }
        }
        for(auto a:{L,R,D,U})
        {
            vector<int>to(a.size()),from(a.size());
            for(int i=0;i<(int)a.size();i++)
                to[i]=++cnt,from[i]=++cnt;
            sort(a.begin(),a.end(),[=](const tuple<int,int,int,int> &x,const tuple<int,int,int,int> &y){return get<1>(x)<get<1>(y);});
            for(int i=0;i<(int)a.size();i++)
            {
                G[to[i]].emplace_back(get<3>(a[i]));
                G[get<2>(a[i])].emplace_back(from[i]);
                if(i>0)
                {
                    G[to[i]].emplace_back(to[i-1]);
                    G[from[i-1]].emplace_back(from[i]);
                }
            }
            vector<int>posr(a.size());
            for(int i=0;i<(int)posr.size();i++)
                posr[i]=get<1>(a[i]);
            for(int i=0;i<(int)a.size();i++)
            {
                auto [li,ri,i1,i0]=a[i];
                if(i>0)
                {
                    int j=lower_bound(posr.begin(),posr.begin()+i,li)-posr.begin()-1;
                    if(j>=0)
                    {
                        G[i1].emplace_back(to[j]);
                        G[from[j]].emplace_back(i0);
                    }
                }
            }
        }
        for(int i=1;i<=cnt;i++)
            if(!dfn[i]) tarjan(i);
        for(int i=1;i<=n;i++)
            if(c[i]==1||c[i]==2) assert(bel[id[i][0]]!=bel[id[i][1]]);
        for(int i=1;i<=n;i++)
            if(c[i]==1||c[i]==2) val[i]=bel[id[i][1]]<bel[id[i][0]];
        int ld=0,lu=INF,rd=0,ru=INF;
        int dl=0,dr=INF,ul=0,ur=INF;
        for(int i=1;i<=n;i++)
            if(c[i]==1)
            {
                if(pos[i][0]==1) ld=max(ld,d[i]),lu=min(lu,u[i]);
                else if(pos[i][0]==2) rd=max(rd,d[i]),ru=min(ru,u[i]);
                else if(pos[i][0]==3) dl=max(dl,l[i]),dr=min(dr,r[i]);
                else if(pos[i][0]==4) ul=max(ul,l[i]),ur=min(ur,r[i]);
            }
            else if(c[i]==2)
            {
                if(pos[i][val[i]]==1) ld=max(ld,d[i]),lu=min(lu,u[i]);
                else if(pos[i][val[i]]==2) rd=max(rd,d[i]),ru=min(ru,u[i]);
                else if(pos[i][val[i]]==3) dl=max(dl,l[i]),dr=min(dr,r[i]);
                else if(pos[i][val[i]]==4) ul=max(ul,l[i]),ur=min(ur,r[i]);
            }
        assert(ld<=lu&&rd<=ru&&dl<=dr&&ul<=ur);
        printf("%d %d\n",minr,ld);
        printf("%d %d\n",maxl,rd);
        printf("%d %d\n",dl,minu);
        printf("%d %d",ul,maxd);
    }
    return 0;
}

詳細信息

Subtask #1:

score: 1
Accepted

Test #1:

score: 1
Accepted
time: 11ms
memory: 52964kb

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: 4ms
memory: 52932kb

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: 52884kb

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: 8ms
memory: 52940kb

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: 7ms
memory: 52944kb

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: 8ms
memory: 52960kb

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:

566952159 276748561
374768179 635182732

result:

ok good solution

Test #7:

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

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: 9ms
memory: 52940kb

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:

675273190 355678742
255383401 689846929

result:

ok good solution

Subtask #3:

score: 3
Accepted

Test #9:

score: 3
Accepted
time: 11ms
memory: 52944kb

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:

816253792 497455773
437786479 497455773
274745882 496362979

result:

ok good solution

Test #10:

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

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 779897623
502336852 416569289
488715392 172082222

result:

ok good solution

Test #11:

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

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:

840903510 505601682
502496467 505393267
183132333 505145681

result:

ok good solution

Test #12:

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

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 702759714
505976751 479767249
485122794 459287531

result:

ok good solution

Test #13:

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

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:

756539307 493167932
549639521 492366382
424118570 492366382

result:

ok good solution

Test #14:

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

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 816980623
504095743 454750157
504095743 384314201

result:

ok good solution

Test #15:

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

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: 7ms
memory: 50876kb

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:

351907664 172518940
631243423 413050209
456477508 724583533

result:

ok good solution

Test #17:

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

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
442116145 186576369
318177095 607143603

result:

ok good solution

Test #18:

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

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 292528802
512060727 820887208
361569557 458623119

result:

ok good solution

Test #19:

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

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:

214925979 587203190
717435782 452117665
544649083 446520816

result:

ok good solution

Test #20:

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

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:

551291376 317672540
508333289 473898720
211784431 657511646

result:

ok good solution

Subtask #4:

score: 6
Accepted

Test #21:

score: 6
Accepted
time: 10ms
memory: 53028kb

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:

740481982 495357540
476653932 494820027
417434611 494344760
293219812 487377130

result:

ok good solution

Test #22:

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

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 600026992
507482141 579683805
507482141 463762505
503752558 231296634

result:

ok good solution

Test #23:

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

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:

753054834 493355384
685898166 492459968
430616593 492459968
238122020 485083495

result:

ok good solution

Test #24:

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

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 620914908
516004179 519688686
514098368 296702992
477460747 220515803

result:

ok good solution

Test #25:

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

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:

784152404 493681669
675698171 493681669
467581076 493681669
128818998 492756164

result:

ok good solution

Test #26:

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

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 717993694
499057790 504821496
499057790 465197616
489702939 230667962

result:

ok good solution

Test #27:

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

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: 13ms
memory: 50924kb

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:

352273349 347271391
409818796 433323501
861767133 526378094
556873745 647566206

result:

ok good solution

Test #29:

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

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
327249062 357713806
680760485 389759646
421013648 518755987

result:

ok good solution

Test #30:

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

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:

372116150 397272163
727160291 453996846
522094003 661466599
467163313 561479700

result:

ok good solution

Test #31:

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

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:

274778863 405494310
372295665 804731267
729325830 551987017
562667288 414203734

result:

ok good solution

Test #32:

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

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:

353261981 499331933
753208227 504341390
458625830 521490751
440339711 499715384

result:

ok good solution

Test #33:

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

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
533493466 225842542
359117730 434162482

result:

ok good solution

Test #34:

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

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:

360450190 500715003
729084344 689002719
387674198 387879424
457442357 710133109

result:

ok good solution

Test #35:

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

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 224266297
420842631 501599828
320052002 465721851

result:

ok good solution

Test #36:

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

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 258790197
535446593 617738976
483958442 566205138
248321729 335657311

result:

ok good solution

Test #37:

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

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:

369020844 390294144
594910103 434337308
584607656 197873178
408659539 758693302

result:

ok good solution

Test #38:

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

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 297700881
197614595 479604791
477702697 524786100
454426957 731468091

result:

ok good solution

Test #39:

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

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
354302057 382563580
650828438 326208672
445144083 273524662

result:

ok good solution

Test #40:

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

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:

184667931 610005648
687967315 401614309
308794908 211177986
621175959 669092734

result:

ok good solution

Test #41:

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

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
596038645 160971824
423678643 478507666
161591413 559857635

result:

ok good solution

Test #42:

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

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 451272623
633821864 772916545
430706895 462213246
169564728 463654450

result:

ok good solution

Test #43:

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

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:

136541572 476331930
704774685 423732265
650011170 304397983
580549722 801008111

result:

ok good solution

Test #44:

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

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 267069838
663113519 305355006
361236544 770831805
274171660 545387660

result:

ok good solution

Test #45:

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

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:

198738222 689089468
765153737 533879831
564599209 516532042
364870669 236201656

result:

ok good solution

Test #46:

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

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:

130599907 737795493
513309167 246217092
704070384 372010288
694070005 419507005

result:

ok good solution

Test #47:

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

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:

393111817 855254653
536691748 554549651
523292484 168802854
468303067 486843985

result:

ok good solution

Test #48:

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

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:

835800530 343410210
384208355 708239227
642351568 544946527
467557568 395422342

result:

ok good solution

Test #49:

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

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:

377176690 640315861
445214064 495000420
745616977 445938526
612752833 285849092

result:

ok good solution

Test #50:

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

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:

711671342 372620660
586273796 385129233
432474024 406501451
157901534 872666537

result:

ok good solution

Test #51:

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

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:

252600920 418099877
605777310 393786334
521376878 326151938
425215209 724537744

result:

ok good solution

Test #52:

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

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:

419445251 499544901
701582473 478051830
447339452 384050293
610523934 708260137

result:

ok good solution

Test #53:

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

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:

299264871 401435447
660950376 478020468
564878552 275575908
326654948 660320271

result:

ok good solution

Test #54:

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

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:

296341065 336785794
657038631 478459140
489222461 280092797
506019298 578864410

result:

ok good solution

Test #55:

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

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:

136981610 580462581
860468520 501995916
522471432 365868030
260255419 718976753

result:

ok good solution

Test #56:

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

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:

385174692 591767223
568650667 451614334
466167585 281015401
485679060 763553522

result:

ok good solution

Test #57:

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

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:

266760675 354619268
864555170 528319317
676235589 238242296
372751982 809140789

result:

ok good solution

Test #58:

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

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:

149191015 454845565
776503419 523737710
398453909 166455660
478982086 851151821

result:

ok good solution

Test #59:

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

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:

321953806 541070897
603838709 518782174
592466856 157359364
451335226 747491263

result:

ok good solution

Test #60:

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

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:

343156898 493675091
598085403 332865110
496474548 262429369
537967710 718571000

result:

ok good solution

Test #61:

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

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:

199221074 394644680
734750308 637946325
531486148 378500518
409151137 644719995

result:

ok good solution

Test #62:

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

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:

307015786 357784198
577811015 674425262
429283931 166623512
556050465 817300208

result:

ok good solution

Test #63:

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

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:

300858833 583839291
764271853 541139379
579172775 383329184
510248909 775051275

result:

ok good solution

Test #64:

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

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:

147068528 524807825
573247992 523194991
358766496 342031933
523086557 849394025

result:

ok good solution

Test #65:

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

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:

394670078 820730168
735485595 612322320
553771544 263473575
391712801 390253504

result:

ok good solution

Test #66:

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

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:

323505699 404331968
819084834 548645245
438655145 201271893
550868800 687570336

result:

ok good solution

Test #67:

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

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:

163571946 586823955
654273731 294842581
471748049 239006673
374413089 658906650

result:

ok good solution

Test #68:

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

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:

152038517 584686429
675271349 548757132
413052227 189506214
512765829 802021876

result:

ok good solution

Test #69:

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

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:

387474158 374549939
679520510 393159422
634382735 233017385
446152775 847595253

result:

ok good solution

Test #70:

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

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:

181973868 336240748
691232855 480069545
247539727 220904208
453616123 547934961

result:

ok good solution

Test #71:

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

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:

178370891 657108753
720949951 423789359
543218974 325995471
317093236 846088379

result:

ok good solution

Test #72:

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

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:

323158063 520698528
655073386 416865321
383731839 272249924
582906382 626946184

result:

ok good solution

Test #73:

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

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:

140347617 492390972
726387261 517995572
480224556 374210975
462791406 716371480

result:

ok good solution

Test #74:

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

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:

142904751 370898977
785450348 659991352
345139315 222952196
662490889 728396971

result:

ok good solution

Test #75:

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

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:

351283298 414699775
675011726 413927161
548750561 171436785
418277491 772339060

result:

ok good solution

Test #76:

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

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:

347664994 429658367
666537100 427854048
548185333 177474801
419793923 770145998

result:

ok good solution

Test #77:

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

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:

355681292 428249841
691974822 427964863
559591155 178313485
427998846 782653336

result:

ok good solution

Test #78:

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

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:

352300512 437303670
678205439 436558759
558803707 185127116
426333413 790573540

result:

ok good solution

Subtask #5:

score: 1
Accepted

Dependency #1:

100%
Accepted

Test #79:

score: 1
Accepted
time: 63ms
memory: 57096kb

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: 71ms
memory: 57108kb

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: 55ms
memory: 55056kb

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: 56ms
memory: 57172kb

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: 45ms
memory: 57124kb

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: 62ms
memory: 57584kb

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:

625395978 461653251
465692878 653939032

result:

ok good solution

Test #85:

score: 0
Accepted
time: 61ms
memory: 57092kb

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: 70ms
memory: 55656kb

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:

617046978 264369737
343165775 754652963

result:

ok good solution

Subtask #7:

score: 6
Accepted

Dependency #3:

100%
Accepted

Test #87:

score: 6
Accepted
time: 59ms
memory: 57352kb

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:

758825984 498793532
594760948 498793532
256433649 498781612

result:

ok good solution

Test #88:

score: 0
Accepted
time: 57ms
memory: 57172kb

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 792842292
500631433 520853435
500627826 278300365

result:

ok good solution

Test #89:

score: 0
Accepted
time: 70ms
memory: 57232kb

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:

809448052 499921399
599571579 499921399
345934438 499921399

result:

ok good solution

Test #90:

score: 0
Accepted
time: 60ms
memory: 57132kb

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 664171774
500165478 532828896
500124709 343624738

result:

ok good solution

Test #91:

score: 0
Accepted
time: 48ms
memory: 57076kb

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:

802319596 500207724
392746799 500207627
258966946 500202061

result:

ok good solution

Test #92:

score: 0
Accepted
time: 44ms
memory: 57276kb

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 663093743
500707004 453251841
500679642 390505032

result:

ok good solution

Test #93:

score: 0
Accepted
time: 52ms
memory: 57076kb

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: 161ms
memory: 58944kb

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:

325204596 318139295
724332464 397049635
478348235 802441554

result:

ok good solution

Test #95:

score: 0
Accepted
time: 68ms
memory: 57608kb

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
467354665 195448271
365420619 491296298

result:

ok good solution

Test #96:

score: 0
Accepted
time: 90ms
memory: 59252kb

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 410790859
531126885 669860894
376048739 436507412

result:

ok good solution

Test #97:

score: 0
Accepted
time: 130ms
memory: 58200kb

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:

201326519 718712715
760307487 513035766
526739437 403240450

result:

ok good solution

Test #98:

score: 0
Accepted
time: 111ms
memory: 59300kb

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:

597206679 224529730
557521151 510454972
193907941 765165146

result:

ok good solution

Subtask #8:

score: 79
Accepted

Dependency #4:

100%
Accepted

Test #99:

score: 79
Accepted
time: 60ms
memory: 55176kb

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:

866644930 498460610
543298705 498460610
320119151 498439032
188424012 498340353

result:

ok good solution

Test #100:

score: 0
Accepted
time: 65ms
memory: 57312kb

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 808771339
498957109 656598435
498957109 406983622
498951917 279870896

result:

ok good solution

Test #101:

score: 0
Accepted
time: 52ms
memory: 57092kb

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:

832250271 500468655
421493817 500468655
407416673 500442882
322571001 500442882

result:

ok good solution

Test #102:

score: 0
Accepted
time: 71ms
memory: 57104kb

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 710563015
500195548 704140151
500195548 383690160
500195475 324444364

result:

ok good solution

Test #103:

score: 0
Accepted
time: 60ms
memory: 57280kb

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:

676320289 500224373
663275147 500224373
459473749 500224373
172701375 500224373

result:

ok good solution

Test #104:

score: 0
Accepted
time: 74ms
memory: 57156kb

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 589632462
498984230 470411768
498865505 450028381
498865505 387511657

result:

ok good solution

Test #105:

score: 0
Accepted
time: 49ms
memory: 57112kb

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: 434ms
memory: 59776kb

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:

370073595 279191608
470270598 490886017
587780201 605491682
541484471 775826542

result:

ok good solution

Test #107:

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

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
123638494 206012391
530099236 349622087
391891736 576178295

result:

ok good solution

Test #108:

score: 0
Accepted
time: 492ms
memory: 56640kb

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:

287759554 248440289
714576080 489243596
463876186 829799206
415903194 579214023

result:

ok good solution

Test #109:

score: 0
Accepted
time: 505ms
memory: 58844kb

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:

283464073 271079354
495600480 888186328
858697712 537981234
581894585 480434672

result:

ok good solution

Test #110:

score: 0
Accepted
time: 461ms
memory: 59660kb

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:

186783045 312339384
757731136 314838903
546919834 608769189
382327714 690416786

result:

ok good solution

Test #111:

score: 0
Accepted
time: 73ms
memory: 57456kb

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
291298463 129633626
277867365 554868375

result:

ok good solution

Test #112:

score: 0
Accepted
time: 738ms
memory: 114696kb

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:

222402012 504373347
636586960 564614008
290266297 218582871
581802600 787139842

result:

ok good solution

Test #113:

score: 0
Accepted
time: 78ms
memory: 58136kb

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 210251372
316293286 555776349
180631408 391689162

result:

ok good solution

Test #114:

score: 0
Accepted
time: 197ms
memory: 58112kb

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 271531502
566075376 870719989
438578609 496213296
188733288 310166832

result:

ok good solution

Test #115:

score: 0
Accepted
time: 518ms
memory: 93356kb

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:

385246590 464567373
660595899 542147133
472174993 215505285
424614584 615917936

result:

ok good solution

Test #116:

score: 0
Accepted
time: 279ms
memory: 58800kb

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 228945767
379383092 412445520
525581545 717707359
394147739 874423493

result:

ok good solution

Test #117:

score: 0
Accepted
time: 94ms
memory: 56516kb

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
285965333 532075787
471654799 372021746
382511659 369292002

result:

ok good solution

Test #118:

score: 0
Accepted
time: 740ms
memory: 119248kb

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:

161520561 578807714
746465450 457354220
374531099 219525993
504358258 773399276

result:

ok good solution

Test #119:

score: 0
Accepted
time: 94ms
memory: 59212kb

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
711641977 255705153
404153474 453146108
270392627 484943292

result:

ok good solution

Test #120:

score: 0
Accepted
time: 184ms
memory: 58360kb

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 223748753
640974446 669779571
459191583 486659431
170820772 541445250

result:

ok good solution

Test #121:

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

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:

273575632 559429286
789588673 396843827
618280922 211769981
443029638 681080728

result:

ok good solution

Test #122:

score: 0
Accepted
time: 212ms
memory: 58600kb

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 289488311
602254075 377434270
385244544 832112867
364357125 558027763

result:

ok good solution

Test #123:

score: 0
Accepted
time: 309ms
memory: 57264kb

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:

214910972 761521564
618361481 542835773
593454235 368480965
528337736 212093584

result:

ok good solution

Test #124:

score: 0
Accepted
time: 359ms
memory: 60840kb

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:

410124269 870447105
482142778 303300971
703557297 456679365
533502076 577450648

result:

ok good solution

Test #125:

score: 0
Accepted
time: 332ms
memory: 58260kb

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:

203462510 854338199
843642098 639749659
627780828 132200848
562640838 477962698

result:

ok good solution

Test #126:

score: 0
Accepted
time: 210ms
memory: 59392kb

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:

663465470 277198998
334134286 693450439
418412550 602769045
355335941 399739046

result:

ok good solution

Test #127:

score: 0
Accepted
time: 380ms
memory: 57904kb

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:

215462477 805717334
409231864 619518554
832644838 427034682
541924139 135266446

result:

ok good solution

Test #128:

score: 0
Accepted
time: 243ms
memory: 58900kb

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:

801874537 174419673
695471147 358684576
420807143 599055533
254897450 846450855

result:

ok good solution

Test #129:

score: 0
Accepted
time: 621ms
memory: 105248kb

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:

250218732 654939211
581772717 410497766
558172635 261780347
411323899 723201924

result:

ok good solution

Test #130:

score: 0
Accepted
time: 767ms
memory: 120824kb

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:

159430813 485211946
778339953 329807984
440096068 273764157
550128490 749353835

result:

ok good solution

Test #131:

score: 0
Accepted
time: 629ms
memory: 102644kb

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:

274267053 381855428
651748528 658555455
593056923 274793188
497022613 668069399

result:

ok good solution

Test #132:

score: 0
Accepted
time: 726ms
memory: 121392kb

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:

125845975 244833675
770043189 601230863
441118307 17476415
689931265 642429688

result:

ok good solution

Test #133:

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

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:

198945938 407775407
618575816 317905030
538879507 304504642
474983177 851850511

result:

ok good solution

Test #134:

score: 0
Accepted
time: 759ms
memory: 109332kb

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:

292439563 520384947
602394168 316668457
550061935 157648486
584947769 835930254

result:

ok good solution

Test #135:

score: 0
Accepted
time: 707ms
memory: 116936kb

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:

128974724 513535099
786367102 563912216
629565610 236428617
388483455 657695660

result:

ok good solution

Test #136:

score: 0
Accepted
time: 662ms
memory: 119156kb

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:

387027958 373533848
816229873 486016892
391378429 340311695
504114413 803374380

result:

ok good solution

Test #137:

score: 0
Accepted
time: 722ms
memory: 118848kb

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:

215337215 453544550
631108709 402377765
572417193 306573011
337081737 869078244

result:

ok good solution

Test #138:

score: 0
Accepted
time: 699ms
memory: 110676kb

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:

226488043 494356092
767920426 484975322
310539112 313970817
730800417 731745477

result:

ok good solution

Test #139:

score: 0
Accepted
time: 564ms
memory: 108796kb

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:

259373623 403561842
583081888 498156759
553808616 379248127
483741474 862337808

result:

ok good solution

Test #140:

score: 0
Accepted
time: 736ms
memory: 122556kb

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:

269170023 468247693
821389228 545257298
450999100 206003874
488910278 741200515

result:

ok good solution

Test #141:

score: 0
Accepted
time: 715ms
memory: 120036kb

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:

233010152 533375575
856342318 451219638
640825557 219818143
502699282 635400275

result:

ok good solution

Test #142:

score: 0
Accepted
time: 466ms
memory: 87208kb

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:

349816704 688419250
574292578 463735670
384500137 343173027
509547388 728519232

result:

ok good solution

Test #143:

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

input:

199917 4
249845993 351222357 704398035 996696706
500407588 103512186 911198450 556704207
68363376 24668863 771258363 823329947
256603708 510747410 584036386 929782651
121526868 293265483 370730503 688521364
241586615 95287688 445729798 934746613
620231880 504465932 993063742 599321349
19672518 32257...

output:

225736350 332085720
789097201 542866319
725604730 225199716
444547466 837275173

result:

ok good solution

Test #144:

score: 0
Accepted
time: 560ms
memory: 100308kb

input:

199961 4
406180039 5284611 584034165 677830009
332575298 93870201 733960201 758194632
290163435 293774241 623020152 532187435
679598319 352914065 959670900 878240479
267373004 49333469 652442300 576086205
203061443 301956992 625675982 897661291
119176342 196840438 719889594 576443661
109523004 49790...

output:

306511311 501478433
780030447 532260839
382028594 318666812
466087233 584072309

result:

ok good solution

Test #145:

score: 0
Accepted
time: 769ms
memory: 127412kb

input:

199980 4
128717565 525212721 812910931 855894531
387937813 230741107 983419547 450806245
27220370 538348884 887446272 784254262
385935949 572221446 509548701 979495135
485467291 165539022 619974447 558475321
183240019 266537680 549054995 770924691
203632469 155128787 770106283 695630977
174471788 27...

output:

298769410 558696246
875148809 293420465
486952629 173240395
431417277 761408861

result:

ok good solution

Test #146:

score: 0
Accepted
time: 785ms
memory: 115992kb

input:

199969 4
181622609 524044014 634714417 953744902
457103511 446067609 586558317 722308855
112451175 168890975 839881753 816554238
7050525 272301542 892450866 794271613
55677173 495764772 352131123 765318670
245857112 50798261 693896722 196862501
149995222 165988547 873551415 641294673
292845858 32629...

output:

197920715 593619802
713985968 503483836
323834493 135186554
511808458 687744397

result:

ok good solution

Test #147:

score: 0
Accepted
time: 685ms
memory: 110696kb

input:

199943 4
424470477 382443985 723445743 551520281
306064043 224537896 507352975 962256935
466159309 249734511 899634679 652043915
26101980 354145755 931976403 655569533
559599778 205436827 959380235 692343980
530168747 177272980 941273029 610104037
117627497 233583486 718077342 777869960
327849674 15...

output:

288812313 463985848
838022094 539830576
622874651 419407000
446970620 805558640

result:

ok good solution

Test #148:

score: 0
Accepted
time: 729ms
memory: 117668kb

input:

199996 4
20578236 220904553 557249754 751957078
316784303 481989517 902181026 908657448
48460507 50419555 902090911 774553233
359749738 78733383 822578384 718923329
187666588 67617392 797343141 924177324
89830720 307319675 742543678 733842148
47291771 317999531 489751358 349449156
208367626 81962085...

output:

170018549 342572232
729867115 583117212
448288720 164269832
518802023 700077460

result:

ok good solution

Test #149:

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

input:

199998 4
298101018 85248093 769375493 788972450
142403649 370803358 831968334 778260052
244763296 133761470 763756326 693700862
491350248 391310563 788037915 803648604
163365455 178735138 674442980 713713595
331475532 636635810 551913370 894988958
72850842 347196167 299629900 772790191
223553331 905...

output:

151822217 533481033
775121452 466552278
595152226 265176553
495183629 754423729

result:

ok good solution

Test #150:

score: 0
Accepted
time: 710ms
memory: 117712kb

input:

199980 4
328177304 147336086 499871643 481364496
437939846 53597466 804804867 571867533
37711121 12645203 799428767 848236153
304838139 383196330 559035216 689608180
510209207 27074568 855416377 635403175
299477761 333446711 941173388 944856448
528116655 342115704 772129606 821777289
231357228 12382...

output:

141151069 527996128
751356461 506618185
471964835 394366883
597216114 811171223

result:

ok good solution

Test #151:

score: 0
Accepted
time: 737ms
memory: 110900kb

input:

199944 4
675578370 106615702 743433043 451171399
178746131 345961663 447431302 899607857
257332522 267447324 504902958 452507581
319286687 152908705 998543258 292607800
141259937 249378001 435001815 527483006
515942697 562419204 722278580 670137858
504030785 635766609 952490208 790262486
236942704 1...

output:

282161286 377768713
702479381 638290171
696550007 253155723
373692455 766167287

result:

ok good solution

Test #152:

score: 0
Accepted
time: 759ms
memory: 120892kb

input:

199980 4
144372316 784444312 700625430 960813949
312240540 711056830 953839098 938583824
577906291 200142377 907634394 995960230
180225037 113982967 793439231 281728169
590013512 486793325 894645389 830892298
644967331 591112625 818365487 703169300
191587352 265390340 830579379 992888002
257969114 1...

output:

130888862 447384083
683556001 626295000
324179974 212469491
662845681 801659141

result:

ok good solution

Test #153:

score: 0
Accepted
time: 552ms
memory: 101148kb

input:

199904 4
213293588 207734749 745652479 660596594
375783493 76352869 641456902 635337955
319867680 321317619 690538763 777935448
1155857 750963167 833730489 864272866
467115021 90899612 916661830 627707411
539868593 145605074 999607801 600241278
30367932 234865231 364734018 864471832
308409979 709580...

output:

343377555 424334866
675049160 424337405
546811164 172187642
420392585 774813838

result:

ok good solution

Test #154:

score: 0
Accepted
time: 545ms
memory: 103636kb

input:

199987 4
418963082 736571252 871766729 970535109
654719672 258791210 790606865 886126218
124899374 46653325 750671039 951659749
32662325 103200160 860913545 194116070
315024668 370017630 722027547 889769402
183386895 223568828 697862043 646936224
382467750 738498554 911283637 927451566
56190345 1181...

output:

346254665 423877271
675589816 423885370
549460198 173191185
421689278 774717306

result:

ok good solution

Test #155:

score: 0
Accepted
time: 550ms
memory: 101904kb

input:

199900 4
193279486 364308099 557967352 571658349
413912105 170378468 639170456 640564362
536819950 56785893 998520133 582813623
49363768 215489372 363951734 796501692
17520568 157249580 881262572 460265094
211504987 741440621 563614172 921191492
113577685 79799762 848157892 439785015
97914367 870174...

output:

346318529 425110532
675392147 425106669
548879098 172611456
421535511 776451281

result:

ok good solution

Test #156:

score: 0
Accepted
time: 555ms
memory: 104212kb

input:

199912 4
241040252 690206985 752635311 882599402
406988806 714012621 979720299 973824682
388891830 105769096 636803092 604380838
385800218 119307511 626968876 649963369
55279314 61016556 951201291 175652271
377458003 729414114 989376742 975737594
239462523 318239796 589763260 633999637
415572380 767...

output:

345436823 423259087
674603029 423257076
547914565 171894494
421876139 774745571

result:

ok good solution

Extra Test:

score: 0
Extra Test Passed