Hi
I have to write function that given area as unsigned long long find the minimum perimeter of a rectangle with integer width and length. My code below

Code:
typedef unsigned long long ull;


ull minimum_perimeter(ull area) {
  long double a,b;
  for(a = floor(sqrt(area)),b = ceil(sqrt(area));a*b!=area;a--)
  {
    ull b_b=b;
    for(;a*b_b<area;b_b++);
    if(a*b_b==area)
      return 2*(a+b_b);
  }
  return 2*(a+b);
}
The function did not pass the test due to time out. Can you help me fix the code. Where is mistake, for small numbers alghortim seems to work fine.
The result can not be square. It is mean that width and length must be different value.