Math, asked by Devika5428, 11 months ago

What is the maximum number of squares 0f size2*2 that can be fit in the right angled isosceles triangle of base b.

Answers

Answered by RaviJamesBond
0

1234567890123456789012346678907250910046856985875885988800.5268552445126600.005559868597426-'(?/'"(-*=?,,58

Answered by Radhaisback2434
0

Step-by-step explanation:

Input : 8

Output : 6

Please refer below diagram for explanation.

Input : 7

Output : 3Since the triangle is isosceles, the given base would also be equal to the height. Now in the diagonal part, we would always need an extra length of 2 units in both height and base of the triangle to accommodate a triangle. (The CF and AM segment of the triangle in the image. The part that does not contribute to any square). In the remaining length of base, we can construct length / 2 squares. Since each square is of 2 units, same would be the case of height, there is no need to calculate that again.

So, for each level of given length we can construct “(length-2)/2” squares. This gives us a base of “(length-2)” above it. Continuing this process to get the no of squares for all available “length-2” height, we can calculate the squares.

while length > 2

answer += (length - 2 )/2

length = length - 2For more effective way, we can use the formula of sum of AP n * ( n + 1 ) / 2, where n = length – 2

Hope its help..

Similar questions