Cutting a material
Practice
3.9 (170 votes)
Basic math
Algorithms
Math
Problem
92% Success 15173 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given a disk-shaped or circular material. Determine the maximum number of pieces in which the material can be cut into by using exactly \(N\) straight cuts.
You must perform the task for \(T\) tasks separately.
Input format
- The first line contains \(T\) denoting the number of test cases.
- Next \(T\) lines contain a single integer \(N\).
Output format
Print \(T\) separate lines each containing answer for each test case.
Note: Use a 64-bit variable to store and read all the variables.
Constraints
\(1 \le T \le 10^5\\ 0 \le N \le 10^8\)
Submissions
Please login to view your submissions
Similar Problems
Points:20
1 votes
2.Divisors
Points:20
10 votes
Tags:
OpenAlgorithmsApprovedEasyMathamatics
Points:20
Tags:
EasySimple-math
Editorial