





def     a__ (					lowercase__  ,    lowercase__  ,    lowercase__  ):






   '''simple docstring'''






   def count_of_possible_combinations(lowercase__  ) -> int:
      if target < 0:
         return 0
      if target == 0:
         return 1
      return sum(count_of_possible_combinations(target - item  ) for item in array  )

   return count_of_possible_combinations(lowercase__  )




def     a__ (					lowercase__  ,    lowercase__  ,    lowercase__  ):






   '''simple docstring'''






   def count_of_possible_combinations_with_dp_array(
       lowercase__  ,    lowercase__  ) -> int:
      if target < 0:
         return 0
      if target == 0:
         return 1
      if dp_array[target] != -1:
         return dp_array[target]
      UpperCAmelCase_											=sum(
          count_of_possible_combinations_with_dp_array(target - item  ,    lowercase__  )
          for item in array  )
      UpperCAmelCase_											=answer
      return answer

   UpperCAmelCase_											=[-1] * (target + 1)
   return count_of_possible_combinations_with_dp_array(lowercase__  ,    lowercase__  )




def     a__ (					lowercase__  ,    lowercase__  ,    lowercase__  ):






   '''simple docstring'''






   UpperCAmelCase_											=[0] * (target + 1)
   UpperCAmelCase_											=1

   for i in range(1  ,    target + 1  ):
      for j in range(lowercase__  ):
         if i - array[j] >= 0:
            dp_array[i] += dp_array[i - array[j]]

   return dp_array[target]


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     __lowercase  :   Optional[int]						      =3
     __lowercase  :   Optional[Any]						      =5
     __lowercase  :   List[Any]						      =[1, 2, 5]
     print(combination_sum_iv(n, array, target))











__lowercase  :   Optional[Any]						      =[
    (1000, """M"""),
    (900, """CM"""),
    (500, """D"""),
    (400, """CD"""),
    (100, """C"""),
    (90, """XC"""),
    (50, """L"""),
    (40, """XL"""),
    (10, """X"""),
    (9, """IX"""),
    (5, """V"""),
    (4, """IV"""),
    (1, """I"""),
]




def     a__ (					lowercase__  ):






   '''simple docstring'''






   UpperCAmelCase_											={"I": 1, "V": 5, "X": 1_0, "L": 5_0, "C": 1_0_0, "D": 5_0_0, "M": 1_0_0_0}
   UpperCAmelCase_											=0
   UpperCAmelCase_											=0
   while place < len(lowercase__  ):
      if (place + 1 < len(lowercase__  )) and (vals[roman[place]] < vals[roman[place + 1]]):
         total += vals[roman[place + 1]] - vals[roman[place]]
         place += 2
      else:
         total += vals[roman[place]]
         place += 1
   return total




def     a__ (					lowercase__  ):






   '''simple docstring'''






   UpperCAmelCase_											=[]
   for arabic, roman in ROMAN:
      ((UpperCAmelCase_)						,       (UpperCAmelCase_))											=divmod(lowercase__  ,    lowercase__  )
      result.append(roman * factor  )
      if number == 0:
         break
   return "".join(lowercase__  )


if __name__ == "__main__":
     import doctest

     doctest.testmod()




