http://www.codechef.com/FEB14/problems/SUBMIN
http://www.codechef.com/FEB14/problems/TWODOGS