Computer Science, asked by haritha13400, 7 months ago

Given a square matrix of size Nxn where each cell is filled with a number between 9 and 9. A sub-square of size k is any set of k contiguous columns and k contiguous rows. For any sub-square, the sum of elements in its cells is called a sub-square sum. Given the Nx N square, write a program to find the maximum sub-square sum. Note that a 1 x 1 square (k=1) is not considered a sub-square.

Answers

Answered by aaravs618gmailcom
1

Answer:

Let the radius of circle be r and sides of square be a

According to question, we have

2πr+4a=k

a=

4

k−2πr

Sum of area will be

A=πr

2

+a

2

A=πr

2

+(

4

k−2πr

)

2

Now , we will calculate

dr

dA

dr

dA

=2πr+2(

16

k−2πr

)(−2π)

dr

dA

=0

at

r=

2(π+4)

k

Now,

dr

2

d

2

A

=2π+

2

π

2

>0

at r=

2(π+4)

k

A has least value

then a=

(π+4)

k

putting the value of r in a=

4

k−2πr

Similar questions