title: Minimum Perimeter N Blocks
signature: function minimum_perimeter_n_blocks(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return abs(actual - expected) < 1e-09
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(45, 28.832815729997478);
      @printf("TEST-0...%s\n",result);
      
      result = driver(80, 37.77708763999664);
      @printf("TEST-1...%s\n",result);
      
      result = driver(54, 29.393876913398138);
      @printf("TEST-2...%s\n",result);
      
      result = driver(48, 29.712812921102035);
      @printf("TEST-3...%s\n",result);
      
      result = driver(83, 36.4417343165772);
      @printf("TEST-4...%s\n",result);
      
      result = driver(68, 32.984845004941285);
      @printf("TEST-5...%s\n",result);
      
      result = driver(32, 24.62741699796952);
      @printf("TEST-6...%s\n",result);
      
      result = driver(20, 19.88854381999832);
      @printf("TEST-7...%s\n",result);
      
      result = driver(68, 32.984845004941285);
      @printf("TEST-8...%s\n",result);
      
      result = driver(66, 34.49615361854384);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def minimum_perimeter_n_blocks(n):
      l = math.sqrt(n)
      sq = (l * l)
      if (sq == n):
          return (l * 4)
      else:
          row = (n / l)
          perimeter = (2 * (l + row))
          if ((n % l) != 0):
              perimeter += 2
          return perimeter
source_cpp: int minimum_perimeter_n_blocks(int n) {
    int l = sqrt ( n );
    int sq = l * l;
    if ( sq == n ) return l * 4;
    else {
      long long int row = n / l;
      long long int perimeter = 2 * ( l + row );
      if ( n % l != 0 ) perimeter += 2;
      return perimeter;
    }
  }