QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#322823#2809. Presentucup-team004100 ✓299ms3764kbC++2021.0kb2024-02-07 20:06:532024-02-07 20:06:54

Judging History

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

  • [2024-02-07 20:06:54]
  • 评测
  • 测评结果:100
  • 用时:299ms
  • 内存:3764kb
  • [2024-02-07 20:06:53]
  • 提交

answer

#include <bits/stdc++.h>

using i64 = long long;

constexpr i64 milestone[] = {0,33751118,75992702,116437758,170614990,230739886,290855286,354085566,432245086,531108574,568870814,612293118,651920638,705855102,765146942,826166526,889429374,965887806,1063269054,1145670526,1233666398,1357252094,1505105662,1644323118,1726914046,1843922270,1973754366,2150009902,2185705086,2227254422,2272958014,2325220798,2386308782,2447666398,2512312574,2591771838,2686090014,2721489214,2762873550,2807207486,2860812910,2921068094,2982805910,3046299198,3125530174,3223828574,3299634894,3397945646,3523766582,3685626622,3802412142,3892963726,4007964270,4140022910,4301802886,4353035134,4402669750,4468565694,4543038390,4623235518,4703718294,4812658878,4870252454,4918603246,4979177566,5051794398,5131294134,5208637886,5311824438,5417085550,5531668350,5687199166,5905124862,5994130902,6130049902,6292111862,6454259934,6511693918,6557657278,6627134318,6711354550,6783327542,6864352222,6981069438,7025420734,7080077782,7139986878,7216432238,7290677438,7371380606,7479903198,7587832430,7711779822,7862048478,8061939030,8162263662,8306526078,8474813406,8619460990,8685561342,8760789694,8850582334,8948025470,9071651582,9161177342,9228085950,9303638622,9395527742,9492506878,9615980798,9744054782,9895087486,10114293246,10281167486,10433343102,10653118462,10775452926,10842557374,10919444222,11009632254,11110679038,11237120638,11316925950,11384145982,11462682366,11551709950,11653816574,11782646398,11908959486,12069509886,12295698942,12446854110,12608136446,12833417982,12952498430,13032337022,13145566014,13265348862,13423661566,13499446398,13593226494,13701644542,13834099198,13993033982,14170212094,14437379326,14630293758,14842274046,15057807678,15141962558,15242871358,15364705278,15504894718,15611934782,15704042174,15804195966,15919573246,16073691390,16240765566,16452624894,16710233726,16884935806,17176858622,17215603886,17258585150,17303254142,17360424318,17422199934,17486410078,17551614110,17639549950,17722977438,17763029134,17804494142,17855263870,17918593550,17977889918,18041336958,18106585598,18198168766,18284289502,18367884926,18485835646,18615395678,18795470558,18872432126,18979531390,19104195838,19268671614,19350923614,19399050158,19437364030,19491981630,19553127294,19614720702,19680465246,19760055934,19861793406,19899620094,19942681118,19987061822,20044608318,20106082526,20170567422,20235504126,20323087742,20412543358,20493638526,20607293150,20737611006,20900760190,21007126142,21091191646,21218992542,21358909310,21489286238,21548104958,21602797374,21679057566,21752232254,21825864382,21925471158,22021377662,22080210206,22125879694,22200563070,22281659678,22356124958,22448013950,22557785726,22658409518,22807219582,22975048190,23137195518,23253420350,23412868606,23622733262,23667688702,23723083582,23786464158,23862816382,23939034366,24026577214,24135755518,24197661278,24247788926,24308195486,24387400510,24466080182,24542864830,24655072254,24765866910,24880732670,25040142494,25239984254,25338696958,25480963390,25648845438,25801412510,25870863006,25950304798,26042674814,26147844926,26280619262,26359292606,26429274238,26516541758,26609197278,26720422590,26854607774,26988500478,27175524862,27394322142,27529325982,27718002302,27926620062,27994676478,28068039614,28155452030,28261305726,28387309182,28481882462,28550909278,28631286334,28723988798,28826709246,28958476862,29086202974,29247803006,29474647358,29628945662,29796393118,30021971454,30135226686,30224783678,30339128126,30471966526,30612794526,30702350974,30806055550,30921016126,31072465214,31222825822,31422041342,31691472126,31877409182,32122657278,32274015198,32358038206,32474054014,32598559230,32754351358,32834130750,32938511166,33053451518,33194456702,33358302558,33548929918,33827613342,33993340158,34234159742,34402271590,34478852926,34582463086,34707458238,34874652862,34962510334,35040669422,35148836398,35279374014,35455317886,35635387902,35933571838,36111657710,36366642430,36550183598,36627940030,36731348414,36855955670,37023919030,37111359974,37189024670,37298028974,37428101822,37606161918,37784923054,38086380718,38261129770,38518737406,38710685174,38816918410,38960687806,39143581118,39263897774,39372220070,39524068854,39719609790,39938236590,40287631358,40520102910,40822901246,40917855662,41050403518,41214339774,41377300654,41477198526,41613658806,41784813754,41989319782,42304639998,42565330942,42924148414,43059326062,43208355758,43426000558,43572662478,43716221630,43917735358,44168294634,44569395374,44848925950,45149203774,45282271802,45464968446,45668224174,45794132430,45966495166,46205374318,46506577070,46850674286,47247084974,47399939502,47621171902,47850033790,48024954030,48289671870,48651644414,49066618174,49444061630,49619601262,49873373854,50050386430,50257934270,50545601710,51007563950,51384453822,51596235198,51678664382,51788582454,51921871014,52086072830,52163216302,52258906942,52380885438,52531704510,52702421478,52924127998,53200967926,53396277678,53692999406,53768459582,53863457574,53981362582,54130618046,54261903806,54338366846,54445736638,54572941782,54744786366,54909351550,55172541614,55404840366,55639395582,55874078902,55975813838,56116340150,56305636030,56439490022,56547708078,56697473534,56896890302,57116480766,57466162534,57696982398,58004025814,58101623726,58242279854,58414602654,58565757366,58669303486,58821340926,59005055678,59222186494,59576011262,59802770174,60141950206,60272834974,60443280062,60675305134,60803291886,60971737790,61212489966,61500869886,61860760830,62256712126,62394080958,62555272446,62790282942,62924798590,63084571038,63316175550,63586260222,63965683198,64309578494,64541351166,64760769214,65004898110,65180420078,65442730686,65786268158,66215685806,66616062654,66792428990,67054476190,67240963454,67454373566,67755254126,68216889518,68623309566,68763799214,68829854590,68958882742,69056540086,69164751454,69283356022,69346253246,69459326558,69563958462,69657031614,69829104254,70066200022,70340193750,70542701262,70837896830,70916968766,70982863022,71118498622,71208627670,71338284670,71439075646,71504939838,71615173438,71718740310,71815874326,71992004990,72225212126,72500122838,72727006846,73016228950,73090357334,73217673750,73330359934,73451617918,73587794750,73665898678,73826520990,73919053726,74094283990,74369411542,74671283838,74964995934,75195170718,75272718142,75434826198,75515486014,75698942422,75771964182,75882540862,76010927422,76116152222,76322683230,76619881726,76920987486,77267631966,77391994446,77569996462,77713902238,77890016574,78017873598,78187448638,78400697182,78731284318,79090333294,79467309886,79569750846,79746506654,79930986398,80067402142,80216211022,80370376382,80610426718,81010761566,81347919102,81650560830,81841258110,82009554654,82210728862,82410892190,82578902846,82955913566,83385875198,83781967774,83953647230,84124757694,84331893306,84507590558,84684070718,85028396894,85461360126,85904384926,85971299646,86043994902,86177974078,86267551646,86436325790,86502457150,86567984958,86708937174,86785988510,86939693982,87104404862,87363534206,87609457230,87860947166,88074311582,88140480126,88254791262,88360855230,88458543006,88598208982,88665051062,88766285486,88887256894,88973906390,89152028030,89390787798,89666420462,89869483742,90163149566,90267002718,90378354494,90509095382,90627587998,90769082046,90847665854,91009048990,91104938678,91282909534,91572628734,91875572990,92154024798,92381402230,92466749246,92621121438,92717546750,92886417246,92961289054,93110558622,93219770174,93358849662,93596778110,93952928094,94226284158,94501565342,94615664718,94798216894,94999567006,95114484638,95297355678,95450332062,95728876510,96136489198,96475610366,96710135614,96867366526,97017945790,97213954398,97343194942,97517576094,97739609950,98075770718,98451118814,98806497182,98986283934,99161558718,99371138878,99566661438,99737685918,100128325246,100539268958,100955404702,101134015070,101309333310,101519244670,101714595646,101885726526,102276245726,102687429342,103102258558,103244242558,103453286078,103666296510,103845428190,104057168830,104461729022,104950264830,105285613294,105466372798,105677146806,105846447806,106048976574,106309533422,106777344766,107220849910,107488048310,107733105150,107980558014,108209773054,108501072382,109077167102,109564372286,109793519294,110059137630,110220900350,110458591670,110939847934,111517891838,111846992766,112208843418,112451567342,112835247486,113548836094,113942101694,114281771966,114534673134,114906430718,115553287550,116077895486,116486568894,116804363966,117378186494,118151675582,118477945342,118819268286,119254498942,120099634430,120362231486,120572239550,120810321726,120947538606,121169718518,121506232062,121985979134,122442113982,122595965886,122804125374,123017240718,123217792246,123459919550,123886434046,124372319486,124663669566,124905356990,125161459390,125395189438,125699989118,126271749374,126749412158,126981361342,127247025982,127443025598,127687732990,128213646078,128849280702,129096371902,129427859902,129703329470,130206792958,130965207806,131236540222,131570212542,131845463742,132341464318,133077891838,133446164158,133784682174,134186269438,134999916158,135496097470,135871434558,136205171966,136946760958,137450891134,137491562238,137532364094,137581736862,137642067198,137703851902,137762885118,137826740222,137917329310,137986836782,138026741630,138068273342,138117233406,138177855230,138237991934,138296374718,138361266614,138451855102,138535644286,138618538366,138729658110,138861273854,139049697382,139125290110,139218468350,139343417854,139495341566,139601741182,139647847198,139687005694,139733860542,139795051262,139858398718,139922716542,139989249054,140073389822,140137730430,140182775678,140221918590,140269795198,140330620286,140393563454,140458877758,140522860286,140607515390,140694441022,140778211710,140895309694,141025606654,141203033982,141279052734,141383464958,141508636030,141673153790,141762502142,141813104510,141873047422,141944145790,142016133566,142094857534,142197099326,142281753022,142339174302,142384867198,142453350142,142537688958,142610925758,142689718014,142810317758,142904935774,143044644734,143212480254,143383117310,143491476414,143647280126,143847996926,143919415038,143966903806,144028280766,144099750782,144179625470,144256581118,144360668926,144434931582,144492077502,144548460542,144620735038,144692973310,144766493758,144859621046,144967797214,145069381886,145224629758,145396141822,145555957246,145666412286,145828970238,146030673790,146096260542,146164155134,146240898110,146332999166,146442772222,146569891710,146635109950,146703815166,146782034558,146876843646,146986775102,147116928894,147249563838,147438448382,147654318334,147786734590,147975532286,148184899262,148248869246,148319517438,148397897470,148495187710,148606614270,148723403838,148789350334,148858686398,148941224958,149041569278,149151789498,149281848446,149418939902,149603565054,149819240318,149956462590,150141189630,150339170174,150426185470,150527805886,150637493758,150777996286,150896643966,150980600702,151080966526,151204864638,151346962174,151508274942,151729503230,151977183102,152153425790,152429493758,152540827582,152624083386,152740491006,152861031422,153012341630,153088407806,153185115902,153293766142,153426106622,153587666814,153763758974,154037984254,154222456830,154443341310,154631966126,154678618494,154718043134,154766688382,154830204158,154893559998,154959867646,155028913918,155122804990,155178513534,155227153502,155265401310,155319601022,155380506334,155442233086,155508171966,155587231230,155688566526,155768078558,155861290750,155986607614,156138983166,156270076670,156359910142,156476145662,156607555766,156772086974,156811710142,156852874494,156903893758,156967699742,157026376062,157089624062,157153680894,157246271230,157316288734,157362815454,157402279358,157450930878,157514478462,157577794686,157644131326,157712927422,157807045630,157892999166,157981287998,158109141214,158243114750,158394658046,158478994942,158591527230,158722510014,158903368702,158956717822,159010719070,159072661374,159151333118,159228045310,159313427966,159422562046,159486983934,159535237566,159597720446,159673574334,159754032126,159831762430,159938444798,160054978430,160164914942,160327411582,160529085566,160625803710,160765822718,160933910526,161076615038,161135415230,161192234494,161267011518,161339501886,161414657342,161516993534,161608777598,161667584894,161713666814,161791391742,161869541118,161943406782,162036585214,162146071294,162248343998,162403641502,162571816702,162731352446,162844011390,163007812350,163210100478,163278178238,163347894206,163431585982,163534807038,163648871934,163761188606,163830054078,163907264254,163995986526,164098887422,164226587390,164358873470,164507212542,164721772270,164897865982,165049620478,165268196478,165398553982,165466727166,165556551166,165641415422,165755404030,165893300926,165960987518,166029669246,166112159614,166211915518,166327929598,166459506430,166599482878,166785006590,167001252606,167143067006,167329966078,167524465662,167613164414,167716539070,167842967294,167986768766,168099404158,168185196414,168296778622,168422684926,168586184574,168754527230,168994328318,169213595134,169418341886,169662606590,169752133374,169856153342,169971637758,170122389246,170232120254,170324573950,170430463486,170557736702,170719345662,170874481342,171108466174,171339955966,171538687742,171805149358,171878449566,171967714558,172079314430,172217327102,172359321342,172437237246,172534691838,172650210750,172806808574,172973476350,173195929598,173468455658,173661522686,173953409022,174026294142,174116221118,174227798014,174367220734,174508348318,174585419134,174684393982,174798791094,174955957758,175121809406,175347907582,175618155006,175812982782,176102580270,176198659390,176322916862,176475786750,176651613694,176746419710,176878962430,177042954238,177249668606,177537296382,177818776830,178142651902,178312775230,178419509758,178568035326,178761124862,178858739454,178981759742,179126784510,179328857342,179560983294,179898527614,180156431358,180433866430,180566013182,180742306814,180952112638,181077093150,181244165118,181481529854,181773034222,182127960574,182528277502,182648522238,182801960702,183018900222,183165457278,183309053694,183512812542,183765646334,184163213310,184452052990,184757677310,184934825470,185206324222,185364311550,185577525246,185875369470,186336672766,186763042814,186965863806,187171498430,187410859774,187580146430,187831679998,188159118334,188600279038,188992720110,189073262590,189172857854,189292045822,189451838462,189562589054,189645611774,189755163902,189886549502,190061817854,190234703870,190525230590,190720133374,190969789438,191168859134,191248230590,191358838974,191486914750,191663562942,191739022846,191829292030,191943650814,192086681854,192267077822,192467204094,192765095934,192946422526,193251081214,193356746238,193483417470,193638864894,193823190078,193921095422,194054679550,194220197886,194428540926,194715512830,194998058494,195320401406,195494026366,195606111742,195761491966,195960439742,196055997950,196177669630,196336942078,196545786878,196805573630,197114275326,197402389758,197644665534,197788342014,197991324670,198176482814,198317970174,198517546494,198774349822,199179526654,199455141886,199768990462,199911045374,200096628222,200299159294,200438066558,200625081854,200875318782,201230765566,201542434814,201903030014,202076234494,202337140222,202520448510,202738657534,203038403454,203490921982,203886906878,204132765182,204350061566,204593643006,204774426110,205035650046,205388839934,205814783998,206170171646,206235399294,206323891198,206441965310,206532558334,206697127678,206762495294,206828468222,206965893374,207043323646,207178972926,207343525374,207603127550,207850964734,208109311102,208321263166,208386727806,208483802878,208603241982,208687718142,208848251070,208913671934,208984269758,209118633726,209196416510,209351310334,209516999422,209780767742,210017888510,210269027838,210489464830,210567663358,210728091390,210819595774,210992038174,211066176574,211193483006,211306219646,211427551926,211631095294,211936977918,212242283518,212600899134,212673891646,212783762174,212912766462,213017774846,213171331998,213248644094,213410718782,213491679102,213675095166,213948388734,214247373822,214532487166,214784174334,214896892542,215078788094,215286445950,215382777726,215558160126,215706065918,215971904254,216386843134,216719891966,216963773566,217103216510,217257384190,217449533694,217563709054,217738247166,217929774846,218243415806,218593244286,219010628606,219155957502,219359739646,219584076030,219719229310,219920469886,220170198014,220654300926,221044407294,221283604478,221486012286,221695868670,221837344510,222039640894,222270324222,222676842494,223138479614,223373957822,223440610814,223554280446,223664026366,223767830398,223897501182,223963905534,224079521534,224186027518,224282287870,224458505854,224693671038,224967669118,225195179006,225487160382,225554008254,225622628030,225760026366,225839234942,225996366846,226073230846,226139610878,226289883134,226368030910,226503480062,226668845822,226928890878,227178211582,227436857726,227661610494,227743631486,227906666238,227995697022,228171977854,228247159870,228378271742,228505700542,228621384446,228836415486,229176786686,229460715518,229784620926,229859479294,229992254206,230117434942,230251186942,230364156670,230458510334,230602729214,230700787454,230902158590,231195093374,231480180222,231777236990,232000338430,232154947454,232307736062,232503619326,232633090942,232806731518,233027468926,233361128958,233740216926,234089810302,234208140542,234387226366,234590905342,234705891838,234885967742,235049122814,235326444286,235729092222,236068912638,236313927166,236525662974,236738487294,236877774334,237096937342,237339287038,237802420222,238210707454,238462982014,238673301246,238886738558,239026109950,239244574462,239487131134,239951802366,240359071230,240598927358,240800378558,241055895358,241168158206,241387486718,241665784830,242171308030,242669317630,242781300414,243004025086,243233223166,243375491070,243581111806,243926024190,244402123518,244855350270,245084169726,245350212246,245505775614,245745548734,246229040126,246806816254,247075811070,247329356798,247569017310,247800726458,248102004990,248673410558,249171491838,249448594942,249739967486,250030804478,250663530494,251289323774,251551691262,251860054526,252136483070,252665478142,253406563838,253715086846,254049206014,254445811710,255259834366,255740951550,256122227518,256435321854,257162690046,257739087358,257905572862,258111853310,258313214206,258516076030,258776765550,259236198398,259690560766,259942585214,260152600062,260393157374,260525327102,260747442174,261059868670,261562300414,262030491134,262255343614,262518601726,262697826046,262937340670,263425816574,264017410046,264275888822,264519794174};
constexpr int kM = 1000000;

