Solutions to various problems on www.spoj.com