Tanya friend gather celebrate birthday there n child celebration include TanyaThe celebration close end plan attraction gaming machine there m machine hall number 1 m each child list machine wants play Moreover machine know exact time want play for machine child play machine timeIt evening adult want home to speed process additionally rent second copy machine to rent second copy jth machine pay pj burle after rent machine use long wanthow long child play accord plan budget b burle rent additional machine there copy machine impossible rent machine typethe child interrupt game moment continue later if ith child wants play jth machine allow rent copy jth machine child play time jth machine time copy part the interruption change time perform integer moment time of course child can not play machine timeremember need save money save money expense child happiness need minimize late moment time child end game