Large Square: XLSQUARE



Contributor: Priya (CSE)

You are given N identical squares, each with side length A. All the squares have their sides parallel to the x−axis and y−axis. That is, the squares are not tilted. You have to take several (possibly, zero or all) squares and rearrange them to obtain a mega square. The mega square can’t have any gap in the enclosed region or have overlapping squares. Also, you cannot rotate any square.

Output the side length of the largest mega square that you can obtain.


#define ll long long int 
using namespace std;

int main()
    ll t,n,a;
        ll k=sqrt(n);

* The material and content uploaded on this website are for general information and reference purposes only. Please do it by your own first.