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

문제

You have joined a project called 'Flying Projectile Coding', which attempts to create a smart machine learning AI that will throw darts at a slightly modified dart board. Before the live testing of this AI, you have decided to train it in a simulation, because that is way faster and cheaper.

In this project, you are tasked with assessing the AI's performance. Since it is still in the early stages of its development, you are only interested in whether it hit the board or not. Also, for now, you just assume that gravity is negligible, so darts fly in straight lines.

The board

입력

  • One line with an integer: $ 1 \leq n \leq 10^5 $: the number of darts that have been thrown.
  • Two lines with three floating-point numbers each: $ -10 \leq h_1, h_2, h_3 \leq 10 $ and $ -10 \leq v_1, v_2, v_3 \leq 10 $. The dart board is mounted at $ (0, 0, 0) $ and is shaped like an ellipse with perpendicular axes $ (h_1, h_2, h_3) $ and $ (v_1, v_2, v_3) $.
  • $ n $ lines with six floating-point numbers each: $ -100 \leq p_1, p_2, p_3 \leq 100 $ and $ -10 \leq d_1, d_2, d_3 \leq 10 $. This line indicates that a dart is thrown from position $ (p_1, p_2, p_3) $ in direction $ (d_1, d_2, d_3) $.

출력

The number of darts that hit the board.

예제 입력 1

3
2.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 2.0 2.0 1.0 4.0
0.0 0.0 -2.0 2.0 1.0 4.0
0.0 0.0 2.0 2.0 0.0 0.0

예제 출력 1

1

예제 입력 2

6
1.0 1.0 0.0
1.0 -1.0 1.0
0.0 0.0 1.0 0.0 0.0 -1.0
0.0 0.0 1.0 1.0 1.0 0.0
0.0 0.0 1.0 1.0 -1.0 1.0
1.0 -1.0 -1.0 -1.0 1.0 8.0
1.0 -1.0 -1.0 1.0 -1.0 8.0
-1.0 1.0 1.0 1.0 -1.0 -8.0

예제 출력 2

3