atcoder#ABC248E. [ABC248E] K-colinear Line
[ABC248E] K-colinear Line
Score : points
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.
5 2
0 0
1 0
0 1
-1 0
0 -1
6
The six lines , , , and satisfy the requirement. For example, passes the first, third, and fifth points.
Thus, should be printed.
1 1
0 0
Infinity
Infinitely many lines pass the origin.
Thus, Infinity
should be printed.