Adding solution for test (spoj).