Food Supplies for the Expedition
InterviewTime limit1sMemory limit1024 MB
Pick the largest set of food types that can be fully eaten by their deadlines when c members eat c portions per day.
Statement
Scientists are planning food supplies for an expedition to Mars. The supply has types of food, numbered from 1 to . Type has portions, and it must be eaten within days after the expedition starts. Any portions of type left after days are discarded.
The expedition has members. Each day, the members choose any portions they have and eat them. Members may eat the same types or different types.
The planning department wants to know how much spare food the plan has. Find the maximum number of food types that can be completely eaten during the expedition, with no portion of any type discarded.
Input
The first line contains two integers and (, ). Each of the next lines contains two integers and (, ).
Output
First print the integer (), the maximum number of food types that can be completely eaten. On the next line, print distinct integers (), the type numbers. If several sets of maximum size work, print any of them. The types may be printed in any order.