Algorithmic problems from SPOJ