Solutions to the SPOJ Classical Problem Set