NZEC solution for Garden Game problem - http://www.codechef.com/JULY14/problems/SGARDEN