SPOJ more solutions