题库练习 Intersection
← 上一题 下一题 →

A7846 | Intersection

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

You are given two set of points. The first set is determined by the equation $A_{1}x+B_{1}y+C_{1}=0$ , and the second one is determined by the equation $A_{2}x+B_{2}y+C_{2}=0$ .

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

输入格式

The first line of the input contains three integer numbers $A_{1},B_{1},C_{1}$ separated by space. The second line contains three integer numbers $A_{2},B_{2},C_{2}$ separated by space. All the numbers are between -100 and 100, inclusive.

输出格式

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

输入输出样例

输入 #1
1 1 0
2 2 0
输出 #1
-1
输入 #2
1 1 0
2 -2 0
输出 #2
1
C++ 编辑器
输入
输出