constexpr int kN = 40;
int gcd[kN + 1][kN + 1];

void solve() {
    int K;
    std::cin >> K;
    K++;
    
    int m = K / kM;
    int cnt = K % kM;
    if (m == 0) {
        cnt -= 1;
    }
    
    i64 base = milestone[m];
    i64 ans = 0;
    auto dfs = [&](auto self, i64 mask, int n, int gr) {
        if (cnt < 0) {
            return;
        }
        if (n == 0) {
            if (cnt == 0) {
                ans = mask;
            }
            cnt--;
            return;
        }
        if (gr || (mask >> n & 1) >= (base >> n & 1)) {
            self(self, mask, n - 1, gr || (mask >> n & 1) > (base >> n & 1));
        }
        if (~mask >> n & 1) {
            mask |= (1LL << n);
            for (int i = 1; i <= kN; i++) {
                if (mask >> i & 1) {
                    mask |= 1LL << gcd[n][i];
                }
            }
            self(self, mask, n - 1, gr || (mask >> n & 1) > (base >> n & 1));
        }
    };
    dfs(dfs, 0LL, kN, 0);
    std::cout << __builtin_popcountll(ans);
    for (int i = 1; i <= kN; i++) {
        if (ans >> i & 1) {
            std::cout << " " << i;
        }
    }
    std::cout << "\n";
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    
    for (int i = 1; i <= kN; i++) {
        for (int j = 1; j <= kN; j++) {
            gcd[i][j] = std::gcd(i, j);
        }
    }
    
    // i64 gm1[kN + 1][1 << (kN / 2)], gm2[kN + 1][1 << (kN / 2)];
    // for (int n = 1; n <= kN; n++) {
    //     gm1[n][0] = gm2[n][0] = 0;
    //     for (int s = 1; s < (1 << (kN / 2)); s++) {
    //         int u = __builtin_ctz(s);
    //         gm1[n][s] = gm1[n][s ^ (1 << u)] | (1LL << gcd[n][u + 1]);
    //         gm2[n][s] = gm2[n][s ^ (1 << u)] | (1LL << gcd[n][u + kN / 2 + 1]);
    //     }
    // }
    
    // i64 ans = 0;
    // auto dfs = [&](auto self, i64 mask, int n) {
    //     n = std::__lg(~mask & ((2LL << n) - 1));
    //     if (n == 0) {
    //         ans += 1;
    //         if (ans % 1000000 == 0) {
    //             std::cerr << mask << ",";
    //             if (ans == 1500000000) {
    //                 std::exit(0);
    //             }
    //         }
    //         return;
    //     }
    //     self(self, mask, n - 1);
    //     mask |= (1LL << n);
    //     mask |= gm1[n][mask >> 1 & ((1LL << (kN / 2)) - 1)];
    //     mask |= gm2[n][mask >> (kN / 2 + 1)];
    //     self(self, mask, n);
    // };
    // dfs(dfs, 0LL, kN);
    // std::cout << ans << "\n";
    
    int T;
    std::cin >> T;
    
    while (T--) {
        solve();
    }
    
    return 0;
}

