Problem K
Streets Behind
Your running club has some serious runners and some casual runners. You schedule several training runs with a mixture of serious runners and casual runners. Serious runners run at a faster pace than casual runners, and will leave them behind.
You want all the runners to become serious runners, so when
you schedule training runs, you carefully choose the number of
serious and casual runners who will participate. You know that
when there are
Compute the minimum number of training runs you need to convert all members of the club into serious runners.
Input
The first line of input contains a single integer
Each of the next
Output
Output
Sample Input 1 | Sample Output 1 |
---|---|
3 9 5 5 6 2 7 1 8 3 4 1 5 |
3 1 1 |