P18975 [GeeksforGeeks] Maximum number of 22 squares
普及-
题目描述

Given the base (in units) of a right-angled isoceles traingle, find the maximum number of 2X2 squares that can fit in the triangle with given base.
Example 1:
Input: 8
Output: 6
Explanation:
Please refer below diagram for explanation.
Example 2:
Input : 7
Output : 3
Explanation : In the base we can keep 2 squares
and above the two squares we can only keep 1 square.
So the total number of squares are equal to 3.

Your task :
You don't need to read input or print anything. Your task is to complete the function numberOfSquares() which takes the base of the triangle as input and returns the maximum number of squares that can be fit into the triangle with given base.

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

Constraints :
1 <= N <= 10^9

输入格式

见题面

输出格式

见题面

样例输入
8
样例输出
6