fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. ios_base::sync_with_stdio(false);
  5. cin.tie(NULL);
  6. int n;
  7. cin >> n;
  8. while(n--){
  9. int a,b;
  10. cin >> a >> b;
  11. int proceso =min(max((b*2),a),max((a*2),b));
  12. cout << proceso * proceso << "\n";
  13. }
  14. }
Success #stdin #stdout 0.01s 5320KB
stdin
8
3 2
4 2
1 1
3 1
4 7
1 3
7 4
100 100
stdout
16
16
4
9
64
9
64
40000