title: Minimum Perimeter N Blocks
signature: def minimumPerimeterNBlocks(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Double , expected: Double): Boolean = {
      (actual - expected).abs < 1e-09
  }
  
  def driver(n: Int, expected: Double): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        45, 
        28.832815729997478    
      )}")   
  
  
      println(s"TEST-1...${driver(
        80, 
        37.77708763999664    
      )}")   
  
  
      println(s"TEST-2...${driver(
        54, 
        29.393876913398138    
      )}")   
  
  
      println(s"TEST-3...${driver(
        48, 
        29.712812921102035    
      )}")   
  
  
      println(s"TEST-4...${driver(
        83, 
        36.4417343165772    
      )}")   
  
  
      println(s"TEST-5...${driver(
        68, 
        32.984845004941285    
      )}")   
  
  
      println(s"TEST-6...${driver(
        32, 
        24.62741699796952    
      )}")   
  
  
      println(s"TEST-7...${driver(
        20, 
        19.88854381999832    
      )}")   
  
  
      println(s"TEST-8...${driver(
        68, 
        32.984845004941285    
      )}")   
  
  
      println(s"TEST-9...${driver(
        66, 
        34.49615361854384    
      )}")   
  
  }
  
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;
    }
  }