title: Dice Throw Problem 1
signature: def dice_throw_problem_1(f, d, s):
source_py: def dice_throw_problem_1(f, d, s):
      mem = [[0 for i in range((s + 1))] for j in range((d + 1))]
      mem[0][0] = 1
      for i in range(1, (d + 1)):
          for j in range(1, (s + 1)):
              mem[i][j] = (mem[i][(j - 1)] + mem[(i - 1)][(j - 1)])
              if (((j - f) - 1) >= 0):
                  mem[i][j] -= mem[(i - 1)][((j - f) - 1)]
      return mem[d][s]
source_cpp: long dice_throw_problem_1(int f, int d, int s) {
    long mem [ d + 1 ] [ s + 1 ];
    memset ( mem, 0, sizeof mem );
    mem [ 0 ] [ 0 ] = 1;
    for ( int i = 1;
    i <= d;
    i ++ ) {
      for ( int j = i;
      j <= s;
      j ++ ) {
        mem [ i ] [ j ] = mem [ i ] [ j - 1 ] + mem [ i - 1 ] [ j - 1 ];
        if ( j - f - 1 >= 0 ) mem [ i ] [ j ] -= mem [ i - 1 ] [ j - f - 1 ];
      }
    }
    return mem [ d ] [ s ];
  }
question_info.test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(f, d, s, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              f, d, s),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver(57, 5, 33, 35960)
      print(f"TEST-0...{result}")
  
      result = driver(58, 45, 4, 0)
      print(f"TEST-1...{result}")
  
      result = driver(38, 89, 9, 0)
      print(f"TEST-2...{result}")
  
      result = driver(5, 39, 30, 0)
      print(f"TEST-3...{result}")
  
      result = driver(91, 90, 47, 0)
      print(f"TEST-4...{result}")
  
      result = driver(76, 56, 46, 0)
      print(f"TEST-5...{result}")
  
      result = driver(97, 26, 52, 247959266474052)
      print(f"TEST-6...{result}")
  
      result = driver(97, 90, 90, 1)
      print(f"TEST-7...{result}")
  
      result = driver(99, 2, 26, 25)
      print(f"TEST-8...{result}")
  
      sys.exit(0)
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8']
question_info.entry_fn_name: dice_throw_problem_1
question_info.test_list: [{"idx": 0, "outputs": 35960, "inputs": {"f": 57, "d": 5, "s": 33}}, {"idx": 1, "outputs": 0, "inputs": {"f": 58, "d": 45, "s": 4}}, {"idx": 2, "outputs": 0, "inputs": {"f": 38, "d": 89, "s": 9}}, {"idx": 3, "outputs": 0, "inputs": {"f": 5, "d": 39, "s": 30}}, {"idx": 4, "outputs": 0, "inputs": {"f": 91, "d": 90, "s": 47}}, {"idx": 5, "outputs": 0, "inputs": {"f": 76, "d": 56, "s": 46}}, {"idx": 6, "outputs": 247959266474052, "inputs": {"f": 97, "d": 26, "s": 52}}, {"idx": 7, "outputs": 1, "inputs": {"f": 97, "d": 90, "s": 90}}, {"idx": 8, "outputs": 25, "inputs": {"f": 99, "d": 2, "s": 26}}]
question_info.entry_cls_name: Solution