시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
5 초 512 MB 231 83 53 43.089%

문제

피스키퍼 리볼버로 무장한 무법자 제시 맥크리는 자신만의 방식으로 정의를 실현한다.

그랬던 맥크리가 새로운 무기를 손에 넣었다. 새로운 무기는 멈추지 않는 총알으로 한번 발사되면 적을 뚫고 지나간다. 즉, 인공지능 상대들처럼 한 줄로 서서 달려오는 적들은 맥크리의 새로운 무기를 한번만 쏘면 죽게 된다.

새 무기로 신나게 적들을 쏴죽이던 맥크리는 총알이 두개밖에 남지 않았다는 사실을 깨닫고 절망하기 시작했다. 그런 가운데 구원의 목소리가 들려왔으니....

"아무도 내게서 숨진 못 해."

이제 맥크리는 적들의 위치를 안다. 남은 총알은 두 발, 먼저 구른 뒤에 적들을 향해 총을 한번 쏘고 다시 한 번 구른 뒤 마지막으로 한번 더 쏜다. 이 계획이 성공하면 맥크리는 모든 적을 섬멸할 수 있다. 이 작전은 과연 성공할 수 있을까?

맥크리는 구르는 속도가 아주 빨라서 순식간에 어디로든 굴러갈 수 있다.

입력

첫 번째 줄에는 적의 수 N이 입력된다. (1 ≤ N ≤ 100,000)

이어서 입력되는 N개의 줄에는 두개의 정수 Xi  Yi 가 입력된다. i번째 적의 위치 좌표는 (Xi, Yi)이다. (−109 ≤ Xi, Yi ≤ 109) 단, 같은 위치에 두 명의 적이 있을수는 없다.

작전 지역은 평지이므로 높이는 신경쓰지 않아도 된다.

출력

맥크리는 총알 두발로 적들을 없애려 한다. 이 계획의 성공 여부를 출력하라.

성공할 시 "success"를 실패할 경우 "failure"를 출력하면 된다.

예제 입력 1

6
-1 0
0 0
1 0
-1 1
0 2
1 1

예제 출력 1

failure

예제 입력 2

6
1 1
3 5
0 -1
1 0
5 0
0 0

예제 출력 2

success
W3sicHJvYmxlbV9pZCI6IjEzMzUyIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjMTFkXHVjNTkxXHVjNzc0IFx1YzljNFx1YjJlNC4uLiIsImRl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APC 2016 Preliminaries J번