How to find largest square from given sticks of n length?

6.1k Views Asked by At

We have n number of sticks and each stick of length 2cm , how to form the largest possible square from the sticks without breaking sticks, find area of largest square?

Please give me some clue For example we have 19 sticks and each stick is of length 2cm then we get the area of largest square is 64sqcm

We can use maximum of the sticks from given sticks to make a square

2

There are 2 best solutions below

0
On BEST ANSWER

I got the answer actually. A square has all it's side length same so we need to adjust the sticks in such a way that it doesn't exceeds from the given number of sticks For example we have 20 sticks given , then on each side we can use maximum 5sticks so that it satisfies the condition to use maximum sticks 5*4(square has 4 sides) = 20 (<=20)

For 19sticks 4*4= 16<=19

Now multiply the number of max seats from 19 sticks with stick length 2cm i.e 8 Area of square is a² 8² = 64

3
On

I'm assuming that you mean strictly square, and not also rectangular. We know that we can make a square with any amount of sticks that is a multiple of $4$. So given $n$ sticks, we can make a square with sides $n//4$, where the $//$ sign means integer division. For example: $10//4=2$ because we can fit $4$ into $10$ twice. The area of our square is then the length of the sides squared, i.e. $\text{area}=(n//4*2)*(n//4*2)$ in units $cm^2$.

If I didn't explain what I mean with integer division clearly enough, let me know and I'll try to explain in more detail.