Given an integer N, where . The task is to print the count of pieces of a circle with N cuts where each cut passes through the centre of given circle.
Input : N = 2 Output : 4 Input : N = 100 Output : 200
Approach: This problem can be easily solved with observation only. Since each cut passes through the centre, each cut creates two new pieces.
Let us see how above Intuition works.
- At first cut we have 2 different pieces of circle.
- At second cut we have 2 new different pieces from previous 2 pieces of circle.
- At third cut we have again 2 new different pieces from any of previous 2 pieces which are opposite to each other.
In this way, we proceed with N cuts to get the count of total pieces after N cuts.
Below is the implementation of above approach:
Time Complexity: O(1)
- Maximum number of pieces in N cuts
- Minimum cuts required to divide the Circle into equal parts
- Minimum number of cuts required to make circle segments equal sized
- Check if a circle lies inside another circle or not
- Probability of cutting a rope into three pieces such that the sides form a triangle
- Probability that the pieces of a broken stick form a n sided polygon
- Equation of circle when three points on the circle are given
- Possible cuts of a number such that maximum parts are divisible by 3
- Minimum Cuts can be made in the Chessboard such that it is not divided into 2 parts
- Angle subtended by the chord to center of the circle when the angle subtended by the another equal chord of a congruent circle is given
- Area of circle inscribed within rhombus
- Area of decagon inscribed within the circle
- Equation of circle from centre and radius
- Radius of the circle when the width and height of an arc is given
- Program to find area of a circle
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.