HDOJ1003 solved