title: Paper Cut Minimum Number Squares
signature: function paper_cut_minimum_number_squares(a, b)
source_py: def paper_cut_minimum_number_squares(a, b):
      result = 0
      rem = 0
      if (a < b):
          (a, b) = (b, a)
      while (b > 0):
          result += int((a / b))
          rem = int((a % b))
          a = b
          b = rem
      return result
source_cpp: int paper_cut_minimum_number_squares(int a, int b) {
    long long result = 0, rem = 0;
    if ( a < b ) swap ( a, b );
    while ( b > 0 ) {
      result += a / b;
      long long rem = a % b;
      a = b;
      b = rem;
    }
    return result;
  }
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(a, b, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(a, b) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(87, 60, 9)
      print(string.format("TEST-0...%s",result))
  
      result = driver(18, 35, 19)
      print(string.format("TEST-1...%s",result))
  
      result = driver(68, 93, 11)
      print(string.format("TEST-2...%s",result))
  
      result = driver(80, 20, 4)
      print(string.format("TEST-3...%s",result))
  
      result = driver(87, 69, 10)
      print(string.format("TEST-4...%s",result))
  
      result = driver(64, 29, 12)
      print(string.format("TEST-5...%s",result))
  
      result = driver(64, 1, 64)
      print(string.format("TEST-6...%s",result))
  
      result = driver(65, 95, 9)
      print(string.format("TEST-7...%s",result))
  
      result = driver(43, 72, 18)
      print(string.format("TEST-8...%s",result))
  
      result = driver(97, 41, 11)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 9, "inputs": {"a": 87, "b": 60}}, {"idx": 1, "outputs": 19, "inputs": {"a": 18, "b": 35}}, {"idx": 2, "outputs": 11, "inputs": {"a": 68, "b": 93}}, {"idx": 3, "outputs": 4, "inputs": {"a": 80, "b": 20}}, {"idx": 4, "outputs": 10, "inputs": {"a": 87, "b": 69}}, {"idx": 5, "outputs": 12, "inputs": {"a": 64, "b": 29}}, {"idx": 6, "outputs": 64, "inputs": {"a": 64, "b": 1}}, {"idx": 7, "outputs": 9, "inputs": {"a": 65, "b": 95}}, {"idx": 8, "outputs": 18, "inputs": {"a": 43, "b": 72}}, {"idx": 9, "outputs": 11, "inputs": {"a": 97, "b": 41}}]
question_info.extension: lua
question_info.entry_fn_name: paper_cut_minimum_number_squares
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: lua __FILENAME__