Timus Online Judge 1014