Solutions to the spoj challenge problems.