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