Number of cycles
Practice
3.5 (54 votes)
Basic programming
C++
Problem
91% Success 13480 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given an N-sided regular polygon. You have connected the center of the polygon with all the vertices, thus dividing the polygon into N equal parts.
Your task is to find the count of simple cycles that exist in the modified structure of the polygon.
Input format
- The first line contains an integer \(Q\) denoting the number of queries.
- The second line contains an integer \(N\) denoting the number of sides in the regular polygon.
Output format
Print the count of simple cycles corresponding to each query in a separate line.
Constraints
\(1 \le N \le 10^{9}\)
\(1 \le Q \le 10^5\)
Explanation
No Explanation Provided
Code Editor
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
Submissions
Please login to view your submissions
Similar Problems
1.War
Points:20
87 votes
Tags:
ApprovedBasic ProgrammingEasyOpen
Points:20
9 votes
Tags:
Basic ProgrammingBasics of ImplementationEasyImplementationJavaPythonQuick SortSorting
Points:20
29 votes
Tags:
ApprovedBasic ProgrammingEasyOpen
Editorial
Login to unlock the editorial
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