My solutions to spoj.com problems