Preparando MOJI

Intersection

1000ms 262144K

Description:

You are given two set of points. The first set is determined by the equation A1x + B1y + C1 = 0, and the second one is determined by the equation A2x + B2y + C2 = 0.

Write the program which finds the number of points in the intersection of two given sets.

Input:

The first line of the input contains three integer numbers A1, B1, C1 separated by space. The second line contains three integer numbers A2, B2, C2 separated by space. All the numbers are between -100 and 100, inclusive.

Output:

Print the number of points in the intersection or -1 if there are infinite number of points.

Sample Input:

1 1 0
2 2 0

Sample Output:

-1

Sample Input:

1 1 0
2 -2 0

Sample Output:

1

Informação

Codeforces

Provedor Codeforces

Código CF21B

Tags

implementationmath

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 08:27:11

Relacionados

Nada ainda