#include #include #include #include using namespace std; const double pi = 4 * atan(1.0); struct Point { double x, y; Point(){x = 0; y = 0;} Point(double xx, double yy){x = xx; y = yy;} }; bool mp[10][10]; Point a[25]; typedef Point Vector; Vector operator + (Vector A,Vector B) { return Vector(A.x+B.x,A.y+B.y); } Vector operator - (Point A,Point B) { return Vector(A.x-B.x,A.y-B.y); } Vector Rotate(Vector a, double rad) { return Vector(a.x*cos(rad)-a.y*sin(rad),a.x*sin(rad)+a.y*cos(rad)); } bool Cunzai(Point A) { if (fabs(A.x - int(A.x + 1e-5)) < 1e-5 && fabs(A.y - int (A.y + 1e-5)) < 1e-5 && A.x + 1e-5 >= 0 && A.y + 1e-5 >=0 && A.x + 1e-5 < 10 && A.y + 1e-5 < 10 && mp[int(A.x+1e-5)][int(A.y+1e-5)]) return 1; return 0; } bool Pan3(int now, int next) { Vector k = Rotate(a[next] - a[now], pi / 3 * 2); Point c = a[next] + k; if (Cunzai(c)) return 1; return 0; } bool Pan4(int now, int next) { Vector k1, k2; Point c1, c2; k1 = Rotate(a[next] - a[now], pi / 2); k2 = Rotate(k1, pi / 2); c1 = a[next] + k1; c2 = c1 + k2; if (Cunzai(c1) && Cunzai(c2)) return 1; return 0; } bool Pan5(int now, int next) { Vector k1, k2, k3; Point c1, c2, c3; k1 = Rotate(a[next] - a[now], pi / 5 * 2); k2 = Rotate(k1, pi / 5 * 2); k3 = Rotate(k2, pi / 5 * 2); c1 = a[next] + k1; c2 = c1 + k2; c3 = c2 + k3; if (Cunzai(c1) && Cunzai(c2) && Cunzai(c3)) return 1; return 0; } bool Pan6(int now, int next) { Vector k1, k2, k3, k4; Point c1, c2, c3, c4; k1 = Rotate(a[next] - a[now], pi / 3); k2 = Rotate(k1, pi / 3); k3 = Rotate(k2, pi / 3); k4 = Rotate(k3, pi / 3); c1 = a[next] + k1; c2 = c1 + k2; c3 = c2 + k3; c4 = c3 + k4; if (Cunzai(c1) && Cunzai(c2) && Cunzai(c3) && Cunzai(c4)) return 1; return 0; } int main() { int n; while (scanf("%d", &n) != EOF) { memset(a, 0, sizeof(a)); memset(mp, 0, sizeof(mp)); for (int i = 0; i < n; i++) { scanf("%lf%lf", &a[i].x, &a[i].y); mp[int(a[i].x+1e-5)][int(a[i].y+1e-5)] = 1; } double ans = 0; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) { if (i == j) continue; if (Pan3(i, j)) ans += 1.0 / 3; if (Pan4(i, j)) ans += 1.0 / 4; if (Pan5(i, j)) ans += 1.0 / 5; if (Pan6(i, j)) ans += 1.0 / 6; } printf("%.0f\n", ans); } return 0; }