DescriptionThelittlecatismajoringinphysicsinthecapitalofByterland.Apieceofsadnewscomestohimthesedays:hismotherisgettingill.Beingworriedaboutspendingsomuchonrailwaytickets(Byterlandissuchabigcountry,andhehastospend16shoursontraintohishometown),hedecidedonlytosendSMSwithhismother.Thelittlecatlivesinanunrichfamily,sohefrequentlycomestothemobileservicecenter,tocheckhowmuchmoneyhehasspentonS...
Annhasrecentlystartedcommutingbysubway.Weknowthataoneridesubwayticketcostsarubles.Besides,Annfoundoutthatshecanbuyaspecialticketformrides(shecanbuyitseveraltimes).Itcostsbrubles.Anndidthemath;shewillneedtousesubwayntimes.HelpAnn,tellherwhatistheminimumsumofmoneyshewillhavetospendtomakenrides?InputThesinglelinecontainsfourspace-separatedintegersn,m,a,b(1 ≤ n, m, a, b ≤ 1000)—the...
近期评论