#P7553. [COCI 2020/2021 #6] Geometrija

[COCI 2020/2021 #6] Geometrija

Description

There are nn non-collinear points on a plane. If two line segments AB\overline{AB} and CD\overline{CD} have a common point other than A,B,C,DA, B, C, D, then they are said to “intersect”.

Let SS be the set of all line segments obtained by connecting every pair of the nn points. Find the number of segments that do not intersect any other segment in SS.

Input Format

The first line contains an integer nn.

The next nn lines each contain two integers xi,yix_i, y_i, representing the coordinates of the ii-th point.

Output Format

Output one integer on a single line, the number of segments that satisfy the requirement.

4
1 1
-1 1
-1 -1
1 -1
4
4
-1 -1
1 -1
0 1
0 0
6

Hint

Explanation for Sample 1

The segments that satisfy the requirement are shown in the figure:

Explanation for Sample 2

The segments that satisfy the requirement are shown in the figure:


Constraints

This problem uses bundled testdata.

Subtask Points Constraints
11 2020 3n403 \le n \le 40
22 3030 3n2003 \le n \le 200
33 6060 No additional constraints.

For 100%100\% of the testdata, 3n1033 \le n \le 10^3, 109xi,yi109-10^9 \le x_i, y_i \le 10^9.


Notes

The score of this problem follows the original COCI setting, with a full score of 110110.

Translated from COCI2020-2021 CONTEST #6 T4 Geometrija

Translated by ChatGPT 5