There are n numbers of business, different business will cost you different times. But you need not to finish all of them, just it is ok when you finish some of them that you spend more than T minutes(do not include T minutes).
So, can you find the way to cost the minimum time when pass T times?
The minimum time of you cost, if there is no answer, print '-1'.