详细

Subtask #1:

score: 8
Accepted

Test #1:

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

input:

5
62
37
88
57
72

output:

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

result:

ok 5 lines

Test #2:

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

input:

5
88
77
21
87
24

output:

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

result:

ok 5 lines

Test #3:

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

input:

5
59
5
72
76
95

output:

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

result:

ok 5 lines

Test #4:

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

input:

5
3
58
50
91
38

output:

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

result:

ok 5 lines

Test #5:

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

input:

5
6
38
78
60
52

output:

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

result:

ok 5 lines

Test #6:

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

input:

5
53
2
54
17
77

output:

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

result:

ok 5 lines

Subtask #2:

score: 21
Accepted

Dependency #1:

100%
Accepted

Test #7:

score: 21
Accepted
time: 166ms
memory: 3692kb

input:

5
967473
149056
95798
903699
54343

output:

14 1 2 3 6 7 9 14 15 17 18 21 22 23 24
7 1 3 4 8 17 20 21
9 1 2 5 7 11 15 17 19 20
17 1 2 3 4 6 7 8 10 12 13 14 18 19 20 21 23 24
7 1 2 4 8 11 18 19

result:

ok 5 lines

Test #8:

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

input:

5
824612
692511
834141
820975
111302

output:

14 1 2 3 4 5 6 7 9 10 11 12 18 23 24
10 1 2 3 5 6 7 10 13 21 24
11 1 3 7 8 9 11 13 15 19 23 24
11 1 3 4 5 8 9 12 15 17 23 24
10 1 2 3 4 6 11 12 13 16 21

result:

ok 5 lines

Test #9:

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

input:

5
115600
813100
742542
206782
714068

output:

13 1 2 3 5 6 7 9 10 11 13 15 17 21
9 1 2 3 4 11 12 14 23 24
12 1 2 3 5 6 11 12 14 17 18 22 24
11 1 2 3 5 7 9 11 12 17 19 22
14 1 2 3 4 5 6 9 10 13 17 18 19 21 24

result:

ok 5 lines

Test #10:

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

input:

5
271953
490598
560137
729339
980828

output:

14 1 2 3 4 6 7 8 9 11 13 16 17 21 22
12 1 2 3 4 8 11 12 13 14 16 22 23
12 1 2 4 6 7 10 16 17 18 20 22 23
12 1 2 3 5 7 8 9 10 13 14 22 24
17 1 2 3 4 5 6 7 10 11 12 15 17 20 21 22 23 24

result:

ok 5 lines

Test #11:

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

input:

5
78005
94222
345802
240639
797525

output:

14 1 2 3 4 6 7 9 10 11 12 13 16 17 20
12 1 2 3 4 5 6 7 11 13 17 19 20
12 1 2 3 7 8 9 11 13 14 17 18 23
13 1 2 3 4 5 6 7 10 13 16 18 20 22
13 1 2 3 6 7 8 9 14 18 19 21 22 24

