{"id":22850,"date":"2021-09-29T20:13:21","date_gmt":"2021-09-29T14:43:21","guid":{"rendered":"https:\/\/python-programs.com\/?p=22850"},"modified":"2021-11-22T18:35:37","modified_gmt":"2021-11-22T13:05:37","slug":"python-program-for-maximum-number-of-squares-that-can-fit-in-a-right-angle-isosceles-triangle","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-for-maximum-number-of-squares-that-can-fit-in-a-right-angle-isosceles-triangle\/","title":{"rendered":"Python Program for Maximum Number of Squares that Can Fit in a Right Angle Isosceles Triangle"},"content":{"rendered":"

In the previous article, we have discussed Python Program for Minimum Height of a Triangle with Given Base and Area<\/a>
\nGiven the base b<\/strong> of an isosceles triangle and a value m<\/strong>, the task is to find the count of the maximum number of squares of side length m<\/strong> that can be fitted inside the given isosceles triangle.<\/p>\n

Formula:<\/strong><\/p>\n

(b \/ m \u2013 1) * (b \/ m) \/ 2<\/strong><\/p>\n

where b is the base of an isosceles triangle.<\/p>\n

m is the sidelength of the square.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given base of triangle = 8\r\nGiven side of square = 3<\/pre>\n

Output:<\/strong><\/p>\n

The maximum number of squares with given sidelength that can be fitted inside the isosceles triangle = \r\n2<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given base of triangle = 5\r\nGiven side of square =  2<\/pre>\n

Output:<\/strong><\/p>\n

The maximum number of squares with given sidelength that can be fitted inside the isosceles triangle = \r\n1<\/pre>\n

Program for Maximum Number of Squares that Can Fit in a Right Angle Isosceles Triangle in Python<\/h2>\n

Below are the ways to find the count of the maximum number of squares of side length m<\/strong> that can be fitted inside the given isosceles triangle.<\/p>\n