Spoj Problem Cross Country

Algorithm - DP (LCS - Longest Common Subsequence)
Problem Link
http://www.spoj.com/problems/CRSCNTRY/