The Wedding |
Felix and Leti are going to get married soon, everybody is preparing their gifts, but they have a big problem: the money, their budget is not very high. They would like to get a good restaurant, to "sleep" their first night in a nice hotel and to spend a marvellous honey-moon travelling around the world.
The best way to get the cheapest price is getting an all-included package, that is, we have to contract the travel, the restaurant and the hotel all together.
Is that possible?
We have to find the cheapest travel agency-restaurant-hotel combination.The problem is that not all the combinations are allowed.
Each test case has the following format:
For each test case the output should consist of a single line with the number of the travel agency (T), restaurant (R) and hotel (H), and the cheapest total price (P). This values should be output in the format: T R H:P
If there is not any combination, the output should be a line with the text: Don't get married!
If more than one possibility exists, you can output any of them.
2 2 2 12 0 0 1 1 1 34 0 0 3 1 1 21 1 0 2 1 0 2 2 2 12 0 0 1 0 0 34 0 0 3 0 0 21 0 0 2 0 0 5 5 6 970 0 1 1 1 0 856 0 0 0 0 0 1290 1 0 0 1 0 1361 0 0 1 0 0 82 0 0 0 0 1 1182 0 0 0 1 1 0 450 0 1 1 0 0 1 895 0 0 1 0 1 1 1865 0 1 0 0 1 1 183 1 1 1 1 1 0 252 1 1 1 0 1 1813 1 0 0 1 1 1429 0 0 1 0 0 1522 1 1 1 0 0 1762 0 0 1 0 1 1946 0 1 0 0 0
Don't get married! 1 1 1:6 4 1 3:2054