result:

ok 5 lines

Test #12:

score: 0
Accepted
time: 219ms
memory: 3680kb

input:

5
213815
388934
704608
638223
965441

output:

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

result:

ok 5 lines

Subtask #3:

score: 41
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Test #13:

score: 41
Accepted
time: 176ms
memory: 3744kb

input:

5
264009813
338082986
193952046
78609665
69397288

output:

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

result:

ok 5 lines

Test #14:

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

input:

5
150219445
322427094
31308257
148721382
412214364

output:

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

result:

ok 5 lines

Test #15:

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

input:

5
151756875
427011464
58969849
244330943
310625967

output:

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

result:

ok 5 lines

Test #16:

score: 0
Accepted
time: 165ms
memory: 3680kb

input:

5
179476159
129836662
494167066
336058841
348325607

output:

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

result:

ok 5 lines

Test #17:

score: 0
Accepted
time: 208ms
memory: 3632kb

input:

5
337931259
398093956
349469813
381304523
455533754

output:

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

result:

ok 5 lines

Test #18:

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

input:

5
5456876
29594798
37782325
167839691
354330184

output:

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

result:

ok 5 lines

Subtask #4:

score: 14
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Test #19:

score: 14
Accepted
time: 275ms
memory: 3636kb

input:

5
518437301
666694742
559265585
512923635
621833328

