Darts
InterviewTime limit1sMemory limit2048 MB
Given n darts as rays in 3D, count how many hit the elliptical board centered at the origin with axes h and v.
Problem
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 much 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 only care whether a dart hits the board. For now, assume that gravity is negligible, so darts fly in straight lines.

The board
Input
The first line contains an integer (), the number of darts thrown.
The next two lines each contain three floating-point numbers. The first line is and the second line is , with and . The dart board is mounted at and is shaped like an ellipse with perpendicular axes and .
The next lines each contain six floating-point numbers , with and . Each line describes a dart thrown from position in direction .
Output
Print the number of darts that hit the board.