WPC4A
WPC4H
http://www.codechef.com/DBYZ2014/problems/IITI13