code to spoj problems