{"raw_statement":[{"iden":"statement","content":"A point _belongs_ to a triangle if it lies inside the triangle or on one of its sides. Two triangles are _disjoint_ if there is no point on the plane that belongs to both triangles.\n\nYou are given $n$ points on the plane. No two points coincide and no three points are collinear.\n\nFind the number of different ways to choose two disjoint triangles with vertices in the given points. Two ways which differ only in order of triangles or in order of vertices inside triangles are considered equal."},{"iden":"input","content":"The first line of the input contains an integer $n$ ($6 \\le n \\le 2000$) – the number of points.\n\nEach of the next $n$ lines contains two integers $x_i$ and $y_i$ ($|x_i|, |y_i| \\le 10^9$) – the coordinates of a point.\n\nNo two points coincide and no three points are collinear."},{"iden":"output","content":"Print one integer – the number of ways to choose two disjoint triangles."},{"iden":"examples","content":"Input\n\n6\n1 1\n2 2\n4 6\n4 5\n7 2\n5 3\n\nOutput\n\n6\n\nInput\n\n7\n0 -1000000000\n-5 -5\n5 -5\n-5 0\n5 0\n-2 2\n2 2\n\nOutput\n\n21"},{"iden":"note","content":"In the first example there are six pairs of disjoint triangles, they are shown on the picture below.\n\n<center>![image](https://espresso.codeforces.com/52cd4121e68d9af086bf6dae99167b17720344bc.png)</center>All other pairs of triangles are not disjoint, for example the following pair:\n\n<center>![image](https://espresso.codeforces.com/2a0ebd7fb7f5c07f791dcf28da627bdf8406dab3.png)</center>"}],"translated_statement":[{"iden":"statement","content":"一个点属于一个三角形，当且仅当它位于三角形内部或其某条边上。两个三角形是互不相交的，当且仅当平面上不存在任何点同时属于这两个三角形。\n\n给定平面上的 $n$ 个点。任意两点不重合，且任意三点不共线。\n\n求有多少种不同的方式，从给定点中选出两个互不相交的三角形（三角形的顶点均来自这些点）。两种方式若仅在三角形的顺序或三角形内顶点的顺序上不同，则视为相同。\n\n输入的第一行包含一个整数 $n$（$6 lt.eq n lt.eq 2000$）——点的数量。\n\n接下来的 $n$ 行，每行包含两个整数 $x_i$ 和 $y_i$（$| x_i |, | y_i | lt.eq 10^9$）——一个点的坐标。\n\n任意两点不重合，且任意三点不共线。\n\n请输出一个整数——选出两个互不相交三角形的方法数。\n\n在第一个示例中，有六对互不相交的三角形，如下面的图所示。\n\n所有其他三角形对都不是互不相交的，例如以下这一对：\n\n"},{"iden":"input","content":"输入的第一行包含一个整数 $n$（$6 lt.eq n lt.eq 2000$）——点的数量。接下来的 $n$ 行，每行包含两个整数 $x_i$ 和 $y_i$（$| x_i |, | y_i | lt.eq 10^9$）——一个点的坐标。任意两点不重合，且任意三点不共线。"},{"iden":"output","content":"请输出一个整数——选出两个互不相交三角形的方法数。"},{"iden":"examples","content":"输入\n6\n1 1\n2 2\n4 6\n4 5\n7 2\n5 3\n输出\n6\n\n输入\n7\n0 -1000000000\n-5 -5\n5 -5\n-5 0\n5 0\n-2 2\n2 2\n输出\n21"},{"iden":"note","content":"在第一个示例中，有六对互不相交的三角形，如下面的图所示。所有其他三角形对都不是互不相交的，例如以下这一对：\n\n"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ P = \\{p_1, p_2, \\dots, p_n\\} $ be a set of $ n $ distinct points in $ \\mathbb{R}^2 $, with no three collinear.\n\nLet $ \\mathcal{T} $ denote the set of all triangles formed by choosing 3 distinct points from $ P $:  \n$$\n\\mathcal{T} = \\left\\{ \\{p_i, p_j, p_k\\} \\subseteq P \\mid i < j < k \\right\\}\n$$\n\nLet $ \\mathcal{D} \\subseteq \\mathcal{T} \\times \\mathcal{T} $ be the set of unordered pairs of distinct triangles $ (T_1, T_2) $ such that $ T_1 \\cap T_2 = \\emptyset $, where $ T_1 \\cap T_2 = \\emptyset $ means the two triangles are disjoint (no point in the plane belongs to both triangles, including boundaries).\n\n**Constraints**  \n1. $ 6 \\leq n \\leq 2000 $  \n2. All points in $ P $ are distinct.  \n3. No three points in $ P $ are collinear.\n\n**Objective**  \nCompute the number of unordered pairs $ \\{T_1, T_2\\} $ such that:  \n- $ T_1, T_2 \\in \\mathcal{T} $,  \n- $ T_1 \\ne T_2 $,  \n- $ T_1 \\cap T_2 = \\emptyset $ (the triangles are disjoint).  \n\nThat is, compute:  \n$$\n\\left| \\left\\{ \\{T_1, T_2\\} \\subseteq \\mathcal{T} \\mid T_1 \\ne T_2,\\ T_1 \\cap T_2 = \\emptyset \\right\\} \\right|\n$$","simple_statement":null,"has_page_source":false}