Life, Earth and Everything http://www.spoj.com/problems/TEST/