跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F2714. Intersection

  • ID: 2720
  • 传统题
  • 2000ms
  • 256MiB
  • 尝试: 0
  • AC · 已通过: 0
  • 教学难度:提高
  • 上传者:
  • 模拟
  • 数学
  • 编程与模拟
  • 提高
  • 难度
  • 共享题库
  • Codeforces
  • 英文题面
  • 题目来源
  • 题面语言

Intersection

题目描述

B. Intersection
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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.

Examples
Input
1 1 0
2 2 0
Output
-1
Input
1 1 0
2 -2 0
Output
1

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 2380 题。保留原作者与原赛事署名。