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
You must perform the task for
Input format
- The first line contains
denoting the number of test cases. - Next
lines contain a single integer .
Output format
Print
Note: Use a 64-bit variable to store and read all the variables.
Constraints
Sample Input
2 0 4
Sample Output
1 11
Explanation
For the first case where N = 0, using 0 cuts you can get a maximum of 1 piece of the material.
For the second case where N = 4, using exactly 4 straight cuts you can get 11 pieces of material.
Code Editor
Please login to use the editor
You need to be logged in to access the code editor
Submissions
Please login to view your submissions
Similar Problems
1.Divisors
Points:20
10 votes
Tags:
OpenAlgorithmsApprovedEasyMathamatics
Points:20
32 votes
Tags:
EasyMath BasicPrime FactorizationBasic MatheasyMathematicsOpen
Points:20
6 votes
Tags:
MathematicsEasy
Editorial
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor