【題解】Codeforces 1360A. Minimal Square

【題目敘述】http://codeforces.com/contest/1360/problem/A

#include <iostream>
using namespace std;
 
int t, a, b;
 
int main() {
    cin >> t;
    while (t--){
        cin >> a >> b;
        if (a > b) swap(a, b);
        a *= 2;
        cout << max(a, b)*max(a, b) << "\n";
    }
}

分享本文 Share with friends