import Data.Time test f n m = do begT <- getCurrentTime putStrLn $ k endT <- getCurrentTime l n k = go 1 1 1 where go i ac az = if i>k then [] else (ac' `div` az'):go (i+1) ac' az' where ac' = (n-i+1)*ac az' = i*az main = do test h 9000 20000
Standard input is empty
h (9000,20000) = 388889519792727476993320881105093614284807468582201756144850324405613984411398468654444586928077806965596732074511480886018170422740678877215610280765985442224643588630331329568756506041032471085665271801210497482772100043928864988865814250397870158841332838928094347487375365323288183354477702564186868728806751419478076574247924168583961946605756249045496888159966834112644722613459747602471792656877325945255671748619828982445220587810693092122811267141025325004691343874918906819462612995953999786759006502255601413012783183433673162563808305081634263470352824121089220824068077038573235367912867980812937710152554062408131090904199418347629229632224552166950302209514689181219700057117413024179246016348979842310183909295126944164681445671786078197843573416826496751578803414056315018258325655777877552312661694446066546708892795153997014673148472611644260019124433542368918731273159426123358790905184097039579668272395790320589811013136809666042298555480141832377575834500399533475804373169853867695359265296842414423094715176917889689766066103511374918249851625362143287233303275154207012938266978413082000163923237354394081827714834211121968244069473416142999359110254161414754918332989756223107167988671711383351161262099805704221862978014903735289349936749017126428458523422315782771975581490275909488130947199384057449941281950458252799842427476698837444271088401492564734988962848642343219196529979843761584190497265237365178051142582547505971068962766743206823636391533650938798005649413309754617013790473029784430022996419177033615284124770075704049945957434069054186468756855937220264515022231243497503911731208733691232140425489607689019132933634873547981176683917801005073693226935863013145913292680878980922103664249063417332955879402587344066026543976240385265061965501352450931501020154084479324413324208586827926986761122703272833392135503945445071168707387821686947567984985813999324317812594771344273514792476957271207959414562481708320228065056159422722686204858501412851451880763030500759636273828302744497400555509606859659464388657169387466410589027004239047420605479974619982824686331659354250834810596835652252697972146681475741559840116533590140867293106341194737783673600830225949399623887760566985318440709782400972244276899345822390935090262214478042250913010814504655606875220373214294997575936420903633648194406905344090945272087060888952557752041739660793488729780107332483467281078723712108598031792630189400993655385280856543964670471204344274827850641490838908190698772337262932271591749295608168645911760514671408563316097288062579561037652498473285034936412278427030621049509552600516743655665054563200756810059565788655954621700491288832508446245094863076181812384503948144456310716977075432242863342129355054464222591197267868690566511216054344511398298093022650696796590889434593875440260186514042745779216239035563495266885681690912850653326968150039619537008504390697885863159357253503844837350745423627769017594243798151108483583012299906047202538653637605252377328739717177074153084286836403071719039387233610043401008713239122343285798189658366242745065107868379124071599324837325972395501016282636327057097240925336246026866590639926408299737587527373170890653042893137064877763482588901403894650724268771714300929949841705611469690049827763996825321647515983560729327932266158796845304389418800109076719161074868860208407988451525003925562318724017640088379755727028758977087659516261766551741035299108101985090973473951216429891708656994574456264513891799409936015173903993204159637519358114727728425064661700821614699744784621132379979448981888690148416131955311738162130363514044364968420963607257826121389752743882354114845000691428756380849766816412186704437463556103399782505093160968178265736905414465746199987014053907375845095932912098442679109948109462477067295560835798859309714281110267694411484027652138633792384244873563012920776192961041420026324216433380055429066413490986181094168754490576699811670292424245890176597360761100821346143358419331559183852082209146927436749835958740590631917669792834907746085550311901942177628010004118667269076169919973066195423658102704734456339191739766413582495994470396074033393215332678969505095484602462858911971957258660919718237552226414529142292374147346388773596343951093865132398427322481978454932571878988664461339888997978323138435823917732105347399538726903556467906406582422813227108410801026665488611787621332656077714351519779210654107693150642550594058997977129057903106972718048284086169285211212284408966102665294272955587810067598079867362933143168558308445748403661242383973365090847350463308579235006957061246833729124337085917063081926875014892789124612133563406410919620251226263527920054092492080485235396330918014173950472350236024921844701711574834088484031062134772131397232110896654559419567047102617921117209856115330837900529585681131698703623634723387986468312297749966244609958796385129280091782060131031306136121095853300575635596651316666060446683915415591657158415699754742547227612427119490226968408223699480332785517191053394267101906421691376606789881830755504279961942444269042513385411875312402371565397046552846771767310188765743899314753456434782158149111553975757997708161431906514386483457438506871312682244050030161083328735674754699031285184338816910610186414415416566931216054922641951793772791754569050325320133153890071687285641630050700122008172343628715232422076132052988177989060441035827265811095884269696255840009676178852284691810323470626025269194112572822189595121849667156579676870021447841250505713484808967273866451037240789292561629228072142144317443561163466963612159265073725046266650889066135444752563647374321099265366142967543295071063940664461721641185465270578745123530253643717334232678777911912520491682576559876584329226196149635407877559518028966788826874082697847694709089166856516193203273827495564874978160393933943761102413736367890351394245779808731445889817100523831337077673345772782242741264447 As it was mentioned - 5976 digits ;) Elapsed time - 5.002645s