question
stringlengths
58
4.29k
label
class label
3 classes
you n friend want m picture exactly friend appear picture picture contain pair friend so n3 friend 3 different picture contain pair friendseach friend attractiveness level specify integer number ai ith friend you know attractiveness picture contain ith jth friend equal exclusiveor xor operation integer ai ajyou want picture way total sum attractiveness picture maximize you calculate value since result fit 32bit integer number print modulo 1000000007 1097
1graph
there program language program nonempty sequence sign digit Lets explain interpreter programming language work a program interpret movement instruction pointer IP consist part current character pointer CP Direction pointer dp point leave right Initially CP point leftmost character sequence dp point rightwe repeat follow step moment CP point outside sequence if CP point digit interpreter print digit CP move step accord direction dp after value print digit sequence decrease if print digit 0 decrease erase sequence length sequence decrease if CP point direction dp change leave right correspondingly then CP move step accord DP if new character CP point previous character erase sequence if moment CP go outside sequence execution terminatedits obvious program language terminate stepsWe sequence s1s2sn digit you answer q query each query give l r ask digit print run sequence slsl1sr independent program language
1graph
a sequence nonnegative integer a1a2an length n call wool sequence exist integer l r 1lrn in word wool sequence contain subsequence consecutive element xor equal 0the expression mean apply operation bitwise xor number x y the give operation exist modern programming language example language C Java mark Pascal xorIn problem ask compute number sequences n integer 0 2m1 wool sequence you print number modulo 1000000009 1099
2string
you ve get undirected tree s consist n nod your task build optimal Tdecomposition Lets define Tdecomposition followslet denote set node s v Lets consider undirected tree t nod nonempty subset v xi the tree t tdecomposition s follow condition hold union xi equal v edge ab tree s exist tree node t contain b node tree t xi xj contain node tree s node tree t lie path xi xj contain node so condition equivalent follow node tree t contain node tree s form connect subtree tree t there obviously distinct tree t Tdecompositions tree s for example tdecomposition tree consist single node equal set vLets define cardinality node xi number nod tree s contain node Lets choose node maximum cardinality t Lets assume cardinality equal w then weight Tdecomposition t value w the optimal Tdecomposition minimum weightyour task find optimal tdecomposition give tree s minimum number node
2string
let denote dn number divisor positive integer n you give integer b c your task calculate follow sumfind sum modulo 1073741824 230
1graph
Vasya go Olympics city Ntown train the boy want read textbook prepare Olympics he count need k hour he find light train change hour the light measure scale 0 100 0 dark 100 lightvasya train lighting schedule n hour trip n number 0 100 light level hour second hour during hour read time read he wants choose k hour read book necessarily consecutive minimum level light select hour maximum Vasya excite upcoming contest help choose read hour
1graph
John Doe crook fence consist n rectangular plank line leave right plank go ith 1 in leave right width 1 height hi we assume plank go ith 1 in left right index iA piece fence l r 1lrn sequence plank wood indice l r inclusive plank index ll1r the width piece fence l r value rl1two piece fence l1 r1 l2 r2 call matching follow condition hold piece intersect is not single plank occur piece fence piece width 0ir1l1 follow condition hold hl1ihl2ihl1hl2 John choose piece fence want know distinct matching piece two piece fence distinct plank belong belong
1graph
John Doe decide mathematical object name so invent Doe graph the Doe graph family undirecte graph characterize single nonnegative number order well denote graph order k Dk denote number vertex graph Dk Dk then let define Doe graph follow D0 consist single vertex number 1 d1 consist vertex number 1 2 connect edge Dn n2 obtain graph dn1 dn2 Dn1 dn2 join graph number vertices graph dn2 increase dn1 example vertex number 1 graph dn2 vertex number 1dn1 after edge add graph go vertex number dn1 dn11 second go vertex number dn11 1 note definition graph Dn imply Dn connect graph vertex number 1 Dn the picture show Doe graph order 1 2 3 4 leave right John think Doe graph great exist polynomial algorithm search hamiltonian path however task answer query find shortestlength path vertex ai bi graph DnA path pair vertice u v graph sequence vertex x1 x2 xk k1 x1u xkv ik vertex xi xi1 connect graph edge the length path x1 x2 xk number k1
1graph
you give table consist n row m column each cell table contain number 0 1 in choose row table cyclically shift value cell leave cell rightto cyclically shift table row cell right mean value cell right neighboring cell value cell cell a cyclical shift row leave perform similarly direction for example cyclically shift row 00110 cell right row 00011 shift row 00110 cell leave row 01100determine minimum number move need table column consist number 1
1graph
an expedition group fly planet ACM1 Earth order study bipedal specie representative do not antennas headsthe fly saucer brave pioneer set consist section these section connect chain 1st section adjacent 2nd 2nd 1st 3rd one 3rd 2nd the transition possible adjacent sectionsthe spacecraft team consist n alien each give rank integer 1 n the rank astronaut distinct the rule establish Saucer state alien section section b senior rank alien segment b segment b course require adjacent any alien require exactly 1 minute besides safety regulation require alien move minute shipAlien a senior rank alien b number indicate rank a corresponding number bat moment saucer team 3rd segment they need 1st segment one member crew alien identification number CFR140 decide calculate minimum time minute need perform taskhelp cfr140 figure minimum time minute astronaut need 3rd segment 1st since number large count modulo m
0array
you ve get rectangular parallelepipe integer edge length you know area face common vertex your task find sum length 12 edge parallelepipe
2string
recently secret mission Mars take place as result scientist manage obtain information Martian DNA now know Martian DNA contain m different nucleotide number 1 m special characteristic Martian DNA prevent nucleotide pair follow consecutively chain for example nucleotide 1 nucleotide 2 follow consecutively martian dna chain nucleotide 1 2 valid chain martian DNA chain nucleotide 2 1 valid chain corresponding restriction the number nucleotide pair can not follow dna chain consecutively k the need gene research require information quantity correct nlong chain Martian DNA your task write program calculate value
1graph
the Free Meteor Association FMA get problem meteor move Universal Cosmic Descriptive Humorous Program UCDHP need add special module analyze movement UCDHP store secret information meteor nm table integer cell the order meteor Universe change that s main ucdhp module receive follow query the query swap table row the query swap table column the query obtain secret number particular table cell as main ucdhp module critical writing functional working table commission
1graph
the Little Elephant enjoy recursive functionsthis time enjoy sort function let permutation integer 1 n inclusive ai denote ith element permutation the Little Elephants recursive function fx sort x permutation element work follow if x1 exit function Otherwise fx1 swapax1ax swap xth x1th element the little Elephants teacher believe function work correctly but thatbe F Little Elephant want performance function help find permutation number 1 n perform little Elephants function fn permutation sort ascending order
2string
the Little Elephant array consist n positive integer index 1 n Lets denote number index aiThe Little Elephant want count pair integer l r 1lrn sequence ba1a2 alarar1 k inversion an inversion sequence b pair element sequence b change relative order stable sort sequence in word inversion pair integer j 1ijb bibj b length sequence b bj jth elementhelp Little Elephant count number describe pair
1graph
the Little Elephant get problem somebody touch sorted nondecrease array length n possibly swap element arraythe Little Elephant do not want police understand accidentally change array he think accidentally change array array sort operation swap element necessarily adjacent that Little Elephant accidentally swap elementshelp Little Elephant determine accidentally change array sort nondecrease
1graph
a string call kstring represent k concatenated copy string for example stre aabaabaabaab time 1string 2string 4stre 3string 5string 6string obviously stre 1stringyou give string s consist lowercase English letter positive integer k your task reorder letter stre s way result string kstring
2string
Little Bolek find picture n mountain peak paint the n paint peak represent nonclosed polyline consist 2n segment the segment 2n1 point coordinate 1y1 2y2 2n1y2n1 ith segment connect point iyi point i1yi1 for 2i2n follow condition hold yi1yi yiyi1 we shall vertex polyline x coordinate mountain peak the figure leave show initial picture figure right show picture look like Boleks action the affected peak mark red k 2 Bolek fancy little mischief he choose exactly k mountain peak rub segment go peak increase peak height increase y coordinate corresponding point then paint miss segment new picture mountain peak let denote point new polyline pass Boleks new picture 1r1 2r2 2n1r2n1given bolek final picture restore initial
1graph
Fibonacci number sequence integer f00 f11 f21 f32 f43 f55 fnfn2fn1 so number sum previous twoBajtek develop nice way compute Fibonacci number blackboard first write 0 then write 1 then perform follow operation operation t replace number sum number operation b replace number sum number if perform n operation start t choose operation alternately sequence operation look like tbtbtbtb number write equal fn1unfortunately Bajtek make mistake repeat operation time row for example Bajtek want compute f7 want n6 operation TBTBTB if instead perform sequence operation TTTBBT 3 mistake incorrectly compute seventh Fibonacci number 10 the number mistake sequence operation number neighbour equal operation TT bbyou give number n operation Bajtek attempt compute fn1 number r result computation write number find minimum possible number mistake Bajtek possible sequence n operation result r number mistakesAssume Bajtek correctly start operation t
2string
you know Martians use number system base k Digit b 0bk consider lucky contact Martians Earthlings occur year b Martian chronologyA digital root dx number x number consist single digit result cascade sum digit number x word cascading mean sum give number consist digit sum digits digit numberFor example d35047d35047d157d157d6767 in sample calculation perform 7base notationif number digital root equal b Martians number luckyyou string s consist n digits kbase notation system your task find distinct substring give stre lucky number lead zero permit numbersnote substre si j string sa1a2 1ijn string aiai1 aj two substring si1 j1 si2 j2 string s different i1i2 j1j2
1graph
a new Berland businessman Vitaly go open household appliance store all he s get hire staffthe store work seven day week clock every day k people work storeBerland law determine order work day nonworke day Namely employee work exactly n consecutive day rest exactly m day work n day rest m Vitaly do not want break law Fortunately loophole law come force day employee hire for example employee hire day x work day xx1xn1 xmnxmn1xm2n1 Day x choose arbitrarily VitalyThere thing key store Berland law prohibit make copy key key Vitaly planning entrust key store employee at time day key employee work day day inside store during day key holder key employee work day the key handed hire employee work dayeach employee pay salary Therefore Vitaly want hire employee possible provide store operate normally day 1 infinity in word day index 1 infinity store k working employee work employee key storeHelp Vitaly determine minimum require number employee day hire
1graph
Vasyas bicycle chain drive consist part n star attach pedal axle m star attach rear wheel axle the chain help rotate rear wheel transmit pedal rotationWe know ith star pedal axle ai 0a1a2an teeth jth star rear wheel axle bj 0b1b2bm tooth any pair ij 1in1jm call gear set index star chain currently attach Gear ij gear ratio equal value since Vasya like integer wants find gear ij ratio integer on hand Vasya like fast drive integer gear ij wants choose gear maximum ratio help find number gearsin problem fraction denote division real number rounding perform
1graph
rubik keen number permutation a permutation length n sequence consist n different number 1 n element number 1 in permutation denote aiFurik decide present Rubik come new problem permutation Furik tell Rubik number permutation permutation length n permutation b length m Rubik answer problem distinct integer d exist sequence c c1a1dc2a2dcnand length n subsequence bsequence subsequence sequence b index i1i2 in 1i1i2inm a1bi1 a2bi2 anbin n length sequence m length sequence b you give permutation b help Rubik solve give problem
2string
Furik Rubik relay race the race set large square n meter the give square split nn cell represent unit squares cell numberAt beginning race Furik stand cell coordinate 11 Rubik stand cell coordinate nn Right start Furik run Rubik Furik stand cell coordinate ij cell i1j ij1 after Furik reach Rubik Rubik start run cell coordinate nn cell coordinate 11 if Rubik stand cell ij cell i1j ij1 neither Furik Rubik allow boundary field player go boundary disqualify to win race Furik Rubik earn point possible the number point sum number cell Furik Rubik visit each cell count sumprint maximum number point Furik Rubik earn relay race
2string
well string sabsasa1 sb 1abs substre string ss1s2 ss s length string sThe trace nonempty string t set character string consist for example trace string aab equal bLets consider arbitrary string s set substring trace equal c we denote number substring set maximal inclusion rcs substre sab length nba1 belong set call maximal inclusion substre sxy set length great n 1xabys two substring string s consider different equal locate different position sPolycarpus got challenge practical task stringology exam he follow give string s nonempty set character C1 C2 Cm find rCis set Ci Help Polycarpus solve problem do not want expel university army
1graph
the Smart Beaver ABBYY come splendid problem ABBYY Cup participant this time Beaver invite contest participant check problem sort document subject Lets describe problemYouve got train set document for document know subject the subject problem integer 1 3 each number physical meaning for instance document subject 3 tradeyou download training set document follow link httpdownload4abbyycoma2x2rz2zwxbg5vywal61h76zqmtrainzip the archive contain directory name 1 2 3 Directory name 1 contain document 1st subject directory 2 contain document 2nd subject directory 3 contain document 3rd subject each document correspond exactly file directoryall document follow format line contain document identifier second line contain document subsequent line contain text document the document identifier instal problem convenient useful information participantsYou need write program indicate subject give document it guarantee document give input program correspond subject train set
1graph
the Smart Beaver ABBYY come splendid problem ABBYY Cup participant this time Beaver invite contest participant check problem sort document subject Lets describe problemYouve got train set document for document know subject the subject problem integer 1 3 each number physical meaning for instance document subject 3 tradeyou download training set document follow link httpdownload4abbyycoma2x2rz2zwxbg5vywal61h76zqmtrainzip the archive contain directory name 1 2 3 Directory name 1 contain document 1st subject directory 2 contain document 2nd subject directory 3 contain document 3rd subject each document correspond exactly file directoryall document follow format line contain document identifier second line contain document subsequent line contain text document the document identifier instal problem convenient useful information participantsYou need write program indicate subject give document it guarantee document give input program correspond subject train set
1graph
the Smart Beaver ABBYY come splendid problem ABBYY Cup participant this time Beaver invite contest participant check problem sort document subject Lets describe problemYouve got train set document for document know subject the subject problem integer 1 3 each number physical meaning for instance document subject 3 tradeyou download training set document follow link httpdownload4abbyycoma2x2rz2zwxbg5vywal61h76zqmtrainzip the archive contain directory name 1 2 3 Directory name 1 contain document 1st subject directory 2 contain document 2nd subject directory 3 contain document 3rd subject each document correspond exactly file directoryall document follow format line contain document identifier second line contain document subsequent line contain text document the document identifier instal problem convenient useful information participantsYou need write program indicate subject give document it guarantee document give input program correspond subject train set
1graph
the Little Elephant love string he array n string consist lowercase english letter Lets number element array 1 n let denote element number ai for string ai 1 in Little Elephant want find number pair integer l r 1lrai substring ail r substre k string array include ith stringhelp Little Elephant solve problemif familiar basic notation string problem find corresponding definition note
1graph
once n people simultaneously sign reception recently open thoroughly bureaucratic organization abbreviate TBO as organization thoroughly bureaucratic accept cater exactly person day as consequence n people appointment n day person appointment dayHowever organization worker irresponsible job sign people tell exact date appointment the way know people come write request tbothe request form consist m line into line sign person write leave blank writing person form twice forbid request ignore TBO respond quickly write request reply format poor quality response contain correct appointment date people request form date completely random order Responds request arrive simultaneously end day response specifie request answersfortunately are not n lucky guy as observer follow task give n m determine minimum number request submit TBO clearly determine appointment date person
0array
any resemblance real championship sport accidentalThe Berland National team take local Football championship group stage Lets describe formal rule local championship team kick ball enemys goal area win game victory give 3 point team draw give 1 point defeat give 0 point group consist team team rank result games team play exactly team team place 1 2 group stage result stage championship in group stage team place define total number score point point high place if team number point follow criterion criterion list order fall priority start important difference total number score goal total number miss goal championship team high value get high place total number score goal championship team high value get high place lexicographical order team country country lexicographically small get high place the Berland team play group result 5 6 game know to exact game leave there Berand national team play team the coach ask find score XY x number goal Berland score Y number goal opponent score game fulfill follow condition X Y Berland go win game game Berland get 1st 2nd place group multiple variant choose score XY value XY minimum impossible come score choose score value y number goal Berland miss minimum
2string
you ve get nnn cube split unit cube your task number unit cube cube positive integer 1 n3 number cubes number exactly 1in3 unit cubes number i1 neighbouring share 1 in different subcube size iii unit cube number consecutive number that number x y unit cube subcube number number x x1 xi31 unit cube second subcube number number y y1 yi31 Find print require numeration unit cube cube
1graph
Qwerty Ranger take government job arrive planet Mars he stay secret lab conduct experiment bacteria funny abnormal property the job is not difficult salary highat begin experiment single bacterium test tube every second bacterium test tube divide k bacteria after abnormal effect create b bacteria test tube thus begin second test tube x bacteria end second kxb bacteriaThe experiment show n second exactly z bacteria experiment end pointfor second experiment Qwerty go sterilize test tube t bacteria he have not start experiment wonder second need grow z bacteria the ranger think bacteria divide rule experiment help Qwerty find minimum number second need tube z bacteria second experiment
1graph
pavel play famous computer game a player responsible country travel freely complete quest earn experiencethis country n city connect m bidirectional road different length possible city there portal k city at begin game portal close when player visit portal city portal open strange teleport open portal open the teleportation take time enable player travel quickly remote region countryat beginning game pavel city number 1 he want open portal quickly possible how time need
2string
in problem string find stre particular property the problem author reluctant waste time thinking string call good a string good do not palindrome substring long equal d you give string s consist lowercase english letter find good string t length s consist lowercase English letter lexicographically large s of string string t lexicographically minimumWe nonempty string sabsasa1 sb 1abs substre string ss1s2 ssa nonempty string ss1s2 sn call palindrome 1 n follow fulfill sisni1 in word palindrome read directionsstre xx1x2 xx lexicographically large string yy1y2 yy xy x1y1x2y2 xyyy exist number r rxry x1y1x2y2 xryr xr1yr1 Characters string compare like ascii code
1graph
an orient weight forest acyclic weight digraph vertex edge goesThe root vertex v orient weight forest vertex edge goes reach vertex v move edge weight orient forest we denote root vertex v rootvthe depth vertex v sum weight path pass vertex v root Lets denote depth vertex v depthvlet consider process construct weight direct forest Initially forest contain vertex vertex add sequentially Overall n perform operation add the ith i0 add operation describe set number kv1x1v2x2 vkxk mean add vertex number k edge graph edge vertex rootv1 vertex weight depthv1x1 edge vertex rootv2 vertex weight depthv2x2 if k0 vertex add graph add edgesYour task like give operation add vertex calculate sum weight edge forest result application define operation modulo 1000000007 1097
1graph
there square paint piece paper square equal n meter John Doe draw crosse square perimeter John paint cross lower left corner square then John move square perimeter clockwise direction upwards right downward leave every time walk n1 meter draw cross picture clarificationsJohn Doe stop lower left corner square crosse how crosse John draw the figure show order John draw crosse square 4 the low left square crosse Overall John paint 17 crosse
2string
John Doe list Fibonacci number modulo 1013 this list infinite start number 0 1 each number list apart sum previous modulo 1013 that Johns list Fibonacci number list replace number remainder divide 1013 John get interested number f 0f1013 wants find occurrence list give Help John find number occurence number f list state number f occur list the numeration Johns list start zero there 0th position number 0 1st position number 1 2nd position number 1 3rd position number 2 4th position number 3 thus beginning list look like 01123581321
1graph
you ve get nm sheet square paper some square paint Lets mark set paint square a Set A connected your task find minimum number square delete set a connectedA set paint square call connect square b set sequence square set begin end b sequence square share common square follow sequence an set set consist exactly square connect definition
2string
as know year funky number call triangular number integer representable k positive integer coolest number representable sum triangular numbersa wellknown hipster Andrew adore funky cool unfortunately is not good math give number n help define number represent sum triangular number necessarily different
1graph
Berland concerned privacy plan blueprint secret however spy neighboring state manage steal Bertown subway schemeThe Bertown Subway n station number 1 n m bidirectional tunnel connect all Bertown Subway consist line to precise type line circular radiala radial line sequence station v1vk k1 station vi vi1 ik connected tunnel station occur line vivj ijA loop line series station v1vk k2 station vi и vi1 connect tunnel in addition station v1 vk connected tunnel no station occur loop line oncenote single station pass number linesaccorde Berland standard can not tunnel station tunnel belong exactly line naturally line tunnel between station way subway tunnel in addition term graph theory subway vertex cactus consider subway graph station vertexe edge tunnel vertex lie simple cycleunfortunately scheme steal spy station tunnel it impossible determine line tunnel correspond but sabotage successfully spy need know minimum maximum number line Bertown subwayhelp
1graph
so Berland war eternal enemy Flatland Vasya accountant assign fulfil duty nation right situation Berland dismal city surround the army flatlander stand border circle circle center surround city at moment point flatland ring begin quickly direction city that s strategy flatlander usually follow besiege citiesThe berlander sure repel enemys attack learn exact time attack start for need construct radar register movement distance r thus install radar point point enemy ring detect range distance r then radar immediately inform enemys attack due new technology place radar point problem but problem berlander time radar besides large detection radius r radar coststhats Vasyas task task find minimum possible detection radius radar in word task find minimum radius r r0 radar radius r instal point register start movement flatland ring point in problem consider city material point attack enemy ring circle center city radar detection range disk include border center point radar place
1graph
Polycarpus ribbon length n he want cut ribbon way fulfil follow condition after cut ribbon piece length b c after cut number ribbon piece maximum Help Polycarpus find number ribbon piece require cutting
2string
sort array traditionally associate highlevel language how hard Roco Sort give array nondescending order
2string
hexagonal number figurate number calculate formula hn2n2n you give n calculate nth hexagonal number
1graph
as know Universe traditionally use threedimensional cartesian system coordinate in system point correspond real coordinate xyz in coordinate system distance center Universe point calculate follow formula Mushroom scientist work Great Mushroom King think Universe is not exactly right distance center Universe point equal xaybzcTo test metric mushroom scientist usual scientist offer task find xyz 0xyzxyzs distance center Universe point xyz maximum possible metric mushroom scientist the mushroom scientist are not good math commission tasknote problem consider 001
1graph
the Zoo Grid Kingdom represent infinite grid the Zoo n observation binocular locate ox axis for 1 n inclusive exist single binocular locate point coordinate i0 there m flamingos Zoo locate point positive coordinate the flamingo currently sleep assume do not movein order good view flamingos binocular independently rotate face angle necessarily integ then binocular observe flamingos locate straight line pass binocular angle set in word assign binocular direction correspond straight line pass binocular binocular able flamingo locate linetoday kid prestigious Codeforces kindergarten go Field Study Zoo their teacher like set binocular angle maximize number flamingo see binocular the teacher interested sum value binocular please help find sum
1graph
sensation sensation twodimensional kingdom the police catch highly dangerous outlaw member notorious Pihters gang the law department state outlaw drive gang headquarters car crash ice cream stall the stall car headquarters occupy exactly point twodimensional kingdomthe outlaws car equip GPS transmitter the transmitter show car exactly n movement way headquarters stall a movement car point xy point point x1y mark letter L point x1y r point xy1 d point xy1 uthe GPS transmitter inaccurate do not preserve exact sequence car movement instead keep record car possible movement each record string type UL UR DL DR ULDR each string mean car single movement corresponding character stre for example string UL mean car move U LYouve receive journal outlaw possible movement headquarters stall the journal record give chronological order give icecream stall locate point 00 task print number different point contain gang headquarters number different possible location car origin
1graph
the Smart Beaver ABBYY long history cooperate Institute Cytology Genetics Recently Institute staff challenge Beaver new problem the problem followsthere collection n protein necessarily distinct each protein string consist lowercase latin letter the problem scientist offer Beaver select subcollection size k initial collection protein representativity select subset protein maximum possibleThe Smart Beaver ABBYY research come conclusion representativity collection protein evaluate single number simply calculate Lets suppose collection a1ak consist k string describe protein the representativity collection follow value fxy length long common prefix string x y example fabc abd2 fab bcd0Thus representativity collection protein abc abd abe equal 6 representativity collection aaa ba ba equal 2having discover Smart Beaver ABBYY ask Cup contestant write program select give collection protein subcollection size k large possible value representativity help solve problem
1graph
in ABBYY wonderful Smart Beaver live this time begin study history when read Roman Empire interested life merchantsThe Roman Empire consist n city number 1 n it m bidirectional road number 1 m each road connect different city any city connect roadwe path city c1 c2 exist finite sequence city t1t2tp p1 t1c1 tpc2 1ip city ti ti1 connect road we know exist path city Roman EmpireIn Empire k merchant live number 1 k for merchant know pair number si li si number city merchant warehouse li number city shop the shop warehouse locate different city merchant deliver good warehouse shopLets road important merchant destruction threaten ruin merchant road path merchant warehouse shop Merchants Roman Empire greedy merchant pay tax 1 dinar road important in word merchant pay di dinar tax di di0 number road important ith merchantThe tax collection day come Empire the Smart Beaver ABBYY curious nature decide count dinar merchant pay day and need help
0array
Fibonacci string define follow f1 f2 b fn fn1fn2 n2 Thus Fibonacci string b ba bab babbayou give Fibonacci string m string si for string si find number time occur give Fibonacci string substre
2string
the Smart Beaver ABBYY invent new message encryption method want check performance check manually long tiresome decide ask ABBYY Cup contestant helpA message sequence n integer a1a2an encryption use key sequence m integer b1b2bm mn all number message key belong interval 0 c1 inclusive calculation perform modulo cEncryption perform nm1 step on step add number a1a2am correspond number b1b2bm on second step add number a2a3am1 change previous step correspond number b1b2bm and step number add number aiai1aim1 correspond number b1b2bm the result encryption sequence a1a2an nm1 stepsHelp Beaver write program encrypt message describe manner
1graph
the Smart Beaver ABBYY decide day but day turn boring decide play game pebble Initially Beaver n pebble he arrange equal row row b pebble a1 note Beaver use pebble e nab 10 pebble arrange row row 5 pebble once Smart Beaver arrange pebble take result row b pebble discard pebble then arrange pebble possibly choose value b take row the game continue point Beaver end exactly pebble the game process represent finite sequence integer c1ck c1n ci1 number pebble Beaver end ith number pebble row arrangement ci pebble 1ik Note cici1 ck1 the result game sum number ci you give n find maximum possible result game
1graph
the Smart Beaver ABBYY get hook square matrix now busy study nn size matrix n odd the Smart Beaver consider follow matrix element good Elements main diagonal element secondary diagonal Elements middle row row exactly row number row element middle column column exactly column leave number column right the figure show 55 matrix the good element mark green help Smart Beaver count sum good element give matrix
2string
this time help team researcher island Pacific Ocean they research culture ancient tribe inhabit island year agooverall they ve dig n village some pair village connect road People road direction overall exactly n1 road village onethe tribe peaceful war as result war village destroy completely during peaceful year village restoredat moment time people road belong short way village exist give moment in word people minimum subset road way possible exist village exist Note island history exist exactly n1 road find researcher there roadsthe researcher think observe total sum road length different moment time help well understand tribe culture answer historical questionsyou give history tribe existence your task determine total length road moment time
1graph
to money new aeonic blaster ranger Qwerty decide engage trade he want buy number item probably buy planet sell buy item planet note operation repeat buying selling to carry plan Qwerty go bank loan cover expense return loan money end operation money return interest at time Querty want profit possiblethe system n planet total on Qwerty buy sell item m type food medicine weapon alcohol for planet type item j Qwerty know follow aij cost buying item bij cost sell item cij number remain itemsIt allow buy cij item type j planet allow sell number item kindknowing hold Qwertys ship room k item determine maximum profit qwerty
1graph
Vasya play Plane Tanks friend year now time divide participant category depend result a player give nonnegative integer number point round Plane Tanks Vasya write result round year he n record totalIn order determine player category consider good result obtain player good result player the player belong category noob 50 player well result random result bad result 50 player 20 player well result average result worse result 80 player 10 player well result hardcore result worse result 90 player 1 player well result pro result bad result 99 player when percentage calculate player take account that mean player play game gain 100 point second 1000 point player result bad result 50 player second bad result 100 player haveVasya give year Plane Tanks result help Vasya determine player category
2string
Polycarpus amateur programmer now analyze friend program he find function rangeIncrementl r add 1 element array index segment lr in word function follow function rangeIncrementl r l r ai ai 1Polycarpus know state array series function call he wants determine minimum number function call lead state in addition wants find function call need case it guarantee require number call exceed 105before call function rangeIncrementl r array element equal zero
1graph
the trinitarian kingdom exactly n3k city all locate shore river Trissisipi flow kingdom some city locate river rest sidesome city connect bridge build each bridge connect city locate opposite side river between city exist bridgethe recently inaugurate King Tristan Third busy distribute deputy city in total k deputy king want commission control exactly city however deputy entrusted manage city connect bridge deputy set high fee travel bridge benefit pocket bad reputation kinghelp King Tristan Third distribute deputy city possible
2string
the Chamber Secrets open news spread Hogwarts student petrify see basilisk Dumbledore got fire Harry try enter Chamber Secrets these are not good news Lord Voldemort the problem do not want anybody able enter chamber the Dark Lord go busy suck life GinnyThe Chamber Secrets nm rectangular grid cell column a light ray basilisk gaze pass column change direction but spell column magic reflect light ray gaze direction receive ray this show figure the left light ray pass regular column right ray magic column the basilisk locate right low right cell grid look leave direction lower left cell accord legend meet basilisk gaze directly die immediately but meet basilisk gaze column person petrify we know door Chamber locate leave upper left corner grid wants enter look direction movement direction upper right cell position this figure illustrate sample test give dimension chamber location regular column Lord Voldemort ask find minimum number column need magic want enter chamber petrify declare impossible secure chamber
1graph
this problem imaginary language BHTML BCSS slightly resemble html css Read problem statement carefully resemblance slight problem use simplify analogsyou give bhtml document resemble html simple it record sequence open closing tag a tag look like tagname call opening tag tag look like tagname call closing tag besides selfclose tag write tagname problem fully equivalent tagnametagname all tagname problem string consist lowercase latin letter length 1 10 character tagname different tag coincidethe document tag form correct bracket sequence obtain sequence give follow operation remove selfclose tag tagname remove pair opening closing tag consecutively order name in word remove substre tagnametagname for example give document headerpabbpheaderfooterfooter give document ab aa ababobviously open tag matching closing pair call element a selfclose tag element Lets consider element nest inside tag element tag second an element nest for instance example element b nest header p is not nest footer is not nested b element header element nest footer zeroWe need bcss rule apply style display element bhtml document each rule record subsequence word x1 x2 xn this rule effect element t satisfy condition list sequence nest element tagname x1 x2 xn second element nest element nest second sequence end element t ie tagname element t equal xn for example element b meet condition rule b element b exist element nest Element c meet condition rule b b c element exist b b chain abbc follow element nest previous onegiven BHTML document set bcss rule write program determine number element meet condition rule
1graph
qd ucyhf yi q fhycu dkcruh mxeiu huluhiu yi q tyvvuhudj fhycu dkcruh oekh jqia yi je vydt jxu djx ucyhf
1graph
how cake you ll eatingredients 2 carrot 0 calorie 100 g chocolate spread 1 pack flour 1 egg Method Put calorie mix bowl take carrot refrigerator Chop carrot take chocolate spread refrigerator put chocolate spread mix bowl Combine pack flour mix bowl Fold chocolate spread mix bowl add chocolate spread mix bowl Put pack flour mix bowl add egg mix bowl Fold pack flour mix bowl Chop carrot chop Pour content mix bowl bake dish serve 1
2string
inputthe input contain integer a1a2 0ai109 separate single spaceOutputOutput single integerExamplesInput3 14output44input27 12output48input100 200output102
2string
in country live wizard they love build city roadsThe country k city jth city 1jk locate point xj yj it decide create nk city and ith kin create point coordinate xi yi xiaxi1bmod1099 yicyi1dmod1099 here b c d prime also acbdafter construction n city wizard notice surprising it turn different city j xixj yiyj holdsthe city build time build road it decide use difficult course powerful spell construction road use spell create road town u v yu yv city w lie strictly inside corner point u v city s lie corner locate xcoordinate strictly w u simultaneously ysyvA corner point p2x2 y2 p1x1 y1 y1y2 set point xy condition fulfil minx1x2xmaxx1x2 yy1 y1yy2 xx2x1x20 the picture show different corner in order test spell wizard apply city lie xcoordinate interval LR after construction road national government wants choose maximum number pair city connect road city occur pair your task m offer variant value L R calculate maximum number pair construction road please note city lie interval LR xcoordinate affect construction road way
1graph
a string binary consist character 0 1string v substre string w nonzero length read start position string w for example stre 010 substring 0 1 0 01 10 010 two substring consider different position occurrence different so string occur multiple time consider number time occursyou give binary string s your task find number substring contain exactly k character 1
1graph
one remarkable day company X receive k machine and simple machine mechanical programmer this unsuccessful step switch android programmer that s storythe company n task know start time execution si duration execution ti company profit completion ci any machine perform task exactly time if machine start perform task busy moment time si siti1 inclusive switch taskyou require select set task k machine bring maximum total profit
1graph
Polycarpus enjoy study Berland hieroglyph once Polycarp got hold ancient Berland picture draw circle hieroglyph we know hieroglyph occur twice second circle occur thempolycarpu want save picture laptop problem laptop allow write hieroglyphs circle so Polycarp break circle write hieroglyph clockwise order line a line obtain circle call line obtain second call bThere way break hieroglyphic circle Polycarpus choose method make length large substre string occur subsequence stre b maximumhelp Polycarpus find maximum possible length desire substre subsequence second circle break optimallythe length string s number character if denote length string s s write string ss1s2 ssa substre s nonempty string xsa bsasa1 sb 1abs for example code force substrings codeforce coder a subsequence s nonempty string ysp1p2 pysp1sp2 spy 1p1p2pys for example coder subsequence codeforce
1graph
you give positive integer n output prime factorizationif n a1b1 a2b2 akbk bi0 ak prime number output program look follow a1a1a2a2akak factor order nondecrease order factor ai print bi time
1graph
imagine twin brother sister have person look exactly like unusual its hard having alter ego good bad and twin know likeNow let imagine typical morning family you have not wake Mom go work she hasty nearly forget leave darling child money buy lunch school cafeteria she fish purse find number coin exact n coin arbitrary value a1a2an but Mom run time do not split coin so scribble note ask split money equallyAs wake find Moms coin read note but split money equally think after twin sleeping will not know so decide act like pick subset coin sum value coin strictly large sum value remain coin twin however correctly think coin twin suspect deception so you ve decide stick follow strategy avoid suspicion minimum number coin sum value strictly sum value remain coin on basis determine minimum number coin need divide describe manner
0array
the Berland University prepare celebrate 256th anniversary found A specially appoint Vice Rector celebration prepare decorate campus in center campus n ice sculpture erect the sculpture arrange circle equal distance form regular ngon they number clockwise order number 1 nThe site University conduct vote estimate sculpture characteristic ti degree sculpture attractiveness the value ti positive negative zeroWhen university rector come evaluate work say perfect arrangement he suggest melt sculpture remain sculpture form regular polygon number vertex 3 n sum ti value remain sculpture maximize help Vice Rector analyze criticism find maximum value ti sum obtain way it allow melt sculpture the sculpture move
2string
Mrs Hudson have not famous pancake finally decide she learn m new recipe recently can not wait try those recipe base n special spice Mrs Hudson spice kitchen lie jar number integer 0 n1 spice lie individual jar each jar price correspond spice inscribe integer aiWe know value ith pancake recipe di si ci here di ci integer si pattern integer write numeral system radix di the pattern contain digit latin letter denote digit large question mark Number x dibase numeral system match pattern si replace question mark pattern digit letter obtain number x lead zero are not take consideration perform comparison more formally question mark replace exactly digit exactly letter if replace question mark number lead zeroes delete zero for example number 40a9875 11base numeral system match pattern 4987 number 4a9875 notTo pancake ith recipe Mrs Hudson jar number representation dibase numeral system match pattern si the control number recipe zi define sum number ci product price take jar More formally j number representation dibase numeral system match pattern siMrs Hudson is not interested control number minimum prime divisor your task recipe find minimum prime divisor number zi if divisor exceed 100 find print 1
1graph
as Sherlock Holmes investigate crime identify n suspect he know sure exactly committed crime to find detective line suspect number 1 n after ask which commit crime Suspect number answer the crime commit suspect number ai suspect number ai do not commit crime also suspect aiiSherlock Holmes understand sure exactly m answer truth answer lie now help understand suspect lie tell truth
1graph
Vasya adore sport programming he can not write program love watch contest progress Vasya favorite coder Vasya pay special attention himOne day Vasya decide collect result contest favorite coder participate track progress coolness for contest coder participate write single nonnegative number number point favorite coder earn contest Vasya write point contest order contest run naturally contest run simultaneouslyVasya consider coder performance contest amazing situation break well bad performance record first amazing contest coder earn strictly point earn past contest second amazing contest coder earn strictly point earn past contest a coder contest is not consider amazing now want count number amazing performance coder history participate contest but list earn point turn long Vasya can not code that s ask help
2string
the ship Earth settler land Mars the colonist manage build n necessary structure surface planet regard plane construction regard point but day scanner record suspicious activity outskirt colony it decide use protective force field generating system protect colony possible troublethe system work follow surface contain number generator field consider point the active range generator circle radius r center location generator boundary circle include range after system activate stretch protective force field surface area generator activity that protect intersection generator active rangesThe number generator available colonist limit system field generation consume lot energy More precisely energy consumption depend number generator directly proportional area protect field also necessary exist building locate protect areadetermine small possible area protect surface contain building
1graph
Sergey attend lesson nish language each lesson receive hometask this time task translate sentence nish language sentence nish language represent string consist lowercase Latin letter space punctuation marksSergey totally forget task half hour lesson hastily scribble but recollect lesson learn grammar Nish the spelling rule state Nish contain forbidden pair letter letter occur sentence also order letter do not matter example pair letter ab forbid occurrence substrings ab ba forbid also pair different letter letter occurs forbid pairNow Sergey want correct sentence do not contain forbidden pair letter stand however run time decide simply cross letter sentence what small number letter cross when letter cross remove letter leave right exist neighbor for example cross letter string aba string ba cross second letter aa
1graph
one day Vasya get hold sheet checker paper nm squares size our Vasya adore geometrical figure paint rectangle paper the rectangle side parallel coordinate axe length rectangle 3 square side paint grid line the side sheet paper edge then Vasya hatch square rectangle frameslet define rectangle frame set square inside rectangle share bordera little later Vasya find sheet paper exactly size could not guess sheet paper different so ask check sheet paper find contain paint frame themplease note frame paint Vasya arbitrarily intersect overlap completely coincidethe coordinate sheet paper introduce way X axis go x coordinate square number value 1 n Y axis go leave right y coordinate square number value 1 m
1graph
winter damn freeze cold Nvodsk that s group n friend prefer taxi order pizza girl the phone number city consist pair digit example 123456 each friend phonebook size si that s number phone number we know taxi number consist identical digit example 222222 number pizza delivery necessarily decrease sequence different digit example 987321 number girl numbersyou give friend phone book Calculate friend well interested thing maximal number phone number type if phone book person contain number time count twice that number take consideration number time occur phone book
2string
this winter you ve get idea the Nvodsk road system represent n junction connect n1 bidirectional road path junction the organizer event want choose place accommodate participant junction v place set contest junction u besides hand want participant walk city neighbourhood that s distance v u l on hand do not want participant freeze distance v u r besides street know beauty integer 0 109 your task choose path fit length limit large average beauty we shall define average beauty median sequence beauty road pathwe formally like let path length k let ai nondecrease sequence contain exactly k element each number occur exactly number time road beauty occur path we represent path median number ak2 assume indexation start zero x number х round near integerfor example a0512 median equal 5 a05712 median number 7it guarantee path suitable quantity road
1graph
I guess there s point remind Nvodsk winter are not exactly hot that increase popularity public transport dramatically the route bus 62 exactly n stop stop 1 go way stop n go the stop position straight line coordinate 0x1x2xn each day exactly m people use bus 62 for person know number stop get bus number stop get bus a ticket stop stop b ab cost xbxa ruble however conductor choose segment not to sell ticket we mean conductor choose C D С D sell ticket segment a C d b sell ticket the conductor passenger divide save money equally the conductor untaxed income interrupt inspection place bus drive segment route locate consecutive stop the inspector fine conductor c ruble passenger do not ticket route segmentyou know coordinate stop xi number stop ith passenger get ai bi aibi fine c pi probability inspection segment ith i1th stop the conductor ask help plan sell ticket maximize mathematical expectation profit
1graph
what joy Petyas parent go business trip year playful kid leave Petya get absolutely happy he jump bed throw pillow day long Today Petya open cupboard find scary note his parent leave duty water favourite flower year day morning afternoon evening Wait second think Petya he know fact fulfill parent task ith 1i12 month year flower grow ai centimeter do not water flower ith month flower will not grow month Petya know try parent will not believe watering flower grow strictly k centimeter help Petya choose minimum number month water flower give flower grow k centimeter
1graph
next princess call cast estimate glance groomthe princess intend choose worthy groom rich whenever sees groom rich previous one say measure oh whenever groom rich previous one add exclaim wow oh case at sight groom princess stay calm say nothingthe fortune groom describe integer 1 50000 you know day princess see n groom say oh exactly time exclaim wow exactly b time your task output sequence n integer t1t2tn ti describe fortune ith groom if sequence possible output if sequence exist satisfy requirement output single number 1
2string
one dragon two dragon three dragon princess count she trouble fall asleep get bored counting lamb nineHowever count dragon boring entertain good tonight imagine dragon steal fight every kth dragon got punch face fry pan every lth dragon got tail shut balcony door every mth dragon get paw trample sharp heel finally threaten nth dragon mom withdraw panicHow imaginary dragon suffer moral physical damage tonight princess count total d dragon
2string
petya love lucky number everybody know lucky number positive integer decimal record contain lucky digit 4 7 for example number 47 744 4 lucky 5 17 467 notPetya array n integer the number array number start 1 unfortunately petya misbehave parent do not allow play array lucky number it guarantee 1000 element array lucky number Petya need find number pair nonintersecte segment l1r1 l2r2 1l1r1l2r2n number integer there s lucky number occur simultaneously subarray al1r1 subarray al2r2 help petya count number pair
1graph
Greg Dwarf busy recently excavation Neverland Mountain however wellknown reason probably remember unusual dwarf stand sunlight Greg excavate night and morning crypt sun ray strike that s wants find short route excavation point crypt Greg recollect Codeforces participant successfully solve problem transport coffin crypt so miraculous way Greg appear bedroom ask help highly persuasive manner as usual do not feel like turn downafter think formalize task follow Neverland mountain regular shape end sharp peak represent cone base radius equal r height equal h the graveyard Greg busy excavate crypt represent point cone surface all you ve get find distance point cone surface the task complicated fact mountain base ground level mountain dig gnome wonder they ve look stuff Greg so consider short way pass surface cone base specific case point lie cone base sample testGreg satisfied problem solution represent length short path point find way pretty he give hour solve problem time tick
1graph
after Santa Claus assistant Elf deliver present wish come true return North Pole find covered snow both tired decide remove snow road connect hut the North Pole n hut connect m road one road direction the Elf offer split Santa Claus clear wide road Elf tread narrow road for road decide clear Santa Claus Elf to minimize effort decide clear road fulfill condition hut exist exactly simple path clear road Santa Claus Elf clear number road at point Santa Claus assistant Elf wonder road clear
1graph
Vasya participate ski race X axi the start point 0 finish L distance L meter start positive direction axis Vasya training hard run meter exactly secondbeside n takeoff ramp track ramp characterize number xi represent ramp coordinate di represent meter Vasya land go ramp ti represent flight time second pi number indicate meter Vasya gather speed ready fly ramp as Vasya gathers speed ski snow fly speed equal meter second Vasya allow direction X axis prohibit cross start line negative semiaxis Vasya choose takeoff ramp use order oblige ramp encounter specifically Vasya skip ramp it guarantee xidiL Vasya cross finish line flightVasya jump ramp positive direction x axi more formally ith ramp Vasya start gather speed point xipi jump point xi land point xidi he use ramp opposite directionyour task find minimum time Vasya spend cover distance
1graph
one day Natalia walk wood meet little mushroom gnome the gnome tell follow storyeverybody know mushroom gnome power lie magic mushroom grow native wood gnome there n tree m magic mushroom wood ith tree grow point straight line coordinate ai height hi jth mushroom grow point coordinate bj magical power zjBut day wild mushroommuncher swear enemy mushroom gnome unleash terrible storm home forest as result tree begin fall crush magic mushroom the supreme oracle mushroom gnome calculate advance probability tree fall leave right stand if tree coordinate x height h fall leave mushroom belong rightopen interval xhx destroy if tree fall right mushroom belong leftopen interval xxh destroy only mushroom hit single tree surviveknowing tree fall independently ie event mutually independent tree interfere tree fall arbitrary direction supreme oracle able quickly calculate expectation total power mushroom survive storm his calculation ultimately save mushroom gnome imminent deathNatalia good Olympiad programmer get interested story decided come way quickly calculate expectation sum survive mushroom power
1graph
little Petya like play little Masha recently receive game call ZeroOne gift mother Petya immediately offer Masha play game himbefore begin game card lain table line leave right each card contain digit 0 1 Players turn Masha move during player remove card table shift card close gap leave remove card for example somebodys card table form sequence 01010101 fourth card remove card number start 1 sequence look like 0100101 the game end exactly card leave table the digits card determine number binary notation significant bit locate leave Mashas aim minimize number Petyas aim maximize itan unpleasant accident occur game start the kid spill juice card digit card got blur each spoiled card 0 1 write consider possible variants initial arrangement digit juice spill for variant let find card leave end game assume Petya Masha play optimally an ordered pair digit write card call outcome your task find set outcomes variants initial digit arrangement
0array
HQ9 joke programming language onecharacter instruction h print Hello World Q print source code program 9 print lyric 99 bottle beer song increment value store internal accumulatorinstruction H Q casesensitive uppercase the character program instruction ignoredYou give program write HQ9 you figure execute program produce output
2string
how star sky a young programmer Polycarpus can not question head he take photo starry sky digital camera analyze result monochrome digital picture the picture represent rectangular matrix consist n line contain m character a character equal 1 correspond photo pixel white 0 blackPolycarpus think find star photo find white pixel surround sideneighbore pixel white 1 111 1 star photo Polycarpus what s cut rectangular area photo mom present this area contain k star the star intersect share white pixel photo the boy cut rectangular area border parallel side photo cut straight pixel bordersnow Polycarpus keep wonder way cut area photo meet condition give Help Polycarpus find number
1graph
there n boy m girl attend theatre club to set play the Big Bang Theory need choose group contain exactly t actor contain 4 boy girl how way choose group of course variant differ composition troupe consider differentperform calculation 64bit type long long СС int64 Delphi long Java
1graph
in gregorian calendar typical year consist 365 day 12 month the number day month 312831303130313130313031 if year index divisible 400 divisible 4 100 year leap year extra day second month typically 28 daysYou give index year index day year Find date day day month fall
2string
sort array traditionally associate highlevel language how hard Befunge Sort give array nondescending order
1graph
tribonacci number sequence number define follow t0t10 t21 titi1ti2ti3you give n calculate nth tribonacci number modulo 26
1graph
Anna Maria charge math club junior student when club gather student behave badly they ve bring lot shoe lace club got tie specifically stre tie student besides student tie lace connect student second second student oneto restore order Anna Maria follow First student Anna find student tie if student tie exactly student Anna reprimand Then Maria gather single group student reprimand she kick club this group student immediately leave club these student take lace tie then student Anna find student tie and Anna reprimand studentdetermine group student kick club
2string
Annas get birthday today she invite guest cook huge nearly infinite birthday cake decorate n banana circle different size Marias birthday start 7 minute Anna old decide play boss little she tell Maria cut cake k straightline cut cut line intersect divide banana circle banana piece Anna guest want banana piece that s tell Maria total number banana piece maximum its problem banana piece end cake piece key maximum number banana piece determine result Maria achieve
1graph
in task Anna Maria play game unpleasant rival Anna Maria opposite square chessboard 88 Anna upper right corner Maria lower leave Apart board statue each statue occupy exactly square a square contain statue statue Anna MariaAnna present board figurant stand move Maria actively involve game her goal come Annas square Maria statue turn Maria move during Maria adjacent diagonal cell statue stay cell the statue square simultaneously statue row fall board long appearedAt moment statue cell Maria statue declare winner at moment Maria come cell Anna wait Maria declare winnerobviously depend statue depend Maria Determine win Maria strategic error
2string
Mr Scrooge busy man decide count time waste sort useless stuff evaluate lose profit he count time waste sleep eat and Mr Scrooge want count time waste signing papersmr Scrooges signature represent polyline a1a2 an Scrooge sign like place pen point A1 draw segment point A1 point A2 draw segment point A2 point a3 point an stop sign take pen paper at result line intersect partially repeat Scrooge pay attention change sign style as Scrooge make signature take pen paper write speed constant 50 millimeter secondScrooge sign exactly k paper life signature look samefind total time Scrooge waste signing paper
1graph
Fibonacci number follow formf11 F22 FiFi1Fi2i2Lets consider nonempty set Ss1s2sk consist different Fibonacci number let find sum value set elementslets set s number n decomposition Fibonacci sum its easy number decomposition Fibonacci sum for example 13 1358238 decomposition 16 31312133581258 decompositionsby give number n determine number possible different decomposition Fibonacci sum
1graph