Solutions to www.spoj.com/IPC05 added