
Youareanassistantdirectorinanewmusicalplay.Theplayconsistsofnmusicalparts,eachpartmustbeperformedbyexactlyoneactor.Afterthecastingthedirectorchosemactorswhocantakepartintheplay.Yourtaskistoassignthepartstoactors.However,thereareseverallimitations.First,eachactorhasacertainvoicerangeandtherearesomepartsthathecannotsing.Formally,therearetwointegersforeachactor,cianddi(ci ≤ di) —thepitcho...

PetyaandGenaloveplayingtabletennis.Asinglematchisplayedaccordingtothefollowingrules:amatchconsistsofmultiplesets,eachsetconsistsofmultipleserves.Eachserveiswonbyoneoftheplayers,thisplayerscoresonepoint.Assoonasoneoftheplayersscorestpoints,hewinstheset;thenthenextsetstartsandscoresofbothplayersarebeingsetto0.Assoonasoneoftheplayerswinsthetotalofssets,hewinsthematchandthematchisover.Heresandt...

Youaregivenann × mrectangulartableconsistingoflowercaseEnglishletters.Inoneoperationyoucancompletelyremoveonecolumnfromthetable.Theremainingpartsarecombinedforminganewtable.Forexample,afterremovingthesecondcolumnfromthetable[crayon-6911ae96b9098507171742/]weobtainthetable:[crayon-6911ae96b90a1085796596/]Atableiscalledgoodifitsrowsareorderedfromtoptobottomlexicographically,i.e.eachrowislex...
近期评论