Timer is Running

Dimensions of Rectangle
Submissions: 11   Accuracy:


  Difficulty: Medium   Marks: 4

You are required to build some sheets of rectangular shape of Area A. To build a sheet of an  Area A of Dimensions L & B. You have two conditions:
1) L and B can not be in decimals.
2) When L and B are even, L must be Equal to B.
Calculate the number of possible choices to build a sheet of area A.

Example 1:

Input: A = 4
Output: 2
Explaination: The possible combinations are (1, 4) 
and (2, 2). Note that order does not matter. (1, 4) 
and (4, 1) are same.

Example 2:

Input: A = 7
Output: 1
Explaination: The only possible combination is (1, 7).

Your Task:
You do not need to read input or print anything. Your task is to complete the function rectangleCount() which takes A as input parameters and returns the number of possible combinations of (L, B).

Expected Time Complexity: O( sqrt(A) )
Expected Auxiliary Space: O(1)

1 ≤ A ≤ 105

** For More Input/Output Examples Use 'Expected Output' option **

Author: jain_rishabh

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.