solutions for SPOJ (Sphere Online Judge) problmes