title: Number Rectangles Nm Grid
signature: function number_rectangles_nm_grid(n, m)
source_py: def number_rectangles_nm_grid(n, m):
      return ((((m * n) * (n + 1)) * (m + 1)) // 4)
source_cpp: int number_rectangles_nm_grid(int n, int m) {
    return ( m * n * ( n + 1 ) * ( m + 1 ) ) / 4;
  }
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(n, m, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n, m) 
      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(86, 70, 9296385)
      print(string.format("TEST-0...%s",result))
  
      result = driver(33, 65, 1203345)
      print(string.format("TEST-1...%s",result))
  
      result = driver(3, 5, 90)
      print(string.format("TEST-2...%s",result))
  
      result = driver(91, 12, 326508)
      print(string.format("TEST-3...%s",result))
  
      result = driver(33, 27, 212058)
      print(string.format("TEST-4...%s",result))
  
      result = driver(13, 75, 259350)
      print(string.format("TEST-5...%s",result))
  
      result = driver(75, 36, 1898100)
      print(string.format("TEST-6...%s",result))
  
      result = driver(58, 64, 3558880)
      print(string.format("TEST-7...%s",result))
  
      result = driver(50, 51, 1690650)
      print(string.format("TEST-8...%s",result))
  
      result = driver(4, 44, 9900)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 9296385, "inputs": {"n": 86, "m": 70}}, {"idx": 1, "outputs": 1203345, "inputs": {"n": 33, "m": 65}}, {"idx": 2, "outputs": 90, "inputs": {"n": 3, "m": 5}}, {"idx": 3, "outputs": 326508, "inputs": {"n": 91, "m": 12}}, {"idx": 4, "outputs": 212058, "inputs": {"n": 33, "m": 27}}, {"idx": 5, "outputs": 259350, "inputs": {"n": 13, "m": 75}}, {"idx": 6, "outputs": 1898100, "inputs": {"n": 75, "m": 36}}, {"idx": 7, "outputs": 3558880, "inputs": {"n": 58, "m": 64}}, {"idx": 8, "outputs": 1690650, "inputs": {"n": 50, "m": 51}}, {"idx": 9, "outputs": 9900, "inputs": {"n": 4, "m": 44}}]
question_info.extension: lua
question_info.entry_fn_name: number_rectangles_nm_grid
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: lua __FILENAME__