title: Dice Throw Problem
signature: function dice_throw_problem(m, n, x)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(m, n, x, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(m, n, x), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(94, 4, 69, 50116);
      @printf("TEST-0...%s\n",result);
      
      result = driver(7, 12, 33, 77635844);
      @printf("TEST-1...%s\n",result);
      
      result = driver(20, 44, 24, 0);
      @printf("TEST-2...%s\n",result);
      
      result = driver(90, 94, 88, 0);
      @printf("TEST-3...%s\n",result);
      
      result = driver(50, 58, 27, 0);
      @printf("TEST-4...%s\n",result);
      
      result = driver(32, 90, 29, 0);
      @printf("TEST-5...%s\n",result);
      
      result = driver(46, 25, 6, 0);
      @printf("TEST-6...%s\n",result);
      
      result = driver(43, 82, 70, 0);
      @printf("TEST-7...%s\n",result);
      
      result = driver(6, 83, 19, 0);
      @printf("TEST-8...%s\n",result);
      
  end
  
  main()
source_py: def dice_throw_problem(m, n, x):
      table = [([0] * (x + 1)) for i in range((n + 1))]
      for j in range(1, min((m + 1), (x + 1))):
          table[1][j] = 1
      for i in range(2, (n + 1)):
          for j in range(1, (x + 1)):
              for k in range(1, min((m + 1), j)):
                  table[i][j] += table[(i - 1)][(j - k)]
      return table[(- 1)][(- 1)]
source_cpp: int dice_throw_problem(int m, int n, int x) {
    int table [ n + 1 ] [ x + 1 ];
    memset ( table, 0, sizeof ( table ) );
    for ( int j = 1;
    j <= m && j <= x;
    j ++ ) table [ 1 ] [ j ] = 1;
    for ( int i = 2;
    i <= n;
    i ++ ) for ( int j = 1;
    j <= x;
    j ++ ) for ( int k = 1;
    k <= m && k < j;
    k ++ ) table [ i ] [ j ] += table [ i - 1 ] [ j - k ];
    return table [ n ] [ x ];
  }