Introduction - If you have any usage issues, please Google them yourself
Description
Now we are to complete the network classroom topics and struggle. Do you want to get a higher score , but finds himself a little low efficiency , so you write a program to calculate it:
Assuming a total of n topics, each topic i you need a unit of time to complete. While each topic i have a completion date and the corresponding fraction di pi. Here s completion date is after the start time should be di time units within ( including di) can not be accomplished late .
All questions simultaneously start the timer, if and only if its subject i is completed before the deadline , you can get pi score. Deadlines are set so you do not necessarily have all problems can all be completed on time . Reasonable arrangements to do so only the order of questions , for a limited period of time in order to get the highest score.
Q: In this condition, you can get the highest score is the number ?
Input
The first line of input the total num