Spoj FISHER code - Dynamic Programming

Problem Link
http://www.spoj.com/problems/FISHER/