title: Minimum Perimeter N Blocks
signature: class Solution {
  
      public Double minimumPerimeterNBlocks(Integer n) {
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;
    }
  }
question_info.extension: java
question_info.entry_fn_name: minimumPerimeterNBlocks
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 28.832815729997478, "inputs": {"n": 45}}, {"idx": 1, "outputs": 37.77708763999664, "inputs": {"n": 80}}, {"idx": 2, "outputs": 29.393876913398138, "inputs": {"n": 54}}, {"idx": 3, "outputs": 29.712812921102035, "inputs": {"n": 48}}, {"idx": 4, "outputs": 36.4417343165772, "inputs": {"n": 83}}, {"idx": 5, "outputs": 32.984845004941285, "inputs": {"n": 68}}, {"idx": 6, "outputs": 24.62741699796952, "inputs": {"n": 32}}, {"idx": 7, "outputs": 19.88854381999832, "inputs": {"n": 20}}, {"idx": 8, "outputs": 32.984845004941285, "inputs": {"n": 68}}, {"idx": 9, "outputs": 34.49615361854384, "inputs": {"n": 66}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Double expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(45, 28.832815729997478);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(80, 37.77708763999664);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(54, 29.393876913398138);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(48, 29.712812921102035);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(83, 36.4417343165772);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(68, 32.984845004941285);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(32, 24.62741699796952);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(20, 19.88854381999832);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(68, 32.984845004941285);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(66, 34.49615361854384);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Double expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Double actual, Double expected){
          return Math.abs(actual - expected) < 1e-09;
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__