Yonsei University switched course registration to a mileage system. Each student puts 1 to 36 mileage points on every course they want, and once everyone has finished, each course admits applicants in decreasing order of the points they put, up to the capacity of the course.
Seongjun failed the last registration and took a leave of absence, so this time he broke into the school website. He can now see every point the other students have already put. Nobody registers after Seongjun puts his own points, and a tie goes to Seongjun.
Seongjun has m mileage points. Find the largest number of courses he can get into. He must put between 1 and 36 points on a course he applies to, and he puts nothing on a course he skips.