Problem Solving SPOJ