Practice problems from SPOJ