title: Minimum Perimeter N Blocks
signature: fun minimumPerimeterNBlocks(n: Int): Double {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Double, expected:Double):Boolean{
    return abs(actual - expected) < 1e-09
  }
  fun driver(n: Int, expected:Double):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(45, 28.832815729997478)
      println("TEST-0...${result}")
      
      result = driver(80, 37.77708763999664)
      println("TEST-1...${result}")
      
      result = driver(54, 29.393876913398138)
      println("TEST-2...${result}")
      
      result = driver(48, 29.712812921102035)
      println("TEST-3...${result}")
      
      result = driver(83, 36.4417343165772)
      println("TEST-4...${result}")
      
      result = driver(68, 32.984845004941285)
      println("TEST-5...${result}")
      
      result = driver(32, 24.62741699796952)
      println("TEST-6...${result}")
      
      result = driver(20, 19.88854381999832)
      println("TEST-7...${result}")
      
      result = driver(68, 32.984845004941285)
      println("TEST-8...${result}")
      
      result = driver(66, 34.49615361854384)
      println("TEST-9...${result}")
      
          
  }
  
  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;
    }
  }