Solution to Spoj problems which I have done.