I have a problem with a puzzle on spoj. it's not connected to any of the Chilli series but I thought this place is the best way to go.

It's only on polish spoj so I'll introduce the problem: In first line you're given 2 integers - total distance to overcome and number(N) of hotels on the way. In the next N lines you've got 2 integers each line - distance from the beggining and cost of the hotel. You can't drive more than 800km without spending night at hotel. The goal is to print the smallest amount of money that can be spent to overcome total distance. Distances are given in ascending order, total distance is lower than 16000 and hotels count as well as cost of a hotel is lower than 1000.

You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum