Successful solution for Chef and Strange Matrix problem - http://www.codechef.com/MAY14/problems/CHEFBM