#include<bits/stdc++.h>
#define LL long long
#define INF INT64_MAX
#define MOD 998244353
#define ls rt << 1
#define rs rt << 1 | 1
using namespace std;
typedef pair<int,int>pa;
const int N = 100005;
pa a[N];
int cnt[N];
int main(){
int t, n, xa, ya, xb, yb;
scanf("%d", &t);
while(t--){
scanf("%d", &n);
for(int i = 1;i <= n;i++){
scanf("%d%d%d%d", &xa, &ya, &xb, &yb);
if(xa>xb) swap(xa, xb), swap(ya, yb);
int dx = xb-xa, dy = yb-ya;
if(dx==0) dy=1;
else if(dy==0) dx=1;
else{
int g = __gcd(dx, dy);
dx/=g, dy/=g;
}
a[i] = pa(dx, dy);
}
sort(a+1, a+1+n);
int pos=1;
for(int i = 1;i <= n;i=pos){
pos = i;
while(a[pos]==a[i] && pos<=n) pos++;
for(int j = 1;j <= pos-i;j++) cnt[j]++;
}
for(int i = 1, j = 1;i <= n;i++){
while(!cnt[j]) j++;
cnt[j]--;
printf("%d\n", i-j);
}
}
return 0;
}
hdu6976 Game on Plane 数组的巧妙应用
最新推荐文章于 2024-11-03 21:27:26 发布