Solved SPOJ problems and other stuff