Doesn't pass SPOJs test case. Not sure where it would break :(
Merge branch 'master' of github.com:aflag/spoj