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

18930번 - Lands of Infinistan 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB142250.000%

문제

The country of Infinistan can be represented as an infinite plane. In the country there are $n$ straight walls and a river which has the form of a quadratic curve (an ellipse, a parabola or a hyperbola). The walls and the river divide the country into some lands of non-zero area. Your task is, given all the equations, to count the number of those lands.

입력

The first line contains a single integer $n$ --- the number of straight walls (1ドル \le n \le 20$).

The second line contains six integers $q_0,ドル $q_1,ドル $q_2,ドル $q_3,ドル $q_4$ and $q_5$ --- coefficients of the river that is a quadratic curve $q_0\cdot x^2 + q_1 \cdot xy + q_2 \cdot y^2 + q_3 \cdot x + q_4 \cdot y + q_5 = 0$.

Each of the following $n$ lines contains three integers $a_i,ドル $b_i$ and $c_i$ --- coefficients of the straight line $a_i \cdot x + b_i \cdot y + c_i = 0$.

All $q_i,ドル $a_i,ドル $b_i$ and $c_i$ do not exceed 100 by absolute value. The straight lines may coincide. You may assume that the quadratic curve is not degenerate, and that for any $i$ either $a_i \ne 0$ or $b_i \ne 0$.

출력

Print one integer --- the number of lands.

제한

예제 입력 1

1
1 0 1 0 0 -1
1 -1 0

예제 출력 1

4

예제 입력 2

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

예제 출력 2

7

예제 입력 3

2
1 0 -1 0 0 -1
3 0 6
-5 0 -10

예제 출력 3

6

힌트

출처

Camp > Bytedance-Moscow Workshops Camp > Bytedance-Moscow Workshops Camp 2020 > Contest 1 L번

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

출처

대학교 대회

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

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