Solutions to spoj problems goes here.