#pragma comment(linker, "/STACK:1677721600") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF 0x3f3f3f3f #define inf (-((LL)1<<40)) #define root 1, 1, n #define middle ((L + R) >> 1) #define lson k<<1, L, (L + R)>>1 #define rson k<<1|1, ((L + R)>>1) + 1, R #define mem0(a) memset(a,0,sizeof(a)) #define mem1(a) memset(a,-1,sizeof(a)) #define mem(a, b) memset(a, b, sizeof(a)) #define FIN freopen("in.txt", "r", stdin) #define FOUT freopen("out.txt", "w", stdout) #define rep(i, a, b) for(int i = a; i <= b; i ++) #define dec(i, a, b) for(int i = a; i >= b; i --) //typedef __int64 LL; typedef long long LL; typedef pair Pair; const int MAXN = 300000 + 10; const int MAXM = 1100000; const double eps = 1e-12; LL MOD = 1000000007; /****************************************计算几何头文件**************************************************/ struct Point{ double x,y; Point(double x=0, double y=0):x(x),y(y){} }; Point operator + (Point A, Point B) {return Point(A.x+B.x, A.y+B.y);} Point operator - (Point A, Point B) {return Point(A.x-B.x, A.y-B.y);} Point operator * (Point A, double p) {return Point(A.x*p, A.y*p); } Point operator / (Point A, double p) {return Point(A.x/p, A.y/p); } int dcmp(double x) { if(fabs(x) < eps) return 0; else return x < 0 ? -1 : 1; } bool operator == (const Point &A, const Point &B) { return dcmp(A.x-B.x) == 0 && dcmp(A.y-B.y) == 0; } double Dot(Point A, Point B) { return A.x*B.x + A.y*B.y;} //点积 double Length(Point A) { return sqrt(Dot(A,A));} //向量长度 double Angle(Point A, Point B) {return acos(Dot(A,B) / Length(A) / Length(B));}//向量夹角 double cross(Point A, Point B) {return A.x*B.y - A.y*B.x;} bool isPointOnSegent(Point p, Point s, Point e)//判断点是否在线段se上 { if(p == s || p == e) return false; if( !dcmp(s.x - e.x) ) { return !dcmp(p.x - s.x) && ( (p.y - s.y) * (p.y - e.y) < 0 ); } double d = (p.x-s.x) * (e.x-p.x); double a = (p.y-s.y) / (p.x-s.x); double b = (e.y-p.y) / (e.x-p.x); if(dcmp(d)==1 && dcmp(a-b)==0)return true; return false; } /****************************************************************************************************/ Point p[30], q[10]; int n; bool Judge(Point a, Point b, Point c, Point d) { double l1 = Length(a - b), l2 = Length(b - c); double l3 = Length(c - d), l4 = Length(d - a); if( dcmp(l1 - l2) || dcmp(l2 - l3) || dcmp(l3 - l4) ) return false; // rep (i, 1, n) { // if(isPointOnSegent(p[i], a, b) || isPointOnSegent(p[i], b, c) || isPointOnSegent(p[i], c, d) || isPointOnSegent(p[i], d, a)) // return false; // } return !dcmp(Dot(a - c, b - d)) && !dcmp(Dot(a - b, b - c)); } int main() { #ifndef ONLINE_JUDGE FIN;// FOUT; #endif while(~scanf("%d", &n)) { rep (i, 1, n) scanf("%lf %lf", &p[i].x, &p[i].y); int idx[4], ans = 0; rep (i, 1, n - 3) { q[0] = p[i]; rep (j, i + 1, n - 2) { q[1] = p[j]; rep (k, j + 1, n - 1) { q[2] = p[k]; rep (l, k + 1, n - 0) { q[3] = p[l]; rep (r, 0, 3) idx[r] = r; do{ if(Judge(q[idx[0]], q[idx[1]], q[idx[2]], q[idx[3]])) { ans ++; break; } } while(next_permutation(idx, idx + 4)); } } } } cout << ans << endl; } return 0; }