solutions to spoj problems in various programming languages