Company: Winzo_30july
Difficulty: medium
PK's World Tour Problem Description PK: Aamir Khan sets out for a world tour to N countries. He has planned out an itinerary for the same. He strictly follows the itinerary and visits countries in the same order as per the input. There are 3 modes of transport - Plane, Ship and Helicopter. He never prefers to travel by the same mode of transport consecutively as its too boring and monotonous. But the cost C varies for each journey depending on the places and mode of transport. Minimize the Total World Tour Travel Cost satisfying given condition. Input: The first line has N - Number of Countries. The next N lines contain 3 numbers separated by space that represents the cost for the 3 modes of transport - Plane, Ship and Helicopter. Output: Print the Minimum Total world tour travel cost. Constraints 1 <= N <= 25 1 <= cost of travel <= 1000 Examples Example 1: Input: 3 14 15 16 14 15 16 14 15 16 Output: 43 Example 2: Input: 2 14 15 16 11 12 13 Output: 26