交点AI (CI翻译)
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$.
给定两个点集。第一个点集由方程 $*A*_{1}*x* + *B*_{1}*y* + *C*_{1} = 0$ 确定,第二个点集由方程 $*A*_{2}*x* + *B*_{2}*y* + *C*_{2} = 0$ 确定。AI (CI翻译)
Write the program which finds the number of points in the intersection of two given sets.
请编写程序,求两个给定点集交集中的点数。AI (CI翻译)
Input
输入格式
AI (CI翻译)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.
输入的第一行包含三个以空格分隔的整数 $*A*_{1}, *B*_{1}, *C*_{1}$。第二行包含三个以空格分隔的整数 $*A*_{2}, *B*_{2}, *C*_{2}$。所有数字均在 -100 到 100 之间(包括 -100 和 100)。AI (CI翻译)
Output
输出格式
AI (CI翻译)Print the number of points in the intersection or -1 if there are infinite number of points.
输出交集中的点数。如果交集包含无限多个点,则输出 -1。AI (CI翻译)
样例
1 1 0
2 2 0
-1
1 1 0
2 -2 0
1
题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。