output:

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

result:

ok 5 lines

Test #20:

score: 0
Accepted
time: 242ms
memory: 3628kb

input:

5
633963943
615542568
828135456
568557686
770592955

output:

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

result:

ok 5 lines

Test #21:

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

input:

5
872589670
817203941
677799344
886039387
913475137

output:

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

result:

ok 5 lines

Test #22:

score: 0
Accepted
time: 160ms
memory: 3696kb

input:

5
670654397
910193787
921254051
975272734
607399529

output:

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

result:

ok 5 lines

Test #23:

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

input:

5
628012728
924251460
522922329
904744468
644444189

output:

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

result:

ok 5 lines

Test #24:

score: 0
Accepted
time: 133ms
memory: 3624kb

input:

5
980123780
914372233
788153300
820127076
873721786

output:

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

result:

ok 5 lines

Subtask #5:

score: 16
Accepted

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #25:

score: 16
Accepted
time: 223ms
memory: 3624kb

input:

5
1358094333
1154803687
1277000267
1417906383
1326768836

output:

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

result:

ok 5 lines

Test #26:

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

input:

5
1100135829
1287342975
1408078880
1246372296
1263782767

output:

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

result:

ok 5 lines

Test #27:

score: 0
Accepted
time: 169ms
memory: 3640kb

input:

5
1306529540
1338402393
1435825745
1298031139
1263046790

output:

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

result:

ok 5 lines

Test #28:

score: 0
Accepted
time: 217ms
memory: 3708kb

input:

5
1299841326
1050490081
1319190964
1496700273
1351264279

output:

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

result:

ok 5 lines

Test #29:

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

input:

5
1126333587
1363542178
1219832547
1117001699
1052017949

output:

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

result:

ok 5 lines

Test #30:

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

input:

5
1419871457
1342818229
1195637683
1225498668
1123546639

output:

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

result:

ok 5 lines