spoj.org problems solved in Haskell