Logo
(追記) (追記ここまで)

9487번 - Cut the Cake 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
20 초 128 MB141342630.952%

문제

Given a circle, and a list of lines, how many parts has the circle been cut into? In the following example, four lines cut the circle into five parts.

입력

There will be several test cases in the input. Each test case will begin with four integers, r (1≤r≤1,000), x, y (-1,000≤x,y≤1,000), and n (0≤n≤1,000), where r is the radius of a circle, x and y are the coordinates of the center of the circle, and n is the number of lines. On each of the next n lines will be four integers, x1, y1, x2 and y2 (-1,000≤x1,y1,x2,y2≤1,000). These describe a line passing through (x1,y1) and (x2,y2). Note that we’re interested in the whole, infinite line, not just the segment between (x1,y1) and (x2,y2). In any test case, no more than two lines will intersect at any point inside the circle, no lines will be tangent to the circle, and no two lines will be coincident. The input will end with a line with four 0s.

출력

For each test case, output a single integer, indicating the number of parts that the circle is cut into. Output no spaces, and do not separate answers with blank lines.

제한

예제 입력 1

16 1 7 4
-15 -9 14 -11
-4 30 -3 -20
-20 12 -10 7
17 10 31 0
0 0 0 0

예제 출력 1

5

힌트

출처

ICPC > Regionals > North America > Southeast USA Regional > 2013 Southeast USA Regional Programming Contest > Division 2 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /