





'''simple docstring'''




from itertools import product
def 	UpperCAmelCase_							(					__lowercase							:      int			,     __lowercase							:      int       )		->       list[int]:


     '''simple docstring'''



     _UpperCAmelCase     							=   sides_number
     _UpperCAmelCase     							=   max_face_number * dice_number
     _UpperCAmelCase     							=   [0] * (max_total + 1)

     _UpperCAmelCase     							=   1
     _UpperCAmelCase     							=   range(__lowercase			,     max_face_number + 1       )
     for dice_numbers in product(__lowercase			,     repeat=__lowercase       ):
          _UpperCAmelCase     							=   sum(__lowercase       )
          totals_frequencies[total] += 1

     return totals_frequencies
def 	UpperCAmelCase_							(					)		->       float:


     '''simple docstring'''



     _UpperCAmelCase     							=   total_frequency_distribution(
         sides_number=4			,     dice_number=9       )
     _UpperCAmelCase     							=   total_frequency_distribution(
         sides_number=6			,     dice_number=6       )

     _UpperCAmelCase     							=   0
     _UpperCAmelCase     							=   9
     _UpperCAmelCase     							=   4 * 9
     _UpperCAmelCase     							=   6
     for peter_total in range(__lowercase			,     max_peter_total + 1       ):
          peter_wins_count += peter_totals_frequencies[peter_total] * sum(
              colin_totals_frequencies[min_colin_total:peter_total]       )

     _UpperCAmelCase     							=   (4**9) * (6**6)
     _UpperCAmelCase     							=   peter_wins_count / total_games_number

     _UpperCAmelCase     							=   round(__lowercase			,     ndigits=7       )

     return rounded_peter_win_probability


if __name__ == "__main__":
  print(F"{solution() = }")








import unittest

from knapsack import knapsack as k





class   __a			(    unittest.TestCase      ):
 def 		SCREAMING_SNAKE_CASE__   (   self )					->				Tuple:




        '''simple docstring'''
        lowercase__:   List[Any]  			=   0
        lowercase__:   List[Any]  			=   [0]
        lowercase__:   str  			=   [0]
        lowercase__:   Tuple  			=   len(lowerCAmelCase__ )
        self.assertEqual(k.knapsack(lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__ )				, 0 )

        lowercase__:   Optional[Any]  			=   [60]
        lowercase__:   Dict  			=   [10]
        lowercase__:   str  			=   len(lowerCAmelCase__ )
        self.assertEqual(k.knapsack(lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__ )				, 0 )
 def 		SCREAMING_SNAKE_CASE__   (   self )					->				Union[str, Any]:




        '''simple docstring'''
        lowercase__:   Union[str, Any]  			=   3
        lowercase__:   List[str]  			=   [1, 2, 3]
        lowercase__:   Union[str, Any]  			=   [3, 2, 1]
        lowercase__:   Union[str, Any]  			=   len(lowerCAmelCase__ )
        self.assertEqual(k.knapsack(lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__ )				, 5 )
 def 		SCREAMING_SNAKE_CASE__   (   self )					->				List[Any]:




        '''simple docstring'''
        lowercase__:   Optional[Any]  			=   50
        lowercase__:   str  			=   [60, 100, 120]
        lowercase__:   Any  			=   [10, 20, 30]
        lowercase__:   List[Any]  			=   len(lowerCAmelCase__ )
        self.assertEqual(k.knapsack(lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__				, lowerCAmelCase__ )				, 220 )


if __name__ == "__main__":
 unittest.main()


