{"problem":{"name":"I. Riana and the Illuminous Triangles","description":{"content":"Riana always wanted to join the secret order of the _*ProgVar*_. Most people doubt its existence, believing it to be just a myth propagated by paranoid conspiracy theorists. However, some, including R","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10255I"},"statements":[{"statement_type":"Markdown","content":"Riana always wanted to join the secret order of the _*ProgVar*_. Most people doubt its existence, believing it to be just a myth propagated by paranoid conspiracy theorists. However, some, including Riana, know the truth: _*ProgVar*_ is an immensely influential organization working behind the scenes to control the world at large.\n\nThe all-knowing _*ProgVar*_, of course, is aware of her intent. One day, she received an initiation parchment. The parchment contains a geometric graph of $n$ points, no three of which are collinear. Riana knows that _*ProgVar*_ is obsessed with triangles, and that she may form a triangle from any three of the $n$ points.\n\nTo demonstrate her commitment to joining the order, she must count how many ways there are of forming two triangles such that one triangle lies entirely within the other. In particular, these two triangles must not share a vertex. Two ways of forming triangles are considered distinct if there is a point that is used as a triangle vertex in one way but not in the other way.\n\nRiana, of course, is a capable follower, and she sent her answers to the order in less than two seconds. _*ProgVar*_, busy with more important world affairs, has outsourced the task of checking her answers to you. How many such ways of forming two triangles are there?\n\nThe first line contains the number of points $n <= 300$.\n\nThe next $n$ lines each contains two integers $x$ and $y$, where the $i$th line denotes that the $i$th point is $(x, y)$.\n\nThe absolute values of the coordinates of each point are guaranteed not to exceed $10^4$.\n\nPrint how many such ways there are of forming two triangles that satisfy the problem.\n\nNote that the answer may exceed $10^(10)$.\n\nIt may also be shown that there are no other pairs of triangles that satisfy the problem conditions. Therefore, the answer for the first test case is $4$.\n\n## Input\n\nThe first line contains the number of points $n <= 300$.The next $n$ lines each contains two integers $x$ and $y$, where the $i$th line denotes that the $i$th point is $(x, y)$.The absolute values of the coordinates of each point are guaranteed not to exceed $10^4$.\n\n## Output\n\nPrint how many such ways there are of forming two triangles that satisfy the problem.Note that the answer may exceed $10^(10)$.\n\n[samples]\n\n## Note\n\n   For the first test case, one may take the three outermost points to form the outer triangle. The four remaining points lie inside this triangle. One may choose three of these four points to form the inner triangle. There are four ways to make such a choice, giving four valid ways of forming two triangles.It may also be shown that there are no other pairs of triangles that satisfy the problem conditions. Therefore, the answer for the first test case is $4$.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $ with $ n \\leq 300 $.  \nLet $ P = \\{p_1, p_2, \\dots, p_n\\} $ be a set of $ n $ distinct points in $ \\mathbb{R}^2 $, no three collinear.\n\n**Constraints**  \nEach point $ p_i = (x_i, y_i) $ has coordinates satisfying $ |x_i|, |y_i| \\leq 10^4 $.\n\n**Objective**  \nCount the number of unordered pairs of disjoint triangles $ (T_1, T_2) $, where:  \n- $ T_1 $ and $ T_2 $ are triangles formed by three distinct points from $ P $,  \n- $ T_1 \\cap T_2 = \\emptyset $ (no shared vertices),  \n- One triangle lies entirely within the other (strictly contained, not overlapping or touching).\n\nThat is, compute:  \n$$\n\\left| \\left\\{ \\{T_1, T_2\\} \\,\\middle|\\, T_1, T_2 \\subset P,\\, |T_1| = |T_2| = 3,\\, T_1 \\cap T_2 = \\emptyset,\\, \\text{one is strictly inside the other} \\right\\} \\right|\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10255I","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}