My SPOJ problems solutions