存储斜率 为了避免精度误差 直接存储分子和分母
for(int i = 1 ; i <= n ; i ++)
{
int xa, ya, xb, yb;
scanf("%d %d %d %d", &xa, &ya, &xb, &yb);
int dx = xa - xb;
int dy = ya - yb;
if(dx == 0)
dy = 1;
else if(dy == 0)
dx = 1;
else //第一个放正值
{
if(dx < 0)
dx = -dx, dy = -dy;
int t = gcd(abs(dx), abs(dy));
dx /= t, dy /= t;
}
mp[{dx, dy}] ++;
}