title: Minimum Perimeter N Blocks
signature: minimumPerimeterNBlocks(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(double actual, double expected){
      return (actual - expected).abs() < 1e-09;
  }
  
  String driver(n, double expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          45, 
          28.832815729997478)
      }");
  
      print("TEST-1...${driver(
          80, 
          37.77708763999664)
      }");
  
      print("TEST-2...${driver(
          54, 
          29.393876913398138)
      }");
  
      print("TEST-3...${driver(
          48, 
          29.712812921102035)
      }");
  
      print("TEST-4...${driver(
          83, 
          36.4417343165772)
      }");
  
      print("TEST-5...${driver(
          68, 
          32.984845004941285)
      }");
  
      print("TEST-6...${driver(
          32, 
          24.62741699796952)
      }");
  
      print("TEST-7...${driver(
          20, 
          19.88854381999832)
      }");
  
      print("TEST-8...${driver(
          68, 
          32.984845004941285)
      }");
  
      print("TEST-9...${driver(
          66, 
          34.49615361854384)
      }");
  
      return 0;
  }
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;
    }
  }