Solutions of SPOJ problems