class Solution {
public:
vector<int> constructRectangle(int area) {
vector<int> vec(2,0);
int a,b;
a=b=sqrt(area);
while(ab!=area){
if(ab>area) a;
if(a*b<area) b++;
}
vec[1]=a; vec[0]=b;
return vec;
}
};
Simple C++

@Shield_David Thank you for sharing your solution.
I have a question: how do you know that
while(ab!=area){
if(ab>area) a;
if(a*b<area) b++;
}
will make axb converge to the area?