Solutions to problems on spoj.com