There are N stations on a railway track. You are at the first station and you want to go to the final railway station. You can either go directly or take breaks in between.
Given the cost of travel for each pair of stations, find the minimum cost of travel.