http://www.spoj.com/problems/SPCU/