luogu#P9423. [蓝桥杯 2023 国 B] 数三角
[蓝桥杯 2023 国 B] 数三角
Problem Description
Xiaoming places points on a 2D coordinate plane. He wants to choose a subset of three points that can form a triangle. However, there are too many such choices, so he decides to only count those that can form an isosceles triangle. Please help him compute how many different ways to choose three points can form an isosceles triangle.
Input Format
The input has lines.
The first line contains a positive integer .
The next lines each contain two integers , representing the coordinates of the -th point.
Output Format
Output one line containing one integer.
5
1 4
1 0
2 1
1 2
0 1
5
Hint
Sample Explanation
There are ways in total: , , , , .
Test Case Scale and Assumptions
- For of the testdata, it is guaranteed that .
- For of the testdata, it is guaranteed that , .
The 14th Lanqiao Cup Software Competition Finals, C/C++ University Group B, Problem E.
Translated by ChatGPT 5