#include<vector>#include<algorithm>usingnamespace std;
int solution(vector<vector<int>> sizes) {
int max_w = 0, max_h = 0;
for (autoconst &wallet : sizes) {
// 지갑의 두 변 중 더 큰 쪽이 가로
intconst w = max(wallet[0], wallet[1]);
// 지갑의 두 변 중 더 작은 쪽이 가로
intconst h = min(wallet[0], wallet[1]);
// 더 큰 가로가 나오면 업데이트
max_w = max(max_w, w);
// 더 큰 세로가 나오면 업데이트
max_h = max(max_h, h);
}
return max_w * max_h;
}