![]() |
VOOZH | about |
Given an integer N denoting the perimeter of a rectangle. The task is to find the number of distinct rectangles possible with a given perimeter.
Examples
Input: N = 10
Output: 4
Explanation: All the rectangles with perimeter 10 are following in the form of (length, breadth):
(1, 4), (4, 1), (2, 3), (3, 2)Input: N = 8
Output: 3
Approach: This problem can be solved by using the properties of rectangles. Follow the steps below to solve the given problem.
Below is the implementation of the above approach.
9
Time Complexity: O(1)
Auxiliary Space: O(1)