My solutions to SPOJ