(是的这屑题我懒得优化了
#include <bits/stdc++.h>
using namespace std;
int n, yw[1002], sx[1002], yy[1002], i, sum[1002], cnt = 0;
int chu(int a){
if (a % 2 == 0) return a/2;
else return a/2+1;
}
int main(){
scanf("%d", &n);
for (i = 1; i <= n; i++){
scanf("%d %d %d", &yw[i], &sx[i], &yy[i]);
sum[i] = yw[i] + sx[i] + yy[i];
}
for (i = 1; i <= n; i++){
for (int j = 2; j <= n; j++){
if (i != j){
if ((abs(sum[i] - sum[j]) <= 10 && abs(yw[i] - yw[j]) <= 5) && (abs(yy[i] - yy[j]) <= 5 && abs(sx[i] - sx[j]) <= 5)) cnt++;
}
}
}
printf("%d\n", chu(cnt));
return 0;
}