SPOJ 2 problems solved