Description
给出一个x*y的矩形,求一个各边分别平行于该矩形且能够覆盖该矩形的最小正方形的面积
Input
第一行一整数T表示用例组数,每组用例输入两个整数x和y表示矩形相邻两边边长(1<=T<=1024,1<=x,y<=1000)
Output
输出满足条件的正方形的面积
Sample Input
3
3 3
5 7
12 6
Sample Output
9
49
144
Solution
水题,ans=max(x,y)^2
Code
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<ctime>
using namespace std;
typedef long long ll;
#define INF 0x3f3f3f3f
#define maxn 1111
int main()
{
int T,x,y;
scanf("%d",&T);
while(T--)
{
scanf("%d%d",&x,&y);
x=max(x,y);
printf("%d\n",x*x);
}
return 0;
}