测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A7846. Intersection

编程题 普及/提高-

题目描述

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
上一题 去做题 下一题