포럼
문제 ICPC00298

I. Intertwined

설명

NCPC (Nordic Cargo Plane Control) are testing a new engine for their cargo planes. To this end they have bound a strong and sturdy infinitely thin rope to the centre of their testing platform, and to the engine. We will place a coordinate system onto this testing platform such that the rope is bound at the origin and lays along the positive \(x\)-axis to \((d, 0)\). On this testing platform there are also a number of infinitely thin pillars that can stop the rope, but ignore the engine. As the engine is started it starts rotating the rope counter-clockwise around the origin until it hits a pillar, at which point it is caught and starts rotating around that pillar counter-clockwise instead. The engine is then rotating at a smaller radius as some of the rope is caught between the origin and this pillar. This keeps going until the rope is too short to reach any other pillars.

Running these tests, buying all this infinitely thin rope and setting up these infinitely thin pillars, is expensive. Besides, the workers keep getting these nasty paper-like cuts from all these infinitely thin objects. It would be much more economical to just simulate the behaviour.

제약
입력 형식

The first line contains an integer \(n\), the number of pillars, and an integer \(d\), the length of the rope (\(1 \leq n \leq 10^5\), \(1 \leq d \leq 10^9\)).

The following \(n\) lines each contain two integers \(x_i\), \(y_i\), the coordinates of the \(i\)th pillar (\(-10^9 \leq x_i, y_i \leq 10^9\)) for \(i \in 1, 2, \ldots, n\). None of these pillars will lie on the rope.

출력 형식

Print one line with an integer \(i\), meaning that the rope will end up spinning around the \(i\)th pillar in the input. Note that this index is \(1\)-indexed. If the rope doesn't collide with any pillars \(i = -1\). It is guaranteed that changing the input \(d\) by at most \(\pm 10^{-6}\) will not change \(i\).

예제 1
입력
5 200
4 4
4 -4
3 1
-4 4
-4 -4
출력
1
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NCPC 2023

평가 및 의견

I. Intertwined

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

I. Intertwined

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8