CF21B.Intersection

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given two set of points. The first set is determined by the equation A1x+B1y+C1=0A_{1}x+B_{1}y+C_{1}=0 , and the second one is determined by the equation A2x+B2y+C2=0A_{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 A1,B1,C1A_{1},B_{1},C_{1} separated by space. The second line contains three integer numbers A2,B2,C2A_{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
    
首页