#abc248e. E - K-colinear Line
E - K-colinear Line
Score : points
问题描述
你被给定坐标平面上的 个点。对于每个 ,第 个点位于坐标 。
找出通过这 个点中至少 个点的直线的数量。
如果存在无限多条这样的直线,请输出 Infinity
。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given points in the coordinate plane. For each , the -th point is at the coordinates .
Find the number of lines in the plane that pass or more of the points.
If there are infinitely many such lines, print Infinity
.
Constraints
- or , if .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of lines in the plane that pass or more of the points, or Infinity
if there are infinitely many such lines.
Sample Input 1
5 2
0 0
1 0
0 1
-1 0
0 -1
Sample Output 1
6
The six lines , , , and satisfy the requirement.
For example, passes the first, third, and fifth points.
Thus, should be printed.
Sample Input 2
1 1
0 0
Sample Output 2
Infinity
Infinitely many lines pass the origin.
Thus, Infinity
should be printed.
update @ 2024/3/10 10:37:12