Orthogonal Pairs
Practice
4.5 (8 votes)
Mathematics
Easy Medium
Mathematics
Mathamatics
Problem
27% Success 1144 Attempts 30 Points 2s Time Limit 256MB Memory 1024 KB Max Code
You are given a 2D plane containing \(N\) distinct integral points in the form of \((X,Y)\). Now a line segment is drawn between each pair of points. Your task is to determine the number of unordered pairs of these line segments that are orthogonal to each other.
Input format
- First line: \(N\)
- Next \(N\) lines: Two space-separated integers \(X\) and \(Y\) denoting a point on the plane
Output format
Print a single integer that represents the number of quadruples as described in the problem statement
Constraints
\(1 \le N \le 2*10^3\)
\(-2*10^3 \le X,Y \le 2*10^3\)
Subtasks
- For 20 points: \(1 \le N \le 100\)
- For 80 points: Implement the original constraints
Submissions
Please login to view your submissions
Similar Problems
No similar problems found
Editorial