# Preparations for the linear algebra

Автор задачи: Неизвестен

Первоисточник: Курс аналитической геометрии

URL первоисточника: Тогда еще и инета-то не было...

Задачу добавил: bright

Успешно сдано решений: 3

...

The examination on the line - priceless.

There are things that can not be bought.

For everything else there is MasterCard.

The examination on the line - priceless.

There are things that can not be bought.

For everything else there is MasterCard.

Most recently, in secret underground laboratories SSAU (1 in 5 floor building, if someone does not know) has completed a project to create a mathematical robot. Alexander (so the robot is called) has a remarkable ability to determine the mathematical properties of any object entering the scope of its scanner. For example, if scaner zasechet any line, robot instantly give the equation of the line.

Failure student at the 1 st course SSAU Igor Kuznetsov, to pass the exam on linear algebra, kidnapped Alexander, thought he would be able to easily identify any type of curve, which draw him to the teacher. But all was not well and it's easy, because, as you know, the exam required to know the name of the curve and its canonical equation. Therefore, Igor asked you to help him.

Of course linear algebra, we all know that there are 8 types of curves of the second order. They are:

1. Ellipse (canonical equation x

^{2}/a

^{2}+ y

^{2}/b

^{2}= 1)

2. Hyperbole (x

^{2}/a

^{2}- y

^{2}/b

^{2}= 1)

3. Parabola (y

^{2}= 2px)

4. A pair of parallel direct (y

^{2}- a

^{2}= 0)

5. A pair of intersecting direct (y

^{2}- k

^{2}x

^{2}= 0)

6. Direct (y

^{2}= 0)

7. Point (x

^{2}+ y

^{2}= 0)

8. Empty lot (x

^{2}+ y

^{2}+ 1 = 0 and x

^{2}+ 1 = 0)

Alexander, the processing directly, gives a general equation of the form Ax

^{2}+ Bxy + Cy

^{2}+ Dx + Ey + F = 0. Now you have to bring this equation to the canonical form and give an answer.

So, at the entrance you expect:

The first line - an integer N (1 <= N <= 10

^{8})

and further, every new line of coefficients A, B, C, D, E, F (-32768 <= A, B, C, D, E, F <= 32767) in the overall equation, the curve of the second order.

At the exit you want in the i-th row to write a kind of curve, given i-s equation. Output 1, if ellipse, 2, if the hyperbole, etc. (numbering above).

Sample input file # 1:

1

1 0 1 0 0 -1

Example output file # 1:

1

Sample input file # 2:

4

1 0 -1 0 0 -1

1 -2 1 0 0 1

1 0 0 0 0 0

-1 0 0 0 1 0

Example output file # 2:

2

8

6

3

Translated by translate.google.ru :))))))