Timus Online Judge 1002