https://www.spoj.com/problems/DIEHARD/