/* Question: there are n telescopes placed on the X axis 1 ~ In the N position, there are m birds. The telescope can observe at any angle to see all the birds in that line, ask the sum of the numbers of birds seen by all telescopes to calculate ry + violence */# include <stdio. h> # include <string. h> int n, m; int num [1000010]; struct line // edge structure {__ int64 a, B, c ;}; struct point // point {__ int64 X, y;} niao [300]; line ppline (point P1, point P2) // calculates the line of the two points {Line L; L. A = p2.y-p1.y; L. B = p1.x-p2.x; L. C = p1.y * p2.x-p1.x * p2.y; return l;} int online (point P, line L) // determine whether the point is in a straight line {If (P. x * L. A + P. y * L. B + L. C = 0) return 1; return 0;} int xofline (I NT y, line L) // calculates the intersection with the X axis {If (L. A = 0) Return-1; if (L. C % L.! = 0) Return-1; double ret; ret =-(L. C * 1.0/L. a); If (Ret> 1000099 | RET <-100) Return-1; Return-L. c/L. a;} int main () {int I, J, K, RET; while (scanf ("% d", & N, & M )! = EOF) {memset (Num, 0, sizeof (Num); for (I = 1; I <= m; ++ I) scanf ("% d ", & niao [I]. x, & niao [I]. y); for (I = 1; I <= m; I ++) {for (j = I + 1; j <= m; j ++) // enumerate the straight lines with bird I and J {Line L = ppline (niao [I], niao [J]); int you = 2; for (k = J + 1; k <= m; ++ K) // judge whether the bird behind it is in this line {If (online (niao [K], L) You ++ ;} int x = xofline (0, L); If (x> = 1 & x <= N & num [x] <You) num [x] = You ;}} ret = 0; for (I = 1; I <= N; ++ I) if (Num [I]) RET + = num [I]; else RET + = 1; // The above is based on two points to determine a straight line, some telescopes can only see one bird printf ("% d \ n", RET);} return 0 ;}