Problem Statement
You just made it to the final round of a game show! You now need to play a game to win your prize.
You have been given some cards.
Each card contains a string of digits.
You are given these strings of digits in the
On the podium in front of you there is a large board.
The board is divided into rows.
Each row contains some number of consecutive blank slots.
Different rows may contain a different number of slots.
You are given the
The game is played in turns. In each turn you choose one of the cards you have. Then, one of the slots that are still blank is chosen uniformly at random. Finally, the chosen card is placed onto the chosen slot. All random choices are mutually independent.
The game ends as soon as one of the rows becomes completely filled. The amount you win is the number obtained by reading the filled row from the left to the right. (I.e., you can obtain your prize by concatenating the strings of digits on the cards that were placed into the filled row, in the order in which they now appear in the filled row. Note that this order may be different from the order in which those cards were played during the game.)
You have no idea how to play this game.
Therefore, you decided to simply play your cards in the order in which they are given in the
We are interested in the expected value of your prize. Let M = 1,000,000,007. It can be shown that the exact expected value of your prize is a rational number. Let P and Q be relatively prime nonnegative integers such that the expected value of your prize is P/Q. It can be shown that Q and M are relatively prime. Compute and return the value (P * Q^(-1)) modulo M, where Q^(-1) is the inverse element to Q modulo M.
Definition
- Class:
- AnyNumber
- Method:
- findExpectation
- Parameters:
- String[], int[]
- Returns:
- int
- Method signature:
- int findExpectation(String[] cards, int[] blank)
- (be sure your method is public)
Constraints
- n will be between 1 and 50, inclusive.
- cards will have exactly n elements.
- Each element of cards will contain only characters between '0' and '9', inclusive.
- Each element of cards will have between 1 and 50 characters, inclusive.
- m will be between 1 and n, inclusive.
- blank will have exactly m elements.
- The sum of all elements in blank will be less than or equal to n+m-1.
- Each element of blank will be between 1 and n, inclusive.
Examples
{"1000000007"}
{1}
Returns: 0
You have a single card. The card contains the string "1000000007". The board contains a single row with a single blank slot. In the only round of the game you play the card, the slot gets chosen, and the game ends because you just filled a row completely. Your prize is 1000000007. This prize can be written as 1000000007/1. Hence, we have P=1000000007, Q=1, and therefore the correct return value is (P * Q^(-1)) modulo M = (1000000007 * 1) modulo 1000000007 = 0.
{"123", "45", "6", "7"}
{3}
Returns: 401988
You have four cards. The board contains a single row with three consecutive blank slots. As you play the game, the cards with "123", "45", and "6" will be placed into that row, each onto a randomly chosen blank slot. This means that there are six equally likely prizes: 123456, 123645, 451236, 456123, 612345, and 645123. The expected value of your prize is their average: 401988. The correct return value is (401988 * 1^(-1)) modulo M = 401988.
{"46", "135", "00000", "3024920394"}
{1,2}
Returns: 166676675
This time the board contains two rows: one with 1 blank slot, the other with 2 blank slots. Here are the possible outcomes of this game: With probability 1/3 you will win the game immediately after playing the first card. (This happens if it gets played onto the blank slot in the first row.) In this case your prize is 46. With probability 1/3 your prize will be 135. This happens whenever the first card goes into the second row and then the second card goes into the first row. With probability 1/6 your prize will be 46135. With probability 1/6 your prize will be 13546. Thus, the expected value of your prize is 60043/6. The correct return value is (60043 * 6^(-1)) mod (10^9 + 7) = (60043 * 166666668) mod (10^9 + 7) = 166676675.
{"0001","1"}
{2}
Returns: 5006
Your prize is either 10001 or 11. Note that unnecessary leading zeros do not change the value of a number.
{ "23049823728915788877792227159747104412489500114823", "0","0","0","0","0","0","0","0","0","0","0","0","0","0" }
{1,1,1,1,1,1,1,1,1,1,1,1,1,1}
Returns: 700700700
{ "00818779221632", "278572651816185", "6333769219121862", "26393834152447144", "538326000966547591", "9821611315224768137", "93972464995137565728", "3898045535918771635", "590165533540363294", "44937786507616011", "4104385393322343", "073516634500928", "60161293266216", "1113290873818", "324806712350" }
{2,7,3,4,1}
Returns: 708644595
{"08270135","65372107115445284284433394","088657907769221110402060665","1917529680147900383987354414081814","86099824060762160244484956586407286898084560","34668","720421346722526543206127544829550610343388973965","548462925114556405148183","605509115994283272476185865802451234","771501859","532831242201141734464","89","7085591897478974928796111833876716747","3471681485797155645061216449245638742051784","3742461","85664549158203429547187531","750623015988543575550","593146655280374689081405","09152502240063555462641333363482650083088350","423981176342647","04902951025430163780954832058254602372453720341","4131883113444979950142729537139158","87925091454625930375436263","0489859189","135720011097694","43236886141876646735918347455392075170114774696","977901","7497310196721573356","73869679797571504860609254343","003371047109042930110"}
{3,5,3,4,1,1,2}
Returns: 989750826
{"558329108022224193658057451","703784653263603865648070467777155966287530231","39689598063","6354218484706931604038928798596272526515167387","390709546592820966263808064072638798939380","166001659621067451611551278744115566632348664737","5135825113","22438485","1","37128022","59549088879","80220704841729432435181572680961508","602779609083924925439660483584","20754302515249151936953","7107106379443234847001860736814192960555893","79610477640646040549776875745269702398","1362842531750285917903724865275537","773716252926194","32679139512437550163487626322017816134962116459","674","65438631349950904937380366","0089010516606","358438862904816543284","25012231550097206079084023","633","266493609545","7442038698050878146835729033053887994993","51506148180184236","187425515595344","93002412217684638","46545947539188108116496","896680226991160719346771","3006283880796301","6683778894823","6648","71760","31115566781870266861709805","43932593648292040663","05508113787374195187983267507933884121193215390","118123354","370573640855698390933246122156123975711857752","32277025006753875705002033995584849686357833215015","478093279791108776448203239","631928577646222769665694480870753089635711863410","3657474412340812257074989245620116225700459890"}
{2,3,1,1,1,3,1,4,1,1,2,2,4,1,2,1}
Returns: 943866190
{"204614641822873235246166797075748338","2611240221157406895560","836156395619094918471793972717414508158773","44586283041","61060975555","8511933608687811540084792786723936241957872805","3642334282218201976207007750735775023794","406171623255296054671411797356","0120117877608335290363809744390370","2190486383667693924245787317807338395500624316778","067626010212392094643779653282401962973333155959","1200851681914886437","159","0407","93","881419707293758668","5094436974748912774947834","879526","480653946338094125748867896370075311573"}
{3,1,4,3,2,5,3,2}
Returns: 148235161
{"79375719585848400850030010191983","982445573911","98918379654659374","6","81682414846163514","952178086027327279304487596415106607","8863771385840218748496243136949258","58547114119573360784470","9260433","5984019226238818267792502130867073601704621259","53965897921883649","117689982864330900438216724844743044817441","7111973366345412637269990675788138892638915","4915830190371925","12438594204205896066103579424662556046687239","35070281557147730487975713","4791338685957305851878","03519057030394954730802","6062630938185157126215961626241394021809236495226","58","651989099503718893222661685795502778199427314","447557047448544421130916867825024921000425760249","436412358776793956607750639858455409815722590255","08296584476206745124426479","7784627320791784450192884986770045495672879133","9884059041653817360311287513667075331542639","1","9652714268540227944161314301004","56325093588394189542430885210"}
{1,2,2,2,2,1,2,2,3,1,1,1,4,2,2,1,1,2,1,1,1,1,2,1,2,2}
Returns: 711913916
{"956198783584236375472175","98311489356322906501286655731616861564338034690","07103590169204136060584326051104264552","6683128374631093666752070865","404736878751115243063665341905051917909382567","46648358612907086560716630214748280502","44416043","5680465078036551845278638560133","2802401385048153077125687597019462657871635974","27766314091888058634637342141195700300862132","84261749910230482603359","335275368741756941909791517763296906470042413388","38683434469706211682945641719238673986835","274834804398436192135839","62401137617724083","963880897715101021056733862222","562825495244396668585633995554864308558918645"}
{1,1,2,1,1,2,1,1}
Returns: 62397783
{"71472645493896393133963505384442","375441932","935185299496341801266629673616532456567750901557","34057506497289888690453031","5662257078349926","37389209608237708051537593487508448739979030835041","1777806788566124151299674658611760097954","488209823021242274918492020853894405876211215","2951487140138917448192157751","7355664132117489982468271822526184455","410781839","7045953084774109701092543484267976396370","651868550610838372041130118794005"}
{2,3,2,3,1,3,3,2}
Returns: 641724179
{"98706651012465665811036","014285449929678368804604093","546361327672169","6242235180237314160116793388178581193061744793","066389094125694137","85557655247737064","83902943828079661708773081","081771611973355426982430337623698613143","75500527456990","3576663238700967535720","33665744366091641706","833798688272032269092159960591620315","42","6651184681816396037513956","414968648278799640988409067123333","6364379201503714773705669197562064","2376934136628086766397490467812167484","441315311072363769","422900192134428406"}
{2,1,1,1,1,1,1,1,1}
Returns: 719942484
{"665908976","573094507733723260513755481282083","13684862749333612","467078920834678","752","637553784540846738052460179474700545878700591","891114713816446321777153751539030053362665194","7842117688087584356183714674628994654071","010","2942333137","938","19077078649438528183432524072678400679206328463","3614037122883567159","905528719040258253394622593220769546402809306800","513935642936051152081744440832542541973","3817526632224853335293295019025","823381054953760708447080497940","263861322154656249547194196542","9613764","2846674863129232","703484660120926147709677984084081","141306092","098605859743632910891150","6370717","51","9703563229407656622107403","9480471319509083964659698838004554177","1664514","1343144197432053088940462356894625131733","25427068530242733420736140263","322267420781928073032630379390694287"}
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,3,1,3,1,2,1,1,1}
Returns: 519505687
{"1755","1235835773903003997931078096008540792751895626034","759846802459074241532364782014727632617492160269","723366075124954906549423263588","62298981","8767464174346251782","060655930776774858424215764599227983","6597986777249303134495","67257439253","5888510883873529853300577268","0468","4229158592440888642989779711519530581386","81815806987738","69033128789618","682231034400810322901013474728997464","3581654518360140448713981983551018251766","67","148671988400106677055715143063199766047719","3695","22645065613599857160255322131722146793221039307036","328444785152806261001274782","411806194104479395665832887291487968905438249373","26789508471875289286281468"}
{1,1,1,1,1,1,1,1,1,1,1,1,1}
Returns: 1755
{"49488842041976","82254","352072096860643211324735881504510803068391","78532061","85409527741606705638682111628711436967868","10179","8636680745210889211785458425679715238189","6405258","85168940652826355598314750366975895508534867485615","25831","768506962805288387862631727164156","15735921398534154746081","60778265504964","55821839911331466056717227032","06080561209429159427439382","8412366690907166339","3976091090272333469104056080","28","69314970018928069746530493153","59771","3344766036761146","6240435657604217228728924841942437296718499","074","351437866802476929","93009243997540469985094755617820942312865311988136","13618106505082184","2216842624909749991488847","7368509","08698565513668109208856276320155486017947526281","209542408249305928818552296561694508","994815798309831813321286050457899007224842","2000"}
{8,9,5,5}
Returns: 305678650
{"05288732190523180399682256427","00060563823573966977","709535041125800800622832251393","3973922473626030258307810","90173637434550230061194004193","23425567666266242853653641","072270053993950477158291","187306003140115191341969351112","23353975474","90140163442897637453","397707016838803939848806766012259305627903000","3","29180778202570450484917031080","45344080100442606535040313258984","66844802467316426199021627","99701010146","9331468606529338701535670481510392226250253182","0140814391052277751190171943476105","087880628369212181734105595717316351458801866","17842090365274068984773829","059324397263800113069653470981","02334472499235941966162688442924499925310","521577124764828692486554","91967922528569542500677391119963535","326944468105251228822324153482411891100127606","4312088812705130475417584371745427428541178561149","50522211471319016104109020343384659","2","4","69428314305722685353372844","0207510217738828622066697555","626954186802619442614932145","27943835384280868912578402256818319442190853","90325800205361","7139711440","829495188348517658590329083576151869020165","3514021876","947925276150716313016606942805798344","96250807835455074427085003521909","2367377373096851719472470521439","069460816868048957916201","44241","0563857774201272"}
{6,4,4,3,2,4,5,2,2,3,3,5,5,3,4}
Returns: 50251951
{"7522010927535158377096196324962958627396904154","9232248410","56608379693931225570824379796025148002","209988465","99407723078984273627417247","106327387713548092006591906130809"}
{1,2,3,1}
Returns: 23192842
{"854703807843338729423359078212789964008189995","75109276304072145048620188429","6240095696370745677269773255616546516429496462486","958389676590","0317766539455542573355568985872","790237135954057870586834735714411535665332201","9686544582560059239985470791119548501888552628794","6850573923463801090493","427906463101772539852534","0144454577782211","105442331121942019526656","341438654342012846582570880971","62494876","236952312549789207963","378434194188536947972564447418","1223263","8823446117464552889360993910898182897","375014728954","495060890","5446808353","7718","8538323170480522854523725200","303546765208327185483580367850","20","0932931318494667446683477886","3163709433793349696090829155870681147306848564","45687501632292555053495466717045931612160","0638772071446064737563091581093438511649703761","073559536513","42955741616980532558868996","184788009309959395604276037656435145452517","5989284206472573","43677334740767835748452179472861127427274073465523","25946160507634409409647783","9764435590220153797815600268158","302958190284037457755455390842669858242","93151715801306256493193110776720994034128994","820472357279745327259186945","04684148","491265522090801492857705085445513431371611275816","76427822974948959669153535069529269283824133087441","42277119456198524509693093629485512606894","6141920115985249309035840","56904292498650562364100018540157265723993","5228235840915843","3100422200","15244137060722315","778828235270122643165782363726","5641456721888867445532929725288401774410275430"}
{1,2,1,1,2,2,3,1,3,2,1,1,3,2,1,3,1,1,1,1,2,2,3,4,2,4,3,2,1,2,2,1,1,2,2,3}
Returns: 115045979
{"87748758121591055087598588578","7636986007739588044","232477824397600525373177090479407","529969785868520764689718523329","487177680341582364053305562241106737662711755","858554955785356","0540","57988369798430725096365306267285806","22125756673832","2","36319275531523543381159291695912778378485795542789","7679010261841574","4140","2867272442275030456481778","2","972","4222695501959189932599865","5159897684655732575","9269967847690149028607328873995123294963619643","378758002019838158497157082123892","8522222","37206832166102776770388213223531","9533364676186667221095767678469542","354167","1998381","2494700104930634299124650017389","5590044","8621627927908973318210063915","32919554494120106575591835","26146267440258351637686","8289038151207105526609370318946552728031918"}
{5,5,3,3,5,3,6,4}
Returns: 753185787
{"930517859871850647049477","094401174887997789","34612970556226019425316197460988758476021908","618342","320497803911568389952764","474094687250","4112217060304","52256285067354206505899487824975267","65788697903065239948541462928137945999","237841130268202036619348592","873723429242442","640998202972322630356141548941156727","00987684572048359946639679223924719967429646","6724","18159190336896709494585789","429613641003052315146","85","976846157536504","2513319051923276213783088","039630203351278","4723401163926074808327162310074813723364574","232528642188661894781108531986188238210696658022","89761670470772944877494596937168300572109","0382173","91369","45719","77289219213221483824317376","7985853177424886644904753897011","6410211711445942747458958471239016692338","169207486678588","4956462589950048066","2593748587555502056","960","05427359","42626027885493472800285143613820993861","670672763","9716867110045850844008766700206354307975","819319450233137557314037355920908"}
{4,2,9,5}
Returns: 695446882
{"220055074368312803797358741976393007127449727483","972030096","754504287411155954336","056358885728645734288958179476930206","7097116528812287046232952227561627","2873256623538","34209845324006217309281637545795426633","24533377","87160685352282132886687988794278643743530284","25250912486001628082894179737937915596938","53817467","0818483343030","655715020158664515235085933960","2","16938666311604292450705631821251833672419895","82222921258736640337568222298264025526949236","388564239488586","00736157404","01427681810927864995","5784","22641946343035161092878307","1732218705347110547222429332494","9725846528807174","79384999660678802547908798729191662","12172949589109588869526049","921042","89901059900","6234019914996496590833379637966155806824825964033","858077300286852868702","73770","82007749078087466025717089484185598","37547748296647717","4","15251976147956121833748127206564464","1295463108801835640598"}
{1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1}
Returns: 558199627
{"4697394477093524266500628","8150650837128241304519615665906177460769858047","4249387222651652742325413633019678993137491093","2160577656046102012447050480349936127759865","12964536492246","64105312438882960135076988946963077892808","581811019273563730242102193","18093928935309626","60455048741257517439699429540327424041824462653605"}
{1,2,2,2,2}
Returns: 91973807
{"764879128522206179964682647106696","98764279","95178","02954417","0479990583705867306540565234271086034752849","76542612622867003","83003536819","1878897748050132681818401762283593352410209901362","1703081740648303132187011308200965628","35109606524428898234","71980644332195850468159","9297828453252994898113"}
{3,5}
Returns: 630730943
{"856537","3702109656237164941312553314018427990013152012","6459872226096","766844810851184047924385188","83091937329021247220","500607495359822438743","297783758621289720538374125","38477555","3383837015535","7165852266","26806722074686681488399656272892906122527022869655"}
{1,2,4,1,1,1,1,1}
Returns: 847153688
{"89323241328928803949382948015623","9291665351563320250","48760642630478801172854362606600638814","9374039883350322861741328310144097539350486888628","046192624"}
{2,2,2}
Returns: 137698005
{"695601959996021922908298676007694257716285370","23213","927070266765077694307549","1036987924711495880519498752567475256036","7892479049804388587619665819806870914401443834992","86771046493812094768246","0330205185800047689494590678837113719593","0021532142008586069852241139","352598227249262406416669822826392","125519377482649","4419712400896920532795890369513812430958565326370","3758875858","0771043355393910129383226862068223471568","2474765770305571069","0603660978229702752171093","618386163076745480531422522108873742380613","1628","0131146","7667639220926538047851698632772598773478758914113","00800514950958049","8672102082299931874447068118","6612991","765","64564711238581122897048965785353065999","249638998739690711195647244181924914548","5006019471770591797303459504756081943"}
{1,1,2,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,1,1,3,1,2}
Returns: 884269674
{"628012673323487737894227493669241","434846468281179","28660455127261714146","86611","179704918988059330791236879515762164","23936181832847023515644238297902888503257550145","8897442819433288525414545921086","51152447655606821140066615835799327","02167422786652701051859993482935","1383739992261224620","423521554444626341597276499","42185322169686981058843704","5799457329696206244036","15182404","440482946677891481836689483973738553352","7570029948531048982489620","96837514632212598059","89716331470864128566559115319726699240","1358237230002583488605920880397905","234568986033241926732073928921017419901160","3695150957125672841561","5223949","1783201354028647502","7302322007613341576017416979661386651","62048102","3763419110109","371047402547987550446691388900","0594871","5196010696734036391673874432059921935725545723","00","967252272652455805","6939608573743269","921675931278210334","6402008105886929367169334705721392032173"}
{2,2,1,2,1,1,1,2,2,1,1,2,2,4,1,2,3,2,2,2,3,2,2,1,2,1,2,3}
Returns: 678559352
{"5686299673587263204670887685473859565547413123","53329944762921824800369039383673901436","82040191715757788949231029217920318925344","58393502329991678","71716036819771117615454430236484411665","1518645587738764883246523589141889","899054127752956532768631328506","9753517179252187","760935","301534689002546815234620358","43977160494868263637906352188384769","687674129230985688391633090362428469"}
{6}
Returns: 859273841
{"7623100408348706042","16549481633095123265","6989136499","6970414581582556542323","963574861069697022681376529997","32897700255866193669","67512063499591081983258955386352472811771943","076634709207545972679662542556228398","620841394878073485349289001992947872","49218255091965628177","3655366776451","9065533626540104158181775901996388825515665424","99321377832220059733905303664537479481899639","196688466032615327845569623805521836450372","413823821790979066085484","9633125428279","389273519631098442005344224516698297146","5646952851343977747949604059763005094700","2976558635367720516","73918089608827390745266","95239600587386895","0762565028562473057495654084541110052128815412161","263489554311570625437348025674061612120742346421","5765734211197062248518403","1052559368776204506748951008827598353","1964212677996035896412940944","54922","0832805686","78360069659649138367563485524","0250344926181727816889","314793149794344825274965161546385256013415354","4179820631267199038941553767902625935","801474193762","5150576283820738667692586547305","2579525284247635465228328454081478831469532387","0825983222745621667856613825572746097542100","367839113522326796899924038800","8121","161084900164014","448796426","4","629115","3695228933435764850755048337948498051163463978724","400","5925494017098037266","6287455307417832883320621177011540","116556663467371258830468"}
{2,1,1,1,2,1,3,2,3,2,2,1,2,2,2,1,3,3}
Returns: 919907215
{"67003231970403007890712861004207030771861335549812","1239163610710","867889074221711129175904651769836667050258940","381770633625749457702601174168779087282737","4050","15848796219159628","605270538439725231830161525389844792","1933497185914268949772028580","8338577","787942120181991052109","2337","5447695491875091275038103484699558347032002","876","8102758717881051979388872967213106432"}
{1,1,1,1,1,1,1,1,3,2,1,1,1,1}
Returns: 666855708
{"083792723071353","527865660264182732050959904774870972","5214048114701462588477933904226013887399516","6467718466448395980030444909284833446087867163","4765524","2039190295830924181980808804506104405898102636669","9427004513477013807","06066299070064288753109268894936580154282331043870","521727000479537157076641155053938347400","344678361728","700500138836585814909713625474628","92300469374789112657","287693169762374838107314118809","319441506660704046008959","043290567239577258882224400890","7646043635647327020905985080348909086","73445211518004065410701597","403257014839463773540627","803114577775087841","793997022831177361603728595844884","8302216249544473865706"}
{2,1,1,1,1,1,1,2,1,1,2,1}
Returns: 974019928
{"3477","432918654926","3449","6552265874565500","47898109391966507095372","06346809176511515424459923","3349634654826641700","855188147764","182014925296046606623804643749022430206788435","7467086112534","45768563368808333321677105384","146127958597972592542902408735861","26810357360646995684211683834017604804","6541877813787724129914757362","881066963916639004923023544432672528164455","8784147438017125421078336662","9845638563589180571770322079799395559796192418390","94544805","29164478254740811024807067303","09689070427473750882065863069600887378819452","973622192199485685515734324408525534451716","366054190009899827401","268906549741","1095115213583169007571531103488824378833174312913","03384144889061037974451502679143932","54791033064618521843067103239478578423668923645","899163862124012282667622245289838118465","51","471042937460490914532126696513814893605183926796","007472","10905099286694413772776304184535505159754065169277","764595186241556","63367533718967140995395","87560755239542583280353481066625551308501985498","187811568897370925962210527521905601733433345","119386239745636704695485390308292134560","6247373849969602274186930015840000243529","7769944195791744940","94947187317488146028356343097367334415859353634"}
{2,3,4,1,3,2,2,5,1,2,3,1,5}
Returns: 377850794
{"4857252836675810437195193","03838","0527741035261371750061484981222338","753918534478022648966244121510467138453425259","025264592366","42429818581669561388885256135146055746557511409","90419527383293771056356432559576848740962963541","71159417904120197082","7127050014641008972683776976160","7952","068644888869644587309783192926661302","795354829157","53287543389509341656975393769155364027375773","84933555249","193683848744504069911995","45330158475429808084038608151057818","104122258543173931440656034522","56068749977","859783811133596395","4408363521949389","87113198579798324862423229344","980681325","316670573663492139","66024564396430598750936382352311947","6909496687784270614715911117","466664574241492341960135231137","3161484129453751281649528270"}
{1,1,2,1,1,1,1,1,1,1,1,2,1}
Returns: 316795451
{"68531981419028510847533521077699288186","32361264783052897778696185666111030303310","123517097470038","37516993606290861278753263498709228334","52732777649435","348884"}
{1,1,1,2,1}
Returns: 637103264
{"21237144640804500547","43666","076458310615639849244287156239765721859037","410986314553427110887618338661733113886781","890113299139726616790482697557505192491","1237815882517821809815729084128","47","5659390677664057311014817460","444752767171858369553212311388488891826364316829","85294477222745779816129310898860472439588238","1501620353337797227097272981034672297063475710705","3394909826792453725053562214280214756791137","051690598684406511","9130244287495235050592320091116206","1162128043948486326702502782576","16260600079708616030984579127","79743665","640","311861676119342509","1053349370700125396599","80221313202393794404207486713865066932551","19298326891904134151155980024569","487843708129844"}
{1,2,1,1}
Returns: 400141315
{"24190556921396676884952396127357384263735863403565","102301","704274891670805194329068324","308197501","44370051404630","3632057693","1279600925226718839485640938755642221305217","1215909150224066939","12789986390798795567059897405596","8736293375869565364421","87210782660389943529331044076009"}
{2,2}
Returns: 422147789
{"939289526352424888","90878413152452926868067159554347389646674","9934562203571968007421608569490","9124865722866254137421449815581937459941661995","178487942153244556602043610095675027462","96791534725139560910795987007609010982"}
{1,2,1}
Returns: 229667825
{"129203962505172339374594","31119223852179642049841151631153021833102","89570315206207731350087076","293970561320032809199096565","0686269227811776865160323383156694","5683","52412968651222244595","0854522772153886459944877","445660914540527863959739261492743220538886126405","08319134671053641347464963173302","550644760649499033145724181774532457767648505047","036218333478707314695039169140979010","155926272505045284752221486380746648","73654450791644901372602111045527104070340584948073","093557770"}
{1,2,3,2,3,1,2,1,2,1,1,3,1,2,1}
Returns: 60298900
{"57502","861875094792792058156634883365856"}
{1}
Returns: 57502
{"91871679305227373","58400014890391744094056378416538355","599526546120241384449","90658509","943801452675164966628831217830580283988235","13","975","491172226","605851385742121","39194509088854662024618179390","8941469252461718184326951575192310","6723747299245870551","0954685706095617794149696703","97918453492491284458375620","682574344463901247341022860879165","856694938791342496489","969826566702657929621000430","345087110949327699","39035797338461788163315604295655109","050575293372198189256324782657857537473437009850","944723636427788686550","964752395670538929911405907228319165916434","860980605392","798060359539220387846","94844408315396534775551930767854777689137622625870","18493456728073949786591006819348386631456379393","388314723734936700414630514899607579804636","0005191651686536357582194386508157","3463314049941573712106122735727318","9361439402790203","3416240199284212130187450682850008750965877","608920590740109333861109441296864","19679651119830714","850489131426219711173302","5695378682062001702725686216937","25653305473319549941804306988602527919868","6101940174","23292864542753310878186913631427201","92433089371874","80503692517052189508317705","65165","449338","32750275737837303266276980478853355","0667812551057847087200046772116","0715299188125877789","08949466594966239340581712682418686157","442294599892134737576841425603503","018195452763004","644334362523819668324035"}
{1,2,1,3,2,1,1,1,2,1,2,2,1,1,1,2,1,2,1,1,3,3,1,2,2,2,1,3,1,1}
Returns: 78884250
{"803578677357121037827560248156244906878","86099385147","736159965568427032380965738473","668181863798059224718450023921329207738430397","791533352956992888213879","0168994389864280","68094225565934415660765014713162621743751","9923340189591679938796237165075998237333","689783524554633876169776485419190886537058","672112242464","5102744","708","181548","455412849769426331040521421277595279762187","5167884","710633806462569632","407200340671072","07302016046789502549942513261151228596739966","79","1549366774441599799","6533861025536233924817737958101315","474311441582757441341017684601","8204809722714712162132721151477496688554342119092","7","0508580198388041773310314891858","7540016202592484062657068065629849706837188321","565205640520534861644"}
{9,10}
Returns: 910790240
{"59246563582459970048980","3193062192050319973500","3112770783652601259085668204070509","2897402877367878","51769431917451847189502634","428060340033057687","04433544703365523408739035555550594788108072"}
{2,2,1,1,3,2}
Returns: 102097509
{"6529911622461","8017786264879927774775462864784157115","194835195964224165148245445870686","815129477","467944398476","23817634573111","3169872"}
{2,3,1,1,2}
Returns: 585523622
{"30465299708959803281","730622939920886837692","332305891","1532254909948218885","73889433296740644389825911543739544175644","905193510519777485561493984050347492","64155844180659941719483351052723310","69211468953506050223","53891372015373416710464050533107416","41445509681754463237265581654998782849691668336545","651237482164147298195579973109195","36114206406517804580687589313531622","92609","23486650265131917394017713366726160007","235796356367742076239258428399869","9197821161005679808175","3625448798082462571152853159268653276258916","45939541870645","9461613673346498544755198059274709901704895746","051417722909293133795324503849010","1948055014748195","824492901836436630853139798","647479503263382718953","15036406237062802384435031520492112","798920191261869326937603","73464661865035535176","77607750014374295963687474221062396836063555209","29","20848887723319589479986761553","04632123340","8760201616057049328977203","34294","708630625411262898155534523206179860802971743976","622664011155","3279082829721904473312","81738194704","00984936730765904785894042610","78419389970086938838815598","829031694067055","06577665","0355429506988485771562697312870963785838421","4266624569278742","14311"}
{13,11,14}
Returns: 904124061
{"66581620823268013753180647543014273335754","43120363204","9309134397905027","25175","7248963970098","26129151321868984032","526846371","23481","249","509863698254778417526201003267","5471073686784770958158919190384","69088368141800593830","893298619658307829399470","1798125110122397585428015733","9727499138261637210706511874096136053486186163534","461222142049074500179566034406405761782778941299"}
{5,3,1,3,1,5}
Returns: 866263385
{"408150448080569667806123633","67495","4581","984355231411285321125222067","7742134","76882693700000026493919067480065201","04224277731688896799750772254045619864319737268981","4","767748953414243348924231194","19258813727727627","58093171613239","146442438011684937642878838015230627328617","8643848874656391624962024007","17025747466176455140470115060788463","15","06594686511629977944981130851378663320722455905184","532339583104486486","9915040918158941869330490118161601833126590651","771443158962311807394620328768551421194661079674","414260601150109232855555088905313209680982","01365574415272094","2","158546179110","77117144614","58222343902885089383","22315420203658419819551732700","7311141670676934","123593938098899957570241867340537267051054","4518","516","13972791504761318050","306016758191820592006449","60486498118363550041","38987299992602817255781785715892906","0413078323528026081390611","64765121957825","24702297582476196","3111761539948","3198558289065"}
{4,2,4,2,1,3,2,4,2,6,3,3}
Returns: 226382520
{"02495659501874","48951975986717324449","2402558229","794178824701994436952939917579290190575","56933","914224754082650615453792","612158371029637930","2891265980689791925","82924886820124628433486486429437356679","968321731580344","8959005103439","5769442613590670151241507740952357535468891975591","97933296728485651405850792894192"}
{1,1,1}
Returns: 659484409
{"8152202349","9082456397325817655","6503337","5456249647948052361079573687511372","676590237722961663623905567570130799937999033553","0974610034127421548070707743093457","10530134623946755353182357626626085","22875219460803970072293","854348991471153506088130998038430360192165095","673535873722240326724838023356210854681885","241459311468844366140368038432481150","44381474392894","530139362873851885475099905367689018306742139246","618776281349068177735","83391148682764","74242083907328476992419955871244683679","80943848136","6173806156806345952403929403681659931022188678","15971706204670502168097320961558315750984877","790202717736106224631948963493375552","5807042","82008","6275673407021390378238","396845900931","425300769047","14914394976440179380679983","33852571815545019408581669224497522025635518725"}
{2,3,5,5,3,3,4}
Returns: 17889049
{"18478801723372900424685191","9506440752440860875397"}
{1,1}
Returns: 266536168
{"9834012279403696796519842608264853231","65427327","72906582","8010810","2958220941475162","9383105379496381171647875696515167465385","4117","1834953336989149149274291","1699176293683298439482370","57689941196889001815107340226","32","1180497765344496","2868","9857906157004510541445876","855101334383648217916671487713190733005763932947","73900049240965192909166","97159612731467584979665731516803656853551","0580347031851627773012950678543261460655420718","761082","02374963997167","278","8954131766899665137477068829638422499","5658977776388178294795619108757035200879392932560","321196846716570204282","21101236317692848203655005625189491178318","6093771288783662163904","44564220272914942231265163987131195858","087600","7245592748545096376020066745442073","013545834635700220992","6641844313559157183227323061583470720997409","0609733642628568877970736","22956174142459017632125186607197403283238862271310","77992","2866094","2371189560058424544578596901","03","00777533315986033597336545623","3220622","85345330915764843860060122154810408736","7396636","504985807062686049357862187042","408917293852004","029928942683416159284086632404229","6034","786759480958656727755699","6308827882466740953010750708291261947056852712900"}
{3,1,5,1,3,2,2,1,3,1,3,1,1,2,1,1,3,2,1,1,2}
Returns: 673587698
{"24964249438234359585882948665954062002917383445927","679545558957514836289910756717578031549428062118","61721079805434391165127583145","71469477167653769507","92420732955572683834499171248376063","091110372249584820423534626218182414882903849","9225169200497701272060299532895163442746929","4824634213","2672435381","40761841782370782978762809927189995053692789754888","22","5657","901164099429478302549","46668213011877508905068314142865","8954775298913232","7449574407870017336","2137558111344108539","143157","9002055948522630775003568663982974497980","78528841318262593006103814879910","9071851654112820487752501145013415","043611686","02845681863182412893266222","37003","487014657356155801995100838459394863","78551603660471469","56323708","775772899658105404111479"}
{8}
Returns: 944916487
{"102682087938839899822837308213171008","40179170902725789609699","7067277298624873628380543965044306","0673371286095666228667012337136574921262953","0659844084527980798411591098133696374227216089149","9512633221441761601722777020209565462639","55986829974290309893982785677167","460192633608043088125564307515157353482496419931","163838836850427221955","0417873073","09643908","8453614560806412624212582706845133669769","90905036489988316830936123314208330967251","754447394769111473098973420378","80273660195","7309872765938382893409402","460639736091948970319106810144026328408884","9396160549627699722980298800398834940258","90201472311368322544863416391689","8581537487445876261837293515490400180008572304025","077716102483381","4928828384154403474681664476289035470998588","60682826479289668730","2094908780593","7965558398","213446742","69528512204775568","54435699575","7845779979191563219063236956360143905","32802234898275565683612163561239179528119251986","528586501069418","9225603437173008278963922382989157280595","53912024690","00249426","97719181822642425405207889451568738433363183","096751995313796542658","1015314341801934513117800921013180186297375","580829","08464393683059356558","2551085339134751309597","48829036120"}
{1,2,1,2,1,2,2,2,2,1,1,2,2,1,1,1,1,4,1,1,2,1,2,1,1,2,3,1,2,2,1,1}
Returns: 124323185
{"6326422885369","575","9311427940760312444947470185389210","8207107431","1106446155331515324","21826059053234446649525","6875807205728090730081638020514987883","1205124873","249669132218867346782","1006574373608777497426297","237896566436714993163635","2068850651217","75887","6899265296799","2299260","433541","4825","6405231741772151954","846150169195","6026582407262758977579156490","97019792993777145098968159668447","38815200292290908890404766484888580","3778192085277859032790060285","0838013843892957549558641798695912280072253","3608585","447585163823981904630974180063012696073785792","11862918268196187430848621590791364277934","11970381140312841653254381635","29909113008707280510033610829","41631651183996567447360417103399269470018595120565","290227526363095865581343421942857178702431","715386404211131301","79147308","862564168480997931916159518","08763280632520376244701330784175959964615374035","463271583288307791479"}
{2,2,2,1,3,1,4,1,2,2,1,1,2,3,1,2,2,2,1,2,1,2,4,1,2,1,1,2,1,1,1,1,1,2,1,2}
Returns: 421598240
{"0006512183","3322147748206551531260851","0673250455091156570080823261796180194798771752","73384035","128865314687771123357760008453206","6027575652995820227308152188505620139123","604300947","40231121668988367727221703213796721","22271","70650358251847815815631390175","4640026170373358641573961525490188070860020","781920034311274045260133734","402103369889671352055138332620360","4249520081899664132896938080441283636","13842109501863592003135675958404144","165080996814524996890674169881912768985","0856130738309659236","75906453","5859191240617490527141795391073621","0097600515656539","22917033036753431897","99","06584505816812403866","2685805808631410646257381699362949437","631328","836371673916683221119992","744841","829610580459204929157627","8998105102542676655003703634926323750","1716521552212881674720528347","900174758613503670","3272446244429776544694237665032393962","910757","012220703195650901955107296747018","6282326336339534040480114418713084532","0118","28044875464193330093","05634592606653894746739251213205143052555724980","2529838200828292087775832129599409305189947","4741334596250085710","80736335052","8"}
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
Returns: 6512183
{"5427661269657271971503156610313","2668786869009447543390871","77862746402070716984","02423320","22140070182986640","36111520549960599532411212350938583531","0401719177423","992184386803303405262796585979478462289","27547","283848","1974925551911778916907939597687204276780080","3394636216250","362859910","237488837046114709243359996029032310","8181964355107610068856061111180491202738","448474104592402215139","7215310565678","1290315416593588109675186014914712387534924733717","20936009136178916255732142511","294256494714378453287075","0967994623612111127464216045"}
{1,1,1,3,1,4,1,1,3,2,1,1,3,3,2,2,3,3,2}
Returns: 991594803
{"091519589849024228494641063270","19362632052642474027013936135642158398431175","0232211669304680144133633329202716430728","0548080352933727400336","6582773412974190","18878819969582734127137780241648407","044524380520867404485","434234390573113887924845238","1113053013671668","380916456444870406756371688145148851107390","666012943","779683225586630406696540336303255","95","62092768669570879296","0722085","323987548758594362530835650902","2028977166355627963252855500","7427991638734202","5","733883163965107404252","671290728062572322001880178527176370472525634811","6902932296596797388","42502100280170929","83856348151914452053100939789332855","093570989632042954008445027647224086739096","138364994505010203822591230708","16835021615783407197","547884","5165527658976389","93","46901940292799492"}
{4,6,3,4,2,4,4,2,5,3}
Returns: 212439133
{"9906","98105588612550439824073771130417020896370488851","83091866580599724","710278797159208928299523968047412","10854851342","63385270420994","941139789170059961472948506924106","07048","1157769923227015452492240911613489596769194888298","2530216786109422757","385","70070855242080940501","5038133326430832844105478460313128370617814","24209824342221204739704763037144192262928393","65614650036679717008045704807142932934750023","56828753092489788985678619178","9","2310180648912766174472","4364674641294599081","562","87005851508","2685426538901928772094070023527467084","618176140","490932271682","61245059856344949455362068148363546024935352352117","2145342989224185337223678418286733915","02356451243098352180824122160675276","31921599315297960907215519026735","24","349241486","694422826829111800178265651209","91316385119187443329862862212848","002293504325622183366983811874026944134859","18236097413032935014661","9551894911176834233287397772","843717452013292178468054363430077743","5","86952957028221566074951744174","352424966561535308022027840801012184439","51342881864834194668786074929711277337600564170689","359049903952670567469136319","86841555169598086303080059","3202","9951611","75127307739738900161671601429367414","22156113","813430","8718165179369095813919240484734340172714944011"}
{1,4,3,1,4,1,1,2,1,3,2,1,3,3,1,2,2,2,4,2,1,1,1,1,3,4,2,1,2}
Returns: 111715073
{"27015828979674401386289006567341299683232988937","7988794880413615298556","73631365811582046746362984205","4816583","26477027158700668051922714022706499","663489620","99080711878422","1156641646834021946224524140","0","50299193399087491591022","6582256388172993548697799792986449","7341681075968581356","522202807193110866370153814348866153966","7137","5519139759975315797550425","39207018","864206572705129813490786483","18641928944987906309","072688","0639177907584","001741997602","2219676226214878726"}
{1,3,3,1,3,2,1}
Returns: 394499033
{"5","41102","28316258312311623840740779569576394766","911178473396395","14095240032004146593555225084414833495070951575","523737935216975843152288","3160151830673393462080421760","5903394170807834659489","203759709296235953649581981188966857251284028","27154816101154200759","5306161301182","4494431938766667848978102102394347923661"}
{2,2}
Returns: 560404864
{"89094749540367519117","24607006026393866015858843819771410346879","21174507310260872141186314130786775064257237"}
{1}
Returns: 704276705
{"585761314496496290174549118670211712","205514360","203505943344661","735383061479693931051210755","8455828697030459902476143908322234325319","410","405961532707632959900847452654184012467198610194","53023268","8247913979","977923357481282647257801892324720701","27528887194189588227046620","11513003608072496263862648","3485642884","40289964","93254265789957165304717623990","17010667210063533844","47783","50","18623752264767180","1","5203064537779199139314762135402030","89309654283031377023843669224435350","3429633868745497982496723394056989017","331356835094520573630030783435407987885472958","5351288402499842976178920451688"}
{1,1,2,1,1,2,2,1,1,1,1,1,1,1,2,4,2,1,1,2,2,1,2,1,1}
Returns: 829724143
{"655902498948194551260484180721840844360203494820","07011617966703527999957566550151513483923858784026","6980891225101060546059286009"}
{2}
Returns: 567929840
{"1122862802950416711132241953743528950","1","91858924159290135251698389689444382","05666765664563054443210519704227671481701","846321174963660062908833458419619","346655553089009","93292406654038780843613748","8941273244","60860134420087782360348256646623","882167495811969113153795217162996297","0133974173664752567619210566237","59327912930952501427592809943303544385128","140935996825263697822426545710271086","981478428937279306682349373200128842249647","692573374728411921690141529","107607467093596079334970401","819441280886920111830977708516165691837724359","5446903530856712","6","55499481349388558614157432","9460","49270652621660405556132382098990716069324067885","0619006165609875755900114","6641013793448586079726964","14841430809079921767","282364255879567086606264227896","093658965728035665086118750278579208","80781317440522648940162633","803476351725953744600764","507202057999665150542","064327701280869936488","81422961391274305915144005","279606634503373779185646734985916127730990281","8","9121","7695084816513247550352677455","7187143800764872745243188537369285934452","31628593491564186574233819207457608332921","16539720342624069900496729875853688519459212897","068639095649018259723878139090030146999634","61895048329","152866258194099101520972614779340584","0589109178411730731122376","99203","44681684909656244228795203440977555888457674112","99634087025920885564442","60709504248327745548940923649102256427920","77509339257971200","131868476001100316869410925932"}
{5,2,2,4,2,2,1,2,2,1,2,2,1,2,4,2,1,2,2,3,2,1,1,3,2,3,2,2,2,1,1,2,2,1,1,2,4,2,2,1,1,1,2,1,2}
Returns: 578323379
{"7563881303221165493915352","5198838929311312530909851855405792865014123","3754812015037523977077857343127767610848758201"}
{2,1}
Returns: 838621068
{"78463474240396265365951921966","4137351520600354568331710","13732306458637831692635089","249620383906259417246430010488679391107","846422206068074859","010","77289825495299245008452046808662","03800341364217046453257691125320624","865238140","79374503175151592660005264142060801840299934","84752617530799444327207","1237697098141464","90175186431019368","988872461895505501","5224692526674256343834491309301854688","0179970159935698673","1879923222","71759","0865530208206243059","5656527245157954362460117","00680251814765177104701284829068","21857","59","9949454109553836856","969885082502901704114898842369031","22366390929345","86104472527750673152488604861259907641","8706231706520973082291881","3517779422132294300080706380996280013461","23865171265673718365941232211928284708837764831585","4585134516","11075874000211","9714884499035657860994901571106967184","30980774","39634837070739900395319757764659","15076269983148539902055503825629871","924487823632022846318918208","63914757228122882890671118437925227564068437591915"}
{1,3,1,1,1,2,1,2,1,2,2,1,1,2,2,1,1,1,2,2}
Returns: 408867251
{"7679359721134769120019740099","5125008015567349601073","8041605380674436379899754848","387432614004103139630","73953492422644489374675924907885894931928533024252","7485925497346720713183","756661","45002140938195373866005209981","2464075826623398579759617492229544147243070","207103131987341154648883","87219485775188859836294607960727628583634980","1194333238441161982010400552629312148794","835634556040672449992955","744989099425","476454681967014688","905203547705418372844955672182","846947957202866356453669997170942431","398517377184572162736403235542315643","0654551643610294012597749669453871991183677","98100333","00246163353112746893244121014627013582252186088","3594460581504476967778969637356279644124","32846149026162364297773950102402394307184","92335120605665486035820","57","13300472","2760623560659297","72507912470748311639281738","966993292369672","57974361354617244564701841634207774341306234","3763043424318321191506900173047941481735700","5","5998200960835720323","4565248302963294534247378926347100273040538","691382375008251470150173564494710341034194","082885550359195"}
{2,2,2,1,2,2,2,2,1,1,1,1,1,2,4,2,1,2,1,1,2,2,2,1,1,1,1,2,1,1,1,2,1,1,1}
Returns: 237834829
{"182073619571333369978583219984288536892266960841","00173371134176027849361","14235628397419868","150757","65370957515169554340638699402659448593657711481524","54820644927157384329572444863868714462712633212947","172848253","4560819922609596924924758318873","74338571965435250","2631906","908620804583476122664344067501492995","2466856234549205024632","851748657049440038438946076628146832478358918113","0630081809234705372232605916133014691038651615178","9824632110604596421996","3129540343171","611012688538805882818343182146","82141824941664793775821457572409104350122089006717","6919622830034293750873619003019516495","33397920229656438321500147761991800608249409958","028560824","520199905172073102007471454529507809386269825","18890868162982681132071906630121928095276","7","810","865146359239640414394","4431","4803187569203481837841053049","1187868082378162593","3337057466968","0","89591725476365119629040316576125594532","2923326622053921751008483","87616817367461061066049567174","12671145244763","739768151869050869760924952","733231070302125905160607351664369526637036","26401","7602570362951203617386141091592117648554","2789719495951035744122472599265219","97914425","45719201901","7749123383189861319251801372","7617238321179390647388250","8561873734747891306286029144876228"}
{5,3,4,8,8,6}
Returns: 10481500
{"0105628684034","960148860232307745872363598072464","00873131494","10512145438357","0785403245071352525449437","73488549377124767679","41928951642477536","16050704756555491561194889"}
{1,3,1,1,2,2,2}
Returns: 458117346
{"165281364354867001","163576743569049164551029686167","1424599059515458354901975960","7552293121408335802221547474509297788645","51174475713547758259249427015370","56354422697170931757637205947091958105233708689521","886093587415975006720652840979015343759266635","2842213971997811313456945693347"}
{1,1,3,1,1,2,1,1}
Returns: 359666216
{"160890875484934560215966869759835193163102","70940502046654485111037839","5307204341579200385383820565663762","8","68434914913506487221149726","21485716","2932535713397801599026509337873283233","42249612512183364635703349082652260358131","362045630869879835554","06305777721459601509685297711308688041","9144602107717778135","62452882697897793109","063024587333997009056028613061053650208534","5","803363620259000839263100283395829","09638","873774242975471442788438237098818783185405792","05638059559204512652608621509827122009569584375403","90326558329840965740","57945905782083355342094064397737673","693266618410655563768599261547839400606314768391","5341636701866463023026197","39474395931739670099208031496579777180837797647","8512396152557541457480890","339353180737","90667045199628580440653414718896"}
{3,2,1,2,3,1,1,1,3,5,2}
Returns: 442826330
{"644586770571132786635901520430807629275821","020911221324603292272773315278472443458952","95466885921054822469652617572","029758040362","129373062340974524687402108","6373778803634296850773885897090438485317606833","7822187762841090877689865904129531","960651296338604638270233557425046816","8857063990571773416114797","257489676750797849643210695887142757230","30470663967053274893828883409940304621589588274663","70515196823489782707557898043419988887266472839","6943947408142422","42534077259311945583","45328119743123453","69678777258560572648355725134317204737419798217","052819752053643616410930398162294627045661077","784862464589047992368739358159522485195655","01270796784905547369","923757318","143319961523972894619","4328145787460828326815134467052923773240120","501","0288245","51696576125932468657903488","16734438891546551143596418103907502185617","6346884019692081088539659","314513341548009243543774608435296206136511284","8733435787548327173710451172059378687904","864174417773415185233596","255411040955","0032","687295321019543609552055464256498","0747226772580674745401","04802091943661153806831386","09754301739","5189492","87","962","1798072497","046252183157370228862656","145037792484118435","0224399942860360274180433647208368723707848997105","753578555638159273276395600","12965095403908225619636111321239517482287442"}
{1,2,1,6,2,2,1,1,2,3,4,3,1,2,2,3}
Returns: 159708395
{"4739688576603850779761572344646003581500","0903363644392412256824785518813","6842903792201451235224311346482501477500414","4013938583103791453238430158638","00954349640825183207046933","845255974403239256825447973","794322588","10439077461869989222567731819958229","973754025782","8963728324187","613202895168463","42493502990951301253089666850365506948306974","25148857939723135433001749","2551410679467437294432825102593866216857506","21014719229355217205337025916727214864588","50146483919205664016286101144154377123","46412774739658488535610410674942195017788276042585","014535668099068692669","75211779965626708737555799425143622375016","636048579224684","80926654547484629018628343613500891370582775734337","410598029899905672515","872972714084588678918523007375","057489059144859860543451302032952167446603","905236339439325097","6788521368803434787927843697453243043171339","69","16437797306990663525441813146094097322461280787952","794407635163179628386011501123524437116","527870269855681394512005442562259","39164456964778037551446170560277678228","231966898679560925653690793339946039","0133222887187172074342085","309604266075","7183373819399","3566790657632297088002412535196007773256772645","54877014046398671138088279796852328390453300782","551321413","3444902","18935415043330632648907902329463","3497786909130685877","395510975201454389723332619","55787048","4827695"}
{13,16,14}
Returns: 385949433
{"44","074555745851385341856489050487085","73865296762848","532873930121091621059","391649934094878829941895203841690873","72661188162735847655530768690673221","31770383784469252289759113926560","8140429151565521","27692813","0228241733","2570238599778791001294980169984618068961","880607901060740752569023196543013780036276845","52645261379926419968779696886360186941783267","3299730711291557383635126286616820668868","29420965415598339452031207754159508598933628868","276698536372047237","66422653033","12526110438958664094108360668602893146989537","7615216076645751697899","585054527953211470168","76454452469143788048436771227847262332337","4419042083150584003081981","763324934887800875079376021607887328987","839398150810503679918836785565542843646","9955226484426267237311076568688818015255727","981760696172918603529033694850068366648783116","7061792","9057091167965032350612","27450976412427484858035502705875013536700421","2711157727133","031205842467501425603672522","571584559282512528451612565160060625516304","8744407083602174808650","18745224361499448484572552003387207573977651149","3336564298","99721927260873300","6547448841840","76084348270507659472476456353236710676706056984","153369351722034143815553955414862816489","7754140205532953505","630","40282","42","253","73460061898123454933","5937236089099493182689347859338421208597065966515","186203878729851305436756622907939262956296051"}
{3,2,1,2,1,1,2,1,2,1,3,1,2,1,1,1,1,2,1,1,1,1,1,1,1,1,2,1,1,2,1,1,1,1,1,2,1,1,1,1,2,1}
Returns: 850171065
{"46435074","07359386466727737094806286376082653090","8136687758567655343819919","50370406549836373798751919971707781345425"}
{1,3,1,1}
Returns: 43281947
{"021991","15488183554705773222733227488938817433447249460969","80238642223825340609568694043638673092206","543989761397082636362065244","172437","853","94221871364495054","5408861101769261","84623683826132716827638","49","127538939657205364990601417333313337226919506251","6826836276027742202517320517962182491734802615","6090820901831980934554790764133678885266","4417192132982810","15609698919","7606238","27057237","982418","935826120330768689026455369","7434001704952604968","9370099","3762527858212945175751","65053228098475816058626010132160186","56455341650765512065547619127929"}
{2,1,2,2,2,2,1,1,1,2,2,3,2,1,2}
Returns: 234007413
{"35771435799235455819340722738934","073373443211380141598871607417507","39235154620561325012987079384","074337635622664587098296","5964699457919478415888","1147484084893648449","991","003959825073213067341089647552143107224230376","01875470816618542282119870653858957936583049","19903833787514828221","55550386432800363593074343","32079246184199859429952303722453162870520144","256346136354950332413809779"}
{1,1,1,1,1,1,1,1,1,1,1}
Returns: 873896490
{"66099772338556403369320665130521847141505675","250945136","3917993648208367221680478","290693238205546","78139","1527753717444","81492253","984887319851748856461061744720","66821800070402362524255571007847271315519812094","614278650264995583496360424791396972975","04306034","626026","454440262096979121777941817320938600338755947179","3954904084511314792193763197548592794751","553616794946906632129651835966","6340943983120139359396775336291827","861459412056095638860288582468678281718660831","38","03643518611264786651569542313","860007166","9935302","234469697063402685788793226861222580636289","79575577074301167471519","20003668751417243321","655902072176407568480352442568485","329361773684543751512112643873888583","825747614074528462884356217799948969089560814","278790890453410","917265507297676","9669665997520631258322905423","1527186825743940207713484750503554","64732893559930370","0555206233796589019729","305482901990070314210516613439481696170677076494","462077841879839","781898337291800574937278704748972546664966","7116586989365196913915469267811316046285851099669","068980949354634066138595","2037619832445020070750798","02873873538605928561458077074001173930236157","82978724002024098926246","963180667193215631177244645246894089","683526092610047401443345","275195725699142778012046419385605144526794328","8655877032623211503137182834627"}
{3,2,4,1,2,2,2,2,2,3,3,1,2,3,2,1,2,2,3,1,3,2,2,1,1,4,2,2,1,2}
Returns: 288068216
{"885350702369799953665187196787375274624","77828728596632","862503878704187925707","93194463227244635953218796903650","399655249564209882090770","48345893533777665399127662145620297","500642728997751914037525007","352868569964303663577221468289590133831402829","2867270770","91983627376047586304","3","6985110690202064846586130164346457","54079719944125573346673142","672","706788663003221987701497556731965","0096315181127249784154703770","5301914576517018397294240966398092922","992774570086458631448","560946266803333934546707647022536551810","1037933362667280082856760564129","8859872992831833363","5445329","95221275977094998483844480","0880102027217130971128263181233727280473818451930","13388294266315764866909779664422269905476451","831074350168589987316300690561","231","02509533845690760334","121748747460","3124340530076354875","2364398860474514940654077603277002799242","2408849080574971","4020530298099389936146","8132530636757926340273710865"}
{2,2,1,1,3,1,2,3,2,2,4,1,2,2,1,1,2,4,1,1,2,1,1,1,1}
Returns: 824104354
{"0150244792983289","93889470256566","4","60904","0183973643022048152045195428926","569750369","10281314336904207","632","08068834001362223250521512452672466694","13956319953944727603251","77837"}
{3,4}
Returns: 7455439
{"06474833136477086048509481072698930347555620","5444780480534505358725363107879409","128274970487043475","243832594","39980895700","50662254975","21311050190142856804168114","02102951066016695457069194834619543262118449","37825997312855231101207933761","26975400","675284993","65111386190796960839462192445","186698193490989030172970469748768557","80984667425836109501160163293515709247237734034263","96946123827","392553224027973099176294499049646663901273816","4679892009453930962244102941635722910568284790","9151330212455784201596294265126517220509215","2069258806499466027778542754311630673536632","241780000","875993685513932424651095850625","846284009168165508444996976","65570991521274212","816997134969100802630424","178267295378524770206474","526442568347716098538961353945605372083759425436","51122647","2065236389508557429371487701902156054609447620503","4058","89581627128859186801364937685475909106","692010204319309886084856446853467730529980","107376653020711","977267064124866855528762","82","72778873428736223504774108123006026274","94547097420996732978380176169541705","1639006874233445816603619189421","47350774936412454896","605711554057903544836441011851461063403021979","001735580666487364797988693917223911975606","0156964118849071982382054666713037158071556","9661687213644502032"}
{2,2,1,2,3,3,2,3,2,2,4}
Returns: 473103403
{"0643633972293602350","01887172562","20041213894002842","060283497086486","8499422313191970276960680130296986","639465268265208709724086916259552774409556113768","0890788210936801","87284409743907304790547504091","89339245885907416066237822","0527357023602839132018267431974560421490130190","9757603006535224481752118","202936594","372784876556474685920975674620069304756149342","497","938512861108941","30769626657473921394989488","391580832001025837083665941860066","09146090834805927032820698272242246111140769921","81757996967","439036646348410407248469","6507176211676265","7284482748979367834186525","76628521294624481541303","3804062804183433228038504916399","7430695405011066619690998688405075123409","920555088","7573503799396858616740069132836436220917563771","4445769881147583634561236466199261471204601905","318317597337531541216059276614191570634","53683284911264627936620","1172854","028703652052063","7712216535076576","7482216156359453188243","3932","6510259863518696","2145508717270336553548083262171267764236407","0524354389179488934034681269242724098927348","600519","8031179831245506723238321294391614","83205049666894345112089269124637668311354","98986308943754320084902736017737502943611","03300717433485176515475046306","933935141465668703681933","06941989505933785922663976369864804913750555828366","217315377227155060618360892793042","51790170124656726034548850979471"}
{2,2,1,1,2,1,2,2,1,2,4,2,2,1,1,2,1,3,1,4,1,1,1,1,3}
Returns: 537704711
{"357205847412135701270855821226558562009104","81169901","864088797497449321021428283203216083794723641","523517587626965515441642422111278573453258447931","830534873135993129302218115090104","17582970734691303548597115381745633907488394148778","940564","2165167347310989388039717025621376408699904","172779318899067652331"}
{1,1,1,2}
Returns: 853403393
{"21874728918458110729402635597","34270827018164016486620712839303","57","28267960981526","17238473068092","9867","2053695863829627169","7685602815204135728423255820832197633113392428","266587440539994235475623","20340026129664298829695864","6215135126170890005848346533078957442118","07041445977619014607968406755751","226077922963552801151625992","17247667797715058631504085","675880704721448037639885236424231","475138","296872922114748589554957143125794195509582089014","7733250342443081","0","853309909998696471057391615506300","356517847966076","928507889134518861406985949743992196194","158880","99322553436926018","10311121321268","78736926033","533932455223120201834166518361197869","89772775173460","6077208473464","643627127401541316104551953440655178554287","37626269160921322426150842632520288891851","094913401715514598281603026180","1923252","161956822255247289396083355846857927585253175","281166434990396596998878401536808442","741677103340034113427","01644943060249","50348","849945447979556724692359738400519649","37761810191425185579125413","952001285048921048851255330530721320006101470","62362702161264331549263","4","2"}
{3,1,5,3,2,2,5,2,2,2,2,7,2,1,4,3}
Returns: 521735485
{"13778577305150665221982999444387","990561094436007150906326053294937436003362","08","8758008390446456980891","3501184479923390302310351964","3467470639560274952028100549136004587087030180292","645137693","35884411620550123212370804774119002895","869249870451417689016831092605746604264","3146571262504552127610262917826207632955469702","49049493860414939805257774","134845062415188223475668068850222755160316","509752562300465045489","049474720989","4325557394435","33412","50712819347776296822960643539177","7943072638375374379191437559454295004713","996783130200558149397000060052465127152828114","648915385","64218546414955243286171","25784963962782781360600738895153721578200571"}
{1,1,1,1,1,1,1,1,2,1,1,2,1,1,2,1,1,1,1,1}
Returns: 643811654
{"4661286914988663941383057829623582153","721541788571290602222035515362179323","54587502672048087817587515191044776180900517927681","369872284321429850321654859","1044641444","02362373179326004798107","596257131326951061789123578513826005378138","110598902800125468013508849053791081299936562","589075555547927497"}
{1,1,1,1,1,1,1}
Returns: 565309828
{"4974221571125158748599874544341171","1","962468776171048958971524189553790163230","1456670740134857839269417093428","61493452363101398631821457792492822352","83075438137462586594646255397501533002","81441","568584022933066591973","3846058410874407449664871249594886531258","257781728310740106395463390729520735258340","3479958291246720339715899756539303","3841517434226408741478170492207851098019887526263","20336140954132640","90473172796597187758098235430723431659121439","829492983402001256934398269790034","22566715998587438142158805505757735922793"}
{2,4,1,1}
Returns: 449405789
{"38397435223706033382114550865140682","704332110941","200855927285129858917354672505279589005293429851","53199290013691210953244986072025449110759843266","8773","8812808264079481071017094","4","211508888217733265930403703647382203768899101","6427195375300","11536923001695063579725753762961452","177773405427421276007803178081990","39340638087071739843462559772711842","821550490244914930505981405132364509832961","9805","181829149465265943132161198623439120649511409292","98828105155895034018503516164939259240001","0317326134","6918580137693","749327785556721232538"}
{3,2}
Returns: 5453014
{"4442916884837003580778042785975379272423626606394","8575440503866385341985632835498112301211508807224","449275976286055286202","0761162314918707118","98663746554858288741645710110162404681620","8650835487287464491544801427","45257062181","2524123","6","7042723541504172588147824511992584233481251","779635545497961","005100586217146860760397134636783903150","53402468562467","697387420052419371176456352720796929","4011391074426486222042120664001439712460","88177587829511","23024083484541845674212698268","5034043893601","01885210","971465239522505881942113967554167839382083743","13951919","42","92401799858952","790834985114527313622144611496374679","7185019275509737108035","91","225753585287879276040855410545363698255550606314","151414518835656340116687218995010120555672","91","4","02321325750612057461755216656167661","309760131179532","2282262282250098533298","030924215267316202390877","631041290133481289333310998124582432458","96","893438364523048476053583869583859930752","15321896993072","744377425744742500837","502754935015767409001000366667734167158463975695","2","59","51482094162184","25984096373908729488974278569","335041104889472857"}
{2,2,1,2,3,1,1,2,2,3,2,2,1,1,6,2,2,1,5,1}
Returns: 743616896
{"7794602848599543234221895195231103883","870314647147","0397786738874610540066644893479581077","280875168239754800688","36706309424187693064408212133920293031335942","47290154346749430423817","79355258911201027501627940218513690","95797914944447742782144787831921890696793877037603","96601972891937998641443","8242720608425218986514390455592840129293948","5864831364782503280062439920833700","528466239564045323122038936962979190337","7746757960","4087004341330271626338640","8109","802674628999763237311607625193927514243737313147","112838157297455","1691151607332887475927203988538754805","72210674290219254518352","527720372477813","087312706","538940","61392280032299945652747","5662656776799093830952492169935901423263","3727909064635954030669405","467750080192","0816972997849427318130","51479141050350","287207949295929324430426117696","0058509828750780461540189415041052","0353","6863871665094416264","61842615","793910554171150810112700581286495562410"}
{2,2,3,3,1,3,2,3,3,3,1,1,1,1,1}
Returns: 842661567
{"719","409562489319861575848679369150487617172078","46102804325710855458379828704202","13371152091971220928305","8936144725802154770814450168","3188852106824","78411778626153125578420120963617687446","959198495","565204278026352868057252802015574131699","5814479","0652192655119377004234725787770716471779007575282","2147331256088","8877929508378151814","62209043252962243591257440247055034145560283584","981011802414","5842573801951786063270","862350412492330796185967603094","9133041","939440796223364","534168952739480854259093299855386254072065497540","15047321009158575105129","5890021303397249054","9484551","6","368200538214083654664546529747760659714163856","385359268439699413006598297","03989229035206569","12046079591","92872754382453336236482","1800313572907276361716459434141900116533939956341","28139369","4845672","61586429691644029005","79684191048651449781206851059964","942754730300297341993038696595396880","4596095866596607900","589481090812801373501844965563248661266833490653","16107377","442988769164084299905973612837637723643"}
{2,1,1,1,2,1,1,1,1,2,2,1,1,1,2,1,1,2,1,1,1,1,2}
Returns: 152589119
{"7689340264406181759606570062739498884588223618855","7154397075954149646548367263756871944755315","6388420154961","9548824288857","505657425228175129679699579271186461762","0387876055731794608912050","791636450","6979219532278074214944673936830","85376427716","0706930306317378814356725595474","539879631092351028678007","60612121683085736245789930404829725225240","6330692693509558","458930284699598317888374499","966431544392325512065368","396547663150","51633616432623751490954215678059165173141774","092626529477124171155421032181111686896","42119249824573452194708558727888665719328505895","64508644999111","958429126996","1947528841903404","025838537015424152","1884801039489307781855582681205970891002307780380","36424241373532680905460543870195941573210815","0527625010390287125767836372199822310269821589617","1311679426014684591","644401536818959816073120320756987656","881419149758868148980735046968255003297915","38960","3340910566","29168931931704290254187259032186480","84463848040070468343947010481435","32","2803146830185","3703631421570726634685522109452254075033477","3201071414581999516377464105216211819720450025535","156572835","7983695854168155909724598536913989","4000479105006709715015051427797662269825838883265","8429323864556734528787883947933591992656634","0519538441374820538801779563223389678418806054","0956","9203738356477580311495906343968741"}
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
Returns: 166560422
{"26800926845470693092","29013808266105487380655458802207961","26768600","400356653790054132056269806977396","808","72679809025919300959","127238135200469248257160988304469053707950303","98056231411","2246946054437893672307527640743259655627278954125","0793841941907134924462746","269235373060936921330820354874649199","8356995869225810","112426617964252274700211"}
{1,1,1,2,3,1,1,1,2}
Returns: 739102677
{"04281784984540051710940416180629544302714910631670","46990","59047736909059","0306027400789368729497","3913752","19862","452839453904219258794183","2996270683017201622860","98054793230372062883339991979458","71783863799889975139324727301574920113752721564512","38423659446294777725025736089757907013118","89121183950290731752742178091386776481867","22166017633780367","683312396420899","2148990166113370024516935445223308585198","66","7165988924184035897371582071583289","288358818267446617282927819598819007488929","26671755","9308368347205059497088810208918449","5778633222130635568910327926142020406","275211355349951803285166311","332526755001907339000816783670","88352985947"}
{3,4,3}
Returns: 411033464
{"27336097403063708016336","78918928113580228487431593690146003106829309859","1895587261263455391927135812621618","30956422393092804314263093043656383","00549341110","8859484276553069600466719707","51253722320712","530971880904076712207959284121970789846177","812179799555196544803986969132778960","4224610574153204688","365891113133439","4397797406811125142743064267","055370537954935505718646746681486795363881","1691428147442229226891036940887"}
{12}
Returns: 762258882
{"795265908898559894672743932046797","3268602957710760308627919","45084","6841988868902899120589992680978500741109","52057968995","5447617803852539","12369953363427387862522065643575567758","2862637822511631966575897","98269522753806576231138937651912814864342358226676","4182570","8165179121","4727222526226163024960808552239439579","86308226222398566","39351461651368941462200684377","35496530","0907118472367003114563486636","867272545373146165355922284","0912147603459526534273542903","447647230526814207379880398755535499769958227","6017432527","862096027589328253128","25546266543702816701230710749765357087643709922","85350354317202","636051723","096","1146542631087412","69902968604111193333","37532408615479415058270155417687650363","2956361949995805348059082582666424251","2068221890836211391149310471004706174560","1133","347038235949149248033924686240883","47770166717080331389816682676480893081","5419303044721110003776790220828376340192693","6657418571198552660547735881955","0971353530752418354827293933593805118217","4696924978409022021177094","950","5486897857952568141283614451600879712012980954","330104798578020743543213449263939435742054917467","4373496461812093840","14808510030896365192","0119939971319645924689892","122993526647"}
{19,23}
Returns: 83212424
{"499179451757296291543736026802039647369","61604898","130222255453402457616964546070851225","0127269994257474525120327014"}
{1,2}
Returns: 768392839
{"959358906118511429226538412","02035220842651463550527864064677","226033390","879545250898665088364035564875016524445428","56831875711323804","609319313981397241821644346","57183850676147075386533167142887322026924759","8556045","16833708294767761444424","6217347173181617709814866495421843904684","35244375124152856","952111780337167418199809902064147490216253","38936741997861460073684798560074637","872691704287372334703996480478095744740987051","7257804911533014227339306734322746528647421366441","76982918385313151265676","96355","793323123284797122620596147539009540631","54147856923066512693312639676","73","49196538296209","555281","98915691775351867499189265298158241881002","7851348284632608134439211430611065121289549727076","6454354186598494879997189","034331621114146979573944784314681988238065811626","89968279","76413674758905400380665302538","1189179321913466612950927966828899248","6322713370118482084802482522034277873","85287183085","7699991057606306593637689","70395","967069195699587332110528","77620385080152158471994547","53616193469784127492797873368","42005519","8945912480269454834524272043112018836380879941676","36537727381789677419882427892204"}
{22}
Returns: 624436996
{"4232775109691834561200654","2"}
{1}
Returns: 763791
{"38087","58589080109107024381280138608339626006611","881587660388698922258502692419251701369","007211692","1505701493957759015434066089348556236898","0672251650105253","249442383406777584","9879639451219578478595827485","811194123234892257995811563","58212784204536989252823574043544776213","10028318740026920852182978819901353169245835956121","18593908212007420150205774561176774873347","37936749941608188538188409516543","678460311269746564726","815926768378714733717","763562129440370","9989812260431679904","3","651","070062014772784709857015188","86098182584627853338097427494348914623871828","1041100496881336132590293518170","36879136758710851223357484732659154115759434977","9","8198828699086592414940771677495951997045147","28099162197064629207945","97988044100374987","652027","386379577714","471264970692588013469022093124"}
{1}
Returns: 38087
{"13521","15815856172166939904","5336713561472282445039438","44236866219435389407082498966547364427714472351519","0131063215534008","69414552326119522816","3460407784882","8078149037754254235403694555","460702416186788","35892393558853076369110272772","532949721282271660746370765458990","7319485875228","236","722776414368572037444306025606342","6","933406","02100841709843923731893957894143912714101","5840844308501443088","4042","2027052150505936123505","818","3480028344511465941135525378116470101843","6784059355273717436820315740659565314342657","4969728917666276800513568773197366775523542681755","183218610724147211344342616709148008","746918292597332696110825131235034718190365009","519591414707279543928758742345221548062067","776332352905139060794518046407854671923854859","71278013249","661588257346774","2516268805610294220668613930816316","627404734236526309215209611042908551","876521575485970453862509649983499"}
{11,15}
Returns: 606534993
{"188412333512526267119293767596121","72055","48570066055298232502052005917676063927870896956918","6811197756246018635926445798305901612863503","0","294267802","9436696232184748212181424","331563609923371040201855876894126765817223029467","312165052706185229","0732","68527452250240465293755569999305","13647890","363554803879626104331535378824079751492204422766","87398722456734","01783000990140477341065427585309516264","03843","03658","2475210792046775579147874787964","0702551841616393991","8763122507421553587816762652719415701","83769684558374332149735050558","949231262492792976755782948293277","135617152263791678380893706354458","6199772504326188628126857758","7911803643538254028930318870064","96273153987211705669774491172488","907","250","902553139541267179377838933779951118","458753786001696534517324619046586598","9184","2678642","734083321552141478460588229677045277021553941761","206195451429369058819159003379126","21825055148720648834174298243556","75666935752698384300997541866448723304151006","715504629673093474268421629800937587402924492","371489718100240487","715017697617647628931716448077160059169830721811","5953","043723107066640","6","317456460450621140091836","77","207","3394327982977664512999720216","2866849571906023294411465997042302261321","27903549358840369"}
{8}
Returns: 309368223
{"16369130042400243789876084976262358553","725825963481299984","55056158390011075040231943760465","150088302755268191787775131222297","05772110628258699672631056081232965587037742388","524770239292475223310345545426","7856580063230823203194256944348187281334880","58930","51775134803999498004413917837791664919206","67202777279896892764834854490330483393207","74717340853214091937276964289670804749","37","3669852728305247531124244924931145","3550931787932","85484340979104958358030223671724622","8466123362155709","42913171983749821000943252140091398535362192910360","5796075531794807652755","94630208481551683766078771496878","071373218048","5087282468654067672112968972613","0465722632897512434559445861504481133706641008","48871129476723318537669853","6855098752492836467479182714564127951485494","33456410695571950208676245218950689582264929280","94196563134239781182906941696175592594153442548","865974338086059158958657874860","916159997079","40363053333001070234365","854143828457296593171120","5044063"}
{14,6,11}
Returns: 811431062
{"092619604851879826892223764489758895914942028842","85758585967593690429893462996867226","3379144","77457029615872972912816689","019265310509968007993642352276919880728251751896","6619642079378423319","199676117041024624959723720382835007061206","6612917737593264863857605297568518316864614023335","86868349610898","81811916060536599698238981201105","955545101007988925074744429722700165810232771","82553904783","8877521868700805988020","3556380572848540920391425892638790626980","171329932340873123885772824824284972","181198855050010098608138630555387879026925","669990871610148992843331285401157346994984340335","3698417977111838686299615304556116290695217806","41686107899097996066213546360","5581057795378","9865982416275090592944538272422702","63612123129193366259171795206105219784130","6232019215464542009609962963443908240","60745929082816995111378627097407304293","60208293192987130744317017","201100466405464895699","2200952007645291539567821852753412815806467311237","6187586327604697169259186184317","5692","91048","87252","16463725817642366777422909752652701","89594732364283444113888865391333947482316447431153","8627413642006612710644","0839566793873480833577853412294051101","77689119906002195391349","3758","91506","44577699866","817220337928","102266919210068047755574396","7696488653855503470315535237402015475493220497068"}
{10,14,7}
Returns: 307764714
{"2195","41970277774584268442794284011925979788930338606037","227202503154584843531019327726800570950452912424","9156344531428294","321009262994989779183931973808547479","183091621321136561","9457096572048679268689583257837336","6526090833647297506386779552648339649","9851245388746579236316","20894","46652667071168981","757979264337449772314937592","21151401449436248986292237459271","9","45982220948453768985205883686799493401487243091","8025847898081994549468890389","349521620024187605555206648063141632","78572658171128939922410178670813747503325178","498932837640","260073384142690870652909248110","7915633505800346533753","766102153646706227987","6657522506839567024","504427133","742606952628459184175626586","2623717767463145","24257245735393952865643252264621609987379","8907776474437323430229716834011294032458823","66183780724839420403","6522835975771","967","245576684657045","2943459906081589502569","0816554853011347188059874323202634","69278505697181","193261418778334567042016254092422995670824592957","9128377992223915091024401493518643105918524","824214754498953622","11693841","7815729775452988022774115277053","598814947104503504202903937803059080321104"}
{1,1,2,1,1}
Returns: 785048331
{"049126","05976386962389088","93460425142336","5575505663296314673117","6839475804365551612511159570186814","853","4309259760968355207277869","40711942179550245319337797385078295","312389016497406233864","9","12147692084765794299971171483","41965511719522436975854","850963131761259386402","6","9123613","563095650946214139877589357237791146068422239349","51723027323735695667205195539943884","2637493189209145079711174819278229319716794625","94117986896246430997024273131273149231784161541","6651906580","14","451923","2757959697","60129048404082151","506021457769830978433026710030734","21000692244097204","34231695143436881413292557329854241178","5401283434162698023399208","78952435452435422729508518245","11565","2628489360150140992944898023488790","364","7860165601637922559941409092604633"}
{10}
Returns: 964554616
{"275744600930361646923","8429783995543164518123978185417","00867999662379841493280249303118321627851928212027","2456154836576123960","66615325","875852120824725429687508711746819284","7870815136997087235365","713957150855518065760719860","3876646121593582458280957799650267","178297545621253422986818234071370270584122","9288917700479651228559","92045140631192143036","4437516071099310296304619479","934","99104181682004821654553964619867270187611443235883","618314340103776360976","601671732848498423697298947769957978476757076","70687554696034540890610044766289539","907131700763128634834099","471195828075500300556001292900894659506","7942706780165537848441770530","26335009905849289494448","513079340371630035181","756507690586350238291147805999133740396914","7264799601317868034159095640967678874053892502","449541548623514404","929","74224105","0238091019104282438","3282864889713859765424680580783263151027069226132","4334397197337500924435807","562923398234916013681016768027097767","563899888294","060251612088","36371009145436066721116895113287836664627827260"}
{8,6}
Returns: 479511487
{"7898467722879633544398","2949385759170440489442988085734471793667470","1456284","24745412579184","18555920045338410862603014745641496","248672385846","437050742955097555767088129182213181968","61805947878579","06418808537057391736073513627511050885444410917897","97716","1415943980876496100537948900980","61056220304435196600881493302230737041953343","577039666935283992058644161734326039127","0300129606436276236917291726988599389187037684651","0963","875402963729","4765975885602415046787482585010184777925235168960","17755587571707600377094689933182","07763073","611148133457624546","74904991689343334900876832465932","226873939053090261180740316301059","35378023842718348741756162215574481653847252359889"}
{4,6,2,3,5}
Returns: 927282888
{"292605","618737214239114797658063050940621137815136705747","494804755643629148696112768610896983712","59704043083588277682791738998033563161664615577","2529349880325019358831046709","536885006058355101671773221263095082752","36340006414557902836905634095805372207","673146954002893781533186833210963","6117","116832671862313490606267813410","71501","79282","97856232193049284058800","522087","41861228","622129606279660983009","7209463371914422713063047937605913425368","00235626675889366823","4628696707269805447663844830490159258891370639526","866","340607001365","89088221341791711906059968540340217236","81349089342947686704072161145329490486","884911","17730701241468119358","69393267174542032667891435510801681248333","3","46861698579170212","47224","853453216442291051928832693","12957848188809991326328449762795","005759839664559","12","562251874302","273442251408567968769996869198","4303971397875322350740169635492962","5659504347456237739","4054109540997238814540189575","1803979879465747040454426441075813079125325","165588676306720545938099853440069551259847729651","0918111325587304412395231056063757158317331","63787894318980186844328706395335726769399127","48283350412466383501248737384895156095784108698852","23081658686665806269"}
{24,18}
Returns: 326847072
{"1481231665423746503038667010","817254524950","31209475820727154355982994","9574103537","4303787496684590841843232634408170238077153789","14738121965154552147113632084321366737727376701","08957065439","688498043450523376701131105809829614","13156638793841491056590531708132341241392272878714","32102197902710298478949519420","242297304496447869635186","44400836457412683","939669328140510463107108922991605055650741018","5149469220002491251612335584907","20531833850584019905104102199","22616041066841055132376909871496564186","3700412065227507831074043114","71811576997","561475646753834112861436390296423641707932017","75323987431","343941800215649741416293623698","4033124631150212982151741488209358685252","44903435910243"}
{3,3}
Returns: 461898525
{"0397537091345832815957991861414898576212","572452593849787724548307698644230859190152510661","8390547876737","14","406941801974798248431057238384334876062758608541","2","526600197185219653122148093","1464291","92335452311095050643609016170587391"}
{1,2,3,2,1}
Returns: 181094625
{"76797350726","254317883070613139524210113586747736712729952","9863887164466602798","6860551637803773338538084978606338298","50551115051","1","987","885333430664462503308082367578190074","5651240676372706827010205786487099240377179101852","1661343337135387698877","4862521947497504095321315159159626594839","226295245957","619944472413162531304193194","837218","9","50136209746781858755623328340","355480283229975352670031252079629300661355","73710136427291509796885738376","66238408390988374","38","0391834978530509279771465628898189197","63967732379431019455072","4","733621129063005487210741079790151581725","446723","209513960195390842449757088427484","180995401608707471790267291210497227617389284","394488598","767149579099508400156215550693782608651443766156","00431012790","806608036463420678112194607552760826","9236453408","20176261733172949893449988513","32778885791163211548110","1465976352159766988342","916232175662442442647894747987494640258525229170","403280317504","86916316478185920803950101090390599","739704424408047882328326","63004941989271943357057210076141868010203979562014"}
{8,12,13}
Returns: 702185440
{"4","397371335663204600771858203438944948517","61477954567889","5855019","767757335","8887516889609421160340","00851442037355711079807829681931","210481622762841321","12237401","880024561481838535634110661737618449232","70099254","4312757587755109116913531068092809109913831262228","494962927031303257314138","65803101430274915235280063520266833","39","19380397897828595076591240852996134146903461","7672995624278","2183419112820194739211447020119105455540443","947089084811746269428067407746745957693","35764872654682386067695045761133","9092274024317144515571434825991230230","2167000885946642","1862274945613963686171728174701934833547649127","70845540491833317691109338269300507063118482830518","0997571","463682791338330281310233","59446986656148805998676707075958162530850","8173262036183732385154794471056296206","7382406103614747960455842016299461","2683990096936122734833175010","2588778","0404507056883392844289127806194824","227893282677949508913313524837838942","58069661012176123936046508590264565266809783552","9","801770759011502521702813565605020060523","6782934292057134617153454444","4","68769224789862235491906868","9304869389776501002479752263","1659828209159","991887403316248167729737711495698623744082","68913158014360790216493016107000550850960","280763821697851203946489300383749","0329018647631115850314251562085638028551830781","539260538897439629476304194097045444643","5923854220591138369526639933108666942215183715418","8251769653769929142357876798370","802064708861564455972852130919723","514104705277073642083512416591"}
{1,1,1,1}
Returns: 4
{"2138096644296600134603977","4205553120257659971101575266670846812566924","6782486244977347494033132584","387386145835300947767180385654622856951677","13281773490305060452095211776934","289302614318024072542877182035141039","97650754050831210676726787640679","1909317671936171669761753","8252467363423153885208699837253","069240060089564589992624184738","95128279294005676395440546670048319543812","6246118141931764883570073243025733264237978962059","83280513231113898056912492","47418285378459895636016405963066094777309493","6873630598120802338601443896","5155313111584553349292780390544798698962105856997","553237471969730717438966857381","61018697270598838106370521369","115698444660255949948266498","84272331635850235990903953346860908992871695","71882861925874970233060650001","94648689737457991380242636882128624370265480532","8699366920638493501631778","033084538744093991542849591721807675420260","610652465528514553320496959213710","0144980650110535319470241222374870388","92239241127668250502905549686461120","9179662527121662272482897416178166194313"}
{3,1,2,3,1,3,2,3,1,4,1,2,1,1,1,2,2,2,1,6,2,3,3}
Returns: 423419657
{"695035230469191578116568476168901","641291891536050445087750985965770","41008613117863418035661485798382040049995","746259337432518981997223325","40835573812218042295410477686744073557973987","83876461859116041909868197741169694111215","0880232924111639395749493774034055962","8073804040817829988460584787","56955612990615852187470569210465433968245","3033618053253607668820696474559289961636622","72747200007567850374662410","070307978826869941426313056","742475485444180815884000514197984978309511709","6988052996591416627550304303168982009823934","7365859673824042655339837022616551","3101024902868255189457503813520399","6702322849512318490825023378944508","181059277408629006921824472331465","03031687833005361612405568472502","02465662646475621597218801887072958","2563677416497943945386185448588352","21961079890886802582021126038815012","53501451834435522507613061756314104975425751813","545564273497596696638110387172945","7288842507709069857297077966361942497","7370942107565103889785470608170424717783153653596","76019424979075846277111621902948016","5508634632605899974875848429533092981687609383","3116865878006850980214667650","09249409654148154930991188","43931183939715132297799621069860896101257291","476092662408870157227915544","7238148023157922419753251052947784854","051478725338556066452332829763672","212299783669326068455817121402184"}
{19,17}
Returns: 171309946
{"4020104722832315304855191557","68680145813566021895702419008185749381673681","9893355330657803988532914254085","2472417528044962085723822728213978453161157674","9890861660195939182483954770","02228526355079735320874389537165589687668318","516827079053837153100912728316","11607948976956013304755929277768077592963285149","2820876608790770303724439810833885","651479571054024519161718285174866166998662071","395640088267664956193861013","0617472191258908457660124133945340857782","1830729794107481060097303823196642243450924","15255556510645258369485235288710778","3418715672955151891129632","522784921639988416073735554238789086371722","9128038240159986715833202","22386684786163704731454439","55003637960061523672407423609966","980803384367914056990996697920006110535589538938","956046495438364795730007234391473812179080928","9323821329066648569897130613","5276557427478384251399650821237315565411763","5890015933161578855401506864097","88792920011110322515192514812771019255016","667970491314698771791068401834976114","34186560214937507161629200499241239610585133835","73512889860992411383282477244849634698855156846","9067485667196070663332697083942077498226","2637713626793528204035537615808788741","4554190973760513502991252522","841709489471285138169066466428911715522020812","06633158835625781036615414766"}
{2,2,2,3,3,2,1,1,1,2,3,2,1,1,2,1,1,3,3,2,1,4,2,4,2,3,2,1,2,2,2}
Returns: 889427574
{"485925089535199441427653421093754866","518137886751047405558959050","1387438179064199086853452560861028761942","7476003174299876955910516195579242","9490508349329542946387153320831987495329543393493","67029153392825466883417862","8394557850057361909066499774193567328658164684851","6098589669642861715606532110818968382328436231692","069128231994001823485601369450613839727","0129312466297956356157692599362113830","2348849143543293983347903578820865394123526","3390979167424599745891559740808816848","95638264526525219658882201631","45516349829687167253061044463755310625","5635705124708553930997839266","681093571448340844819086741628065593654490227","4577512364535785243247303187514496333938681945","69902396405258944359298966400104997902071013","280890934039834039246952668000","3197036501285440747869950161089","26940625265570376464409370002256730867079","06301396967073488722120257059962255443","3181105726350111769666582576802","0378599826627429984326477578162224","043725152277023742022140902540009392842523","962428789099284123540953717926120","612068455949562381420741219932458970473887","630880612123154003313201043755475","570800030850561142795653624399876527338","97543668508439456801411979032009","26713527072721236559604997195612535509276798","7646636744453384572667326862056059078031941126719","78968842791496470483663601","136833279911608827491513920896","14700494030900324008649197907314394815535","9492372055802269912685467411","288620312808426317595865376733190301","09065885084846362957572057107003976","17142218977058702261780762815525","94658011614578013112359040076737688581526","05231986031892892567993045461973821550561991","3324480216529949104954636778505842","177659647141039812132436907","2945808805475876505106276394905","8330082763283422567453118320059511421514"}
{2,2,3,1,1,3,2,1,3,1,2,2,2,5,1,2,2,3,3,2,4,1,3,3,1,2,4,1,1,3,2,3,2,4,1,2}
Returns: 938212293
{"15887040477280916044369139548269317131","373723720439264592887498821691072936609","448599588537327205436838164406370717475453","76081636531502057072238818373716476","4784382552654032053580336623827049166682664","716531850583175703031539137549471","913432740863754410229395834851","549435434670234009647355143478382815248068","062351556779597477288347275281400","64290657163817687970000024290186059491658433392","2460999557238977530405319786141983091095782362160","41955312252291045863696444531261451976989","092308976660132577159720915588313709061588844","5289599268082799548985367500712","431796310047821595796252811","770945193113108890692005800495","71305644781912948357734971605755587028827","001579555116390626027640339200","490132288691624767969133150849846478657116905","2454458474346806656383362250308178138","9398659648881159962212187425016","2658167833434392288555215431","868756678724773878915862900996","2614236131444715676008579","50346628617585522297380497344424067635","1695761477218553651116353918851001903","35445435011868335948833325855199689811072095","193417805772846246486284004050760192470"}
{2,1,2,2,4,4,3,2,1,1,5,2,1,2,3,2,3,2,2,3}
Returns: 616008107
{"1738067265836439564641552","40990041936847282301907020","9462606396169389891898959585927278540","30726464097448860992937907012740682688665","41388434705288441933418126123","3945743129646803279038427","41004510742905888960350501693945703937530207","036136969571351710528690264405","7512642356386363134460486","5260323160769486297747388531900","039335568779437922919045967","24060437154260938566293116718489329306911278","17006339724840101514368061775","0239758862298571451632007259845","4504949076416336760014776960945163036863","9199790202728664443506981840330","27792700517826984260142111375186","293656089982412459155301200379783249467","1164285793868136502000081798","0973883406036562521841875326933770212494905309138","01159600010685788452667366396236815798","8579961362395147410047409919161927868694","359906374687811288543542985156890543534140263836","227648999017065701513194298723","653247937880902852577308496","767985470798557023931085584292876362750707","39036607605107107584265317","996107927421661099447282804354350110243146711","884692650407170299486480955453743557925","213897943084232844191200200420205888049606910","7594316805888557926866561180288860665463304","3689775794467587248949635739","8630436217981725881646924364271826773850434","60790261656356500385387246491931491925579","0557960763726446649956930623","3988131772173441341863109265","6308201192622204908597729314877532432506880711869","10487036459175189805413562861395","893740619281615910171484163673015667418689651","903879423899509345564723847209471636558673","4123972775930726472341049142442047050154193410532","15020950581241499702977435","8762192724870646514847247679163486146185056300","8241902597437160729304563591183","4415784952902072809091530","199090351372182872419625243037515626755363","012385839248344173733487627628323949395","332130935424865631494731376863076499745379"}
{1,2,3,1,3,1,2,1,2,3,2,2,2,2,1,2,4,3,1,2,3,1,3,1,2,2,2,1,1,3,2,3,2,2,2,3,2,5,1,2,2,4}
Returns: 994990355
{"57498308945735252348623951","43131593889080600479694220609739303","440808716543453115408502777853792","2906270366699790540516059185868727","666801501221548677678082476367525246679278","24628027349846687304259062933","50062348336895339291678501000368154","73558043249621506082509834539193248372853","221892440443229915621987443273858217461996166760","4257748171240111036714131993609916169596953341","6088734080509366012607651183454718873237","558608832514829079747064367976","5638035708478687651283443510762471718135308386","8489320058051239837027492833382926444091107826467","29784683936617274814836436908082328253080265","452821649576862592575872553911070532229256300","6807061685998119598670927225743","8344380996545713700377774279390","15926099321538116172282830","672341610763731091879348147","926978333833100918152492985283177150249295","831962293498662391268693091","5908203287459030657650508987414769139","53710508911276833095579276445531405293","733944359263612524797159351239893120579","457319183291042134870297396569090199","59604515686219752748184912","62974034955456219566220040916124","0805313204290690427156457899427596965584","87188976278695608680642483301","12780003042306597517217718737439135348858","812909029679898146565978821047530313850962518778","5716571243293761538777613045041200","64664700535548263102835478","59005736446929283367683732810253872239294322","2659700999383575906602816","547422518470066116184416715709531","3268775163129413125752812663887","134425078620616138970970761458954195752430","148908771768024642740597613904558939059","762592332152221765801371079446","033860681002203076157195975601735562","650626310173064352914850091481523598979704123","32908587278515664997743388435818593822","758149471491292387520016187797","048291920909313052429566404248239881"}
{7,6,8,7,4,6,5,7,4}
Returns: 690938422
{"217920114097449550711912173560","1810957101234100894740406576056033330804857","64969325722698138705283347696347882162048","442005886276469056603441772845873080670","3264834246999400643988352","34298154243128344959499352641714931941","228738452739773180841167928686834043219236699713","85137515460145065229595309202","635455540022949396766168340912265565078","04486017701799584967547077542907437","961095195977701855313372790647792674181","434449220065912914111578790854148101222","4426391169704510952900445880823513","21672507346033839199954245930564122508","38839768141915860269890174214013905198981909647","3708055992181300191900986","3835786910448631171930409446356541095723","8460579244190401785155245806490343409363714","0055597488104023364011250398635477726186","06322736778176074349770465060245","1299293591188593714793948760156477980390493","260434453472538695594059924189065939","21852843438328439941529247","2852025121368070209799355578135794","750641518808803482934130716342274778","7196762260634457215115339048224725912425632503532","597125042458446457930316700629","203961515017804872151211953007201","7778632456237889118445456","65530717884662117707586360","1608544118512512344141168954938248935693565170","85468484504743185106381541481248858268665","57806415615863144962149925946867493","437816059029452874229020062556046114156599","8007334813402763349867631884464778041","303132934878176689189179109","865890775200607093090013062","683653730063624740978069032","6505715934699398595194433759057551996210875765","1573725782948168079030629","90708434298218507427944078851348803407495696079","85932662502125189804786641760273010163","236855397095314681498366550167660760799355","7566847923908012179963998954777130394004383091974"}
{3,3,2,2,3,1,2,3,3,1,1,5,2,2,2,3,1,1,4,4,3,1,2,4,3,2,3,2,4}
Returns: 354939561
{"46353581171310562588548586676088","826772732600792348435140282168121","008554228548836431527354582422342255233489","786048173055288264723072225","76519292334947518629999673123139241142055198703","2580494436363240523710342515","0527013702466267577900861127550355424768192839","544763717624658092810773554690094806","3764180995882890593212020218533041960192","373799255386811938056580099491255521805444717","11440845899709330720806350183207329465044361","8916865280015357083935970714406340546867","2974924261591804022414576758191088","7407848256427030694247752890691546588987265807","646179798207252336227762978215291493189491","7344572020369950738002799657581940","24101418657146155942029287316117","26365320379502165619228045341136212350","013434591014504813475512104609158","8664078674812361981343761450437705818118918175330","45154629349516965113438990952319797992","350454939947484718769856466381774","07870242498011706106829410433538115533887327574","476197395543842516055027704853159119475737759","13103371943161296866898059614069","999810572649630851291081078"}
{4,3,7,3,5,3,7}
Returns: 372651943
{"66141190878196951935073002462120340767149","463144798391828219289072966666948","901877956445888431510929198675436","618528355615294815177375033801939130226036567524","4377705927744133165932307109085693631148261890674","0788945446517464408802364634706144228508310","1637424740477606402570278977724459678799328","916250358955581508829068428319602888664738","79594442092935549364214498496410476502619614","4219200057086848042806425","489141810156508040183224919","4818114033228728848564730158239725","0255970885405869486460767612120041500765462866929","4213711630910761115628846323761","6945278550332312308632942298","43192221727913803200358639403","213432634332335163941893123","63772738673945006604327858292613434931","11448901402652630464727489","69994767334276611484374497","96187712841239426093644157954","8339318786606878600945147165893874","012632409393274881429286114709887758835","4761853767724338738694650136003115213","611564780360934892648806240849468552106","61253785108344235764050335920657425","859053895244401389614295587293738","77433708110044014425701696943","1420223688530880797818098632313018","69508630143981550091365278135877575","3176539526515516810671875659473722520601042286960","15129249729877585479234138944906218142291310","012441778384592694352369584280497376","9273232568020351741339553092860645982274296021","746784510648509056254450831329597019","802612657256311869565004074087","861802669551352385879915315290994","84875422970173035513033906626050","819378607861605895360545895739621","27897579814862879335779665024352010660156570524"}
{6,3,5,1,4,4,5,7,5,3,4,4}
Returns: 998414153
{"000885582404150521497246255490","2522458036200810828907264758863182351025460","235597252038933338897760578828723159","935924321003690632509614090894350478610935681","1060485029494339378270452184481723285406935","0998644444034520169051335","1935049508749321897078131097307538190","678825744091442257572631643","4435092422172236224617398891","579092653160842783773041212966","570130335697042324455813352734908945869758","573090476543343922205683450246141473","6259687566651871282014902140887","604416938387765721604770268835925317","00718195580654471769106463502149391910","457424692835076284787741319323946415573801898904","944420104672752300291843137","6317643734892648069659832013685294522744194302","258826666844378735266224621531707858","967906446824436979875211536578932802","6248347006276551516713256967236884390","4470650680658356503706191264252147450490671669758","017874353732643195456280444259865721461","081996758319913347011500773156758","863431024269417945170684460939636980571072","6698314128438102243498794180656166455284","19569103639890565003958978260632486837992528862","50340478206900119057153113016339641634"}
{8,5,9,9}
Returns: 796964571
{"3432634722554973147616007674970841737","0816824276325554445745666538045538","5899302773865078134948393147544","80115995460217092932694683","215910015767833628259115726153016831057653","0403818822037802652087973374655982274","7381464824152352867678453053","91624269205055310500651549381590637838483","998658853101465542069253473064","52791408626726805119943473997931","59009743691481369208254419157923216840075178786","55077106718416253077873463063","9566698136908524287816312366718","82030232799347969047403267716","7271098633854233548154507664722547428576","7726554878126008061364025973","28138592450030986496617833719057132206","78621919106905645045654268556264","1566899688055230823865830265771490","50242415172901728405474253904698829","889222828688647705517174052535856174","481546431868785323984567852516956659596364","078489785653009350705311830","212600900275783919653779871337946561945412522","97797858056537473706211759503817452436","88429544739065049213050008241885064664022129","9057761911698576934512975055142163","3636762001156846083009291157051021374","712516983055105234908894285823238679","35464172405081102225456466283801115873","64205760884376815821818759110917740"}
{2,1,1,3,2,5,3,1,3,4,3,5,2,4,2,5}
Returns: 752576537
{"503871469323369213915485560917401830515688744493","961233373531506177302559565518303261","192662644881103520810042841541573423906923802","6968530816104608536040931622284737882882","920197779696790187825196229255180617183","02592421928012091398711389324021929789","655258164237127072570641634235","935283379703772935507497042798","2975316509506611604144529","6246056367225171560025702917","27790053108346870180591999957782728961213","0964800934227903203117837508768183","74943387825805809860927959","3767129470843716722768617479138","010274496494138095303205775","46601396651866683244896319054500729","337824691062069039822312005858471171287008913","97753480748387272225975155871318642210416789","8490043902483870627791658712014743873970554451","227163589541506659222439196731758079886834","3457817653241645104403321527","7904809150504447534768570200845386449915","1685797626699887961593219316717770274724183599117","207472128697538594044877890051597518426","98521962263223612546996502136266713126065548","425542379526637824723486428129252471186","970762024302965058409880296165","7614251548071692141270156837122","8807474709636098397308786","3924785687410144538049347","4512363048707759045373105336747869257","4075627996979485064010962517102","0410279844557819420082873156540087679910484","37064852469515642281815492646550","70886787133737692115374727352612956650891481","85965979322097466096292085749499477836","22345526554407671398922556860","9807706018530411828967158","571069061248129365068292375855","1049782138328935805879635202788885910742630579167","56877492372058569175597292048661461583679908724","3504809676662758258885614536073","713124109467183581342348474","2249178115920885475126354878224833208582040229"}
{5,4,9,3,5,3,7,7,4,6}
Returns: 342618965
{"5312690159029876691793898109279829048732634746","3686260704533378965338607066563406241957313947807","76093601398788093577867683021175946161098","26477135385087517519936127635659709480702039200","9069682435176905341910170624620300106744900","274273981230860730346491743459249","92434077809689112438608099688214027932115313","4766674428001743545836116800520361339196863","5850213723817651889873989685811660827231149","9087607625747973882006792473","877802985311709683855022193053958399358866493846","86151670179077922652297404","5509975103588358890297875723280056706","8682051884869677637728668","7039682098474903567923750008884322479651019893963","26213406604731323871977651093308761309878","2511909559469350400105366470938085145290624816","01818514302592130749641158683409415105","39242353162490023597064227000625202","330659580644155948778661504270211776590","50831857932085930264870775023400757","2895350954661625969962595213183072379453","17032360795203989126444873","3378606496095855396793117980","8191849912880837876239874930188227320762441560001","330442915548728919628125234694","05410275815662776795186302385087460335","2765989073358059668769588509820172341623","2451433365177117853798863950075364701250300461","86172578752615685061393619125047","04223556368957580768212546215356","3779203099635667689494798433615549223","9427191440760312636134115031858881","4263537818176518894439985439760572500969663","6107010503516954184195040111654694764563","4290364869184247101485806223210428238765","77485753303514705363046748403565284304902108","91582429581138428098928921646952490957099208","484667271154496820936919695899925334555593","960702451091890954725279977553024072402"}
{1,4,2,2,2,2,1,2,1,6,2,3,3,3,1,4,2,3,1,1,1,5,2,1,1,3,2,1,1,2,4,1,2}
Returns: 138798424
{"219774673365230756917944637843593249872168532","2821117332870628706758271216970357504088","80058772800497277333109401197131523675373465841","48492686288060229410031449363447942","8519884496265658392540398262","607318665324774940822661361417199010","8145243895463846807614183","126116302596875212945109070255144636098","420474516880752271074339976","74959357298002186021066441046454754142","9255035258415161429907728481","875966774138205004601588795393206518718321","57392478788650822597290062440513543430246406155","45283317789209176061722843854808507","616987557634604022292797729077541132298","6122242441200963650920712214103814","9931363759576415710439662992725050616398322","66080482481358500685577991424132","9039353964371592110843314913306","090793000289396486520517449528793019985051985089","55399091924798800187525712508714","492255831951987252873888657285605439","65383004345303327447177468751466678","01000148876612823570154696908056974082638","5936952234269758138802217842759","4160256394907808094496671614231590641017079","1351805639706122905210978406278396875219162","6196195713379668042258273008653","87095558317436111415202255350"}
{1,2,2,2,1,3,1,3,2,3,3,3,2,4,1,1,3,1,3,1,5,2,2}
Returns: 506977151
{"404183645174257161057715499995989479527565786","257989057921353209297045834589","65250384366550077490487912858887707068929","27228894035928393582172998826332071825930053822","1539976357992698887207966269499322737294","1985328268198380866085782779668190773602","06228276811354093356762380627722636046727","760065440378152780245976915778751","2154024410799289882435548716573567017193586","382315277934113678199537284084442759567939690324","06922043920940422896639160068470857422","697327648447872387239500949709157948801435601","00657994043248099996310572007653","3045582116339272078435192717876894","57963509807756539201618675335398","529088260365353769426721544512675009572038293811","0535750674357527978822693","14522331192277685052485608609039869605575","49254355753176249173538965154","594200525752841399105017164239984094771901484","41180268736017038882616272989086","1057451727955272252480563041676741390802317094695","520002018893359851737269690143829963121324","4433640017203176193184758607","097537375859426997781906880414581383334876","41101478743087245990287343511636779477901791638","7377158032863587087984086140591040155875439608","468492519179183023284504273082751212558592653282","53278345319232696166167154221862342773216403112","2182661953782099286586482659279919947","1447880774615934834399720040948","69839139427177113627427891","9456766219732878795920304211961789916903021","10744116113851393226243474","31722888132958006553217992078936405393682167"}
{8,6,11,8,6}
Returns: 878257098
{"4563574403287988368553806253151703711","2276591294786398841919761049","30980858514033909131146392853755769509","45648413308651066459083171488","91281871340150468330232833814","236566122042224191763252425641593","40569512476565482857811553729493713000","4036566138844150453380599548213868639407521736","13234583263971764100471696297","8764690588278040112165908536971839778855680310734","05959850609171485734874847","8135763693055057762546187131","6349234242993775625273396563384984873","316283709471941333178584316279","099648682543888870133752652659909","15804088830575494439539955","1641908287506320534350017060124935","98471705419007465497347022343125650","38604843709029311302057010","5963496476915274213297575939545118","9393023080192691095374617010165570818723110","79857648570171751620519904462317","05603943379545723250602296877","11594952260511810827393425046235423682769618035","960491453028873234259095572257609","4737263789719730943481154444071"}
{1,4,2,1,1,2,2,5,1,6,1,1,2,3,1,1,1,2,3,3,2,2}
Returns: 244164059
{"815609107044501270945005142347468436559","95662965945989936147105487808639994","99070076520642013224616698215410476","166352422732570777811382483851191715930007644","7314533228732174345522946437500075053485353163","638565856882029711476333910121617438","365730353850910558626875036309376703806496367","8576374818475296915573958943656929536047324","2874210663661956401374767763951272625172","1539533490969442334728196408985142","7170429760268166436344621402234976608465","9292190014674983669164366817664297769","901630318726990574463930819","66626060262160917245609735067070061616","72407049293164244248081889","107776183782182845897480194994811","162974019167265131282082499044347758158510","84023151830444534977505481879093","494008821831877790240660585766172585518629542","3734071163600804814048299359195815","686333875033868495602998727854215","745950701211740331493637839882044","8677207238615342559075721366532449","679082351506380560718518818150438250101259","4547629163428680248340832520893813268896146409","327797428218254173546091231462814174095992624","9621272783194428700974394371857819538","5075047392361465369667983216915860","5661607021513244191158408263350345008144","057285463814487563413258792309227884935371637","057884910015164534791296697911632589","2200590849408067939785705984311369933162403715055","09577766438381642986950067009274026855885","861017572640259490014005637199360840","776328726937862686356897581659644153106788","35628377006071515973518291","68078755526964181857689541540797","3868192039098808687843379935131","671169156192938402630438170403434598","471166914147099288829169248752569995","711127273914651388472985524751888","53090216674914728713276375","406389948749574810342147990845507566153346","3589337731183554581180524967344661271","05477546691073256019391345470772576792832","66851405209582417543428817052900322","96514035035390758116188835441382989","859731027402409261846350299727120363980530289","081489084433563167448486006"}
{2,1,1,4,1,2,1,1,1,2,2,4,2,3,1,2,2,1,3,3,4,2,3,3,2,4,3,3,3,2,3,2,4,2,4}
Returns: 768588258
{"06640102740165418367400252353247704989993125","7670677709541364871410543876264361006412844338472","412143808477952468547587139","67622220407666559228427626163397227153439012","4021407401202009581759116724115","970603321291351980236282997908785152154958749","1750271743802915435412204","30006709142348971561732252450297","0203096736795734253138977614292707433563336428","3485595809128196604221415827725206684599406344","28641623540418225576506261623","956631963132655895330865715","4863255256606297802268441216509468626825576","93813301070501113678711396002203217","487939337426933973326933156558301","29563111008370880249027135309646488630674943","04190006459182917915619398147983771","27100327437466795082848531","5029102392736772121688211677594521553752052320","841899659519359620783619466007275","1767462618756990403649668815076","504426677958463559953506219445993324","9551755043122780371409709","71296401249328538290248021783","061336623782429280802762798","3850400141680871465405294","806107100097921344198515967716809638238250","0070384944684078599160162361259719726","8781246822086879585717310862991787685342241583","727739262938124390180578882064","7323150821962824097702203846780594402","26779425107531875015050030954340","673456690401537815891070294011398283","466932397042490190159633665741805685593995"}
{1,2,1,3,4,1,3,2,2,2,2,3,2,1,2,3,1,2,3,2,2,4,3,2,2,3,1,1,1,2}
Returns: 883166139
{"58872627565402341388041238783660","7428685833511513341782784430429447057712936270179","4906032748502132630803152739249698839822234982709","10166447146724343012691868822523","7908268171204638295221284264901786","0566786222817658117427989194684","4206128346126473479374221506","613643144173111412432644348","7417521596334792964363362319858456777869747112763","02240154947123587140811024844","2721027342656138502407003472091941641889436","80245504049122174563187423980663589775809003787","062424296788234120032380392177656910103454","4974921327400391005749568070681985","5879086908562716610807057667667342","5274312518233990157926238493307442","963148485994431585282893199787402394087986018","8620168971944436518836879558318739459361672688","4706790683264385482290235098177773","813878439210098543280539066","01673188989794556263962571","24617669203312817196371106651527572654782","4047451128931532359076545299978968925845751748216","83273592327121072858294775711511401720674280749","96727842626341457497137435850316770811982861","901139337352068070480765412216267","155040804526126634361350905664835","2545151878722343643214649462","709899632625870065373695395264033074640112402484","431275274545687516461794303609706801668347","958414652825800286088480408963296788875434508023","30769907243408053851611883068055609116845093","27418585066843886269829368189869011","916533438250478138528569385196119543799","391119431694673816428700268293988","40220056316290415501006222446611145","4547627084426335949412979156206","929912724873675855924343813352818912523474872","915707823834221158014731562966","08313052617195934314259709286721","08948394502574815954885297","4308767046240071341139830141868617285886088","455092334871250620366293381730442111321840115","25542779073579413756176676182115603736","15998971243665014767186215741294205389851234471","6253927579763869398741283121703934"}
{6,4,5,7,6,5,4,3,5,7,4}
Returns: 192346566
{"50848066947715198592410260908667520291729455629831","57041188116661234308937782090206132828173133639895","02160903477510046386859107350989272367747160544658","22374011701140330666370341273435323005670001077753","24719050184818404446242924495177194896825599504108","47046774711138272748716926810036055598015615414101","37029597195234391723020907794870359344894027955329","85544232055265471101906554103812281452591106687436","83706194458112801447353958580919451882092997024041","91816010594966083945240284470236747992099653994084","34642733224409967094600615622286528766753026695833","27637165314433122238089862195188462098234833259307","16818251321444565998341267388300923868588507769633","97189548269269001242297245561210330192362386559671","74161974852651529984648653728344516914808924386264","83828209452888157212545170997514807135455892360213","96316507407631373706141486256025003325598139519405","67123877557651794208779933135346057298458351600476","11533412645672136475463983648133467322331445581775","19994227835527705593363965114217344630848701668018","94752830220741081367531111253419435826297311381808","84664922029977315786575975528495554940312367814776","23182905802976282543415089831293076230506571311464","08165501040811163859741012051124899424305592303438","97044518354970197044539704553761764576656805624418","60045978293993904556542583232946319401873309112902","95972659750306291739256875771006183044107600087058","41453978759892136591565522663448269751734776149620","53596553731168687260155771565250809838966721662091","32583222883516426656547520140222286479348373226895","05526987303619726774443299232864948905758196396916","95476283450985130229228515449619799422116431945987","87982738040678564264838000478910922411352548126437","53882244861784808601733290375614379509246665860503","49690915493408969067989456123106312623175695821820","85238218263521614008320632761138410350027516266009","26681410252465285946325701057633560355568385310894","50898234620776304165708308571460730529074249807562","92643923456497475918015302839625910850781983700078","05727089576612765866593060925394976192756586675512","06446955413790813001761655811733063427933583171830","93623567942721536760010181699131152748622962453054","37921098649107299900117881450265961721760595485249","44288865001933518995353349109859611382435024831005","41219679653461015147031671308183914248110673829057","62998054787029625517790658288039854542135806218630","57248479030469258319094101654810546311828016123198","53293693812990756931710560557757849259593421447776","72023192934189887067018833478807301126898928830000","48502602294460093086328676784013756242943275814776"}
{50}
Returns: 696733502
{"123", "45", "6", "7" }
{3 }
Returns: 401988
{"8800332964160399560609044402196314084887", "9053045551495163392312849327994102993511", "3345311124208796990426456872110451838707", "992027287611876624314871426908736731428", "3068367545836431984336004686311545983994", "7658192145126403867495499986736331557382", "5870951548364048322777365087711955370777", "5751203619304921706046606009480791420105", "3996341035187550029397442522239504737422", "7615625822645303356249291565122997251240", "4525454693249557231475627710778318297098", "5538753444050195433557346594496973097749", "1979251842436800144007303124014975476829", "194230463998683159891446079001117607241", "7241981754134478566048523659032472062156", "687373696051340601971116832090916716561", "8570079683247981436259762066742360395557", "4050349500261980277474383619704036486135", "1290451138166418235668659848503262073409", "8907405008897799151250410735402443144084", "9097463269290775659111492221759078444718", "7926031117710406498342001634246420992403", "2136070238579994571498251386800308785763", "3764773882064667836604893753767220692684", "1594822203835851528638517715673247085658", "7049159852080517202368987728877014860003", "2533218463512195260992044143434975855286", "4486932872267294143079372527819523920660", "5928104265601016351258966544316124703912", "890835734266848278527656961124735180915", "4157644963996362962057371070547400384698", "3634530487374512860244538288622739887443", "3030004053929944287882909235014948094703", "9430662601950660443915381364853704022926", "4384714450068381306880143699020704836572", "635668267660765829461768080060791147693", "9019819714040392648704244022763958079816", "2618393573609328112087963372771438952463", "8190965922545752921668249418550621248147", "7830006590799968638290802324325248084626", "5596360400082975751697806188950877184787", "3451041795416593477449248511538673458450", "888236405113264564005458640779443467404", "8572323998932467092731267269552153715041", "7231958991096211008507998901064572634111", "7396247895156416943031899634193030781014", "4476810500697064477774780076921487335705", "5820105158138164271943660435160596148769", "6668413977539756277872769486549398527689", "8294411752076804654840432550837554011788" }
{1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10 }
Returns: 50033015