Two new solutions to SPOJ problems