Problem D
Event Planning

You have some constraints: The total cost of the trip must be within budget, of course. All participants must stay at the same hotel, to avoid last years catastrophe, where some members got lost in the city, never being seen again.
Input
The first line of input consists of four integers:
Output
Output the minimum cost of the stay for your group, or “stay home” if nothing can be found within the budget.
Sample Input 1 | Sample Output 1 |
---|---|
3 1000 2 3 200 0 2 2 300 27 3 20 |
900 |
Sample Input 2 | Sample Output 2 |
---|---|
5 2000 2 4 300 4 3 0 4 450 7 8 0 13 |
stay home |