Forming a regular polygon
Practice
2.6 (19 votes)
Basic math
Algorithms
Math
Problem
62% Success 2531 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

You are given \(N\) line segments. Print the number of subsets of these lines that form a regular polygon. A polygon is regular if and only if all of the edges of it are of equal length.

Input format

  • The first line contains \(N\)
  • The second line contains N numbers denoting the length of the line segments.

Output format

Print the answer modulo \(10^9+7\).

Constraints
\(1 \le N \le 10^6\\ 1 \le Ai \le 10^8\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
926 votes
Tags:
Ad-HocMathematicsEasy
Points:20
441 votes
Tags:
CombinatoricsMathematicsOpenApprovedEasy
Points:20
27 votes
Tags:
Basic MathC++Math