





"""simple docstring"""
def 					__lowerCamelCase       (							a_					:		str			,       a_					:		int							)      ->				list:
      __SCREAMING_SNAKE_CASE       :Union[str, Any]		    =  word.split()

      def justify(a_					:		list			,       a_					:		int			,       a_					:		int							) -> str:
            __SCREAMING_SNAKE_CASE       :Dict		    =  max_width - width
            __SCREAMING_SNAKE_CASE       :str		    =  len(a_							)
            if len(a_							) == 1:
                  # if there is only word in line
                  # just insert overall_spaces_count for the remainder of line
                  return line[0] + " " * overall_spaces_count
            else:
                  __SCREAMING_SNAKE_CASE       :int		    =  words_count - 1
                  # num_spaces_between_words_list[i] : tells you to insert
                  # num_spaces_between_words_list[i] spaces
                  # after word on line[i]
                  __SCREAMING_SNAKE_CASE       :Tuple		    =  spaces_to_insert_between_words * [
                      overall_spaces_count // spaces_to_insert_between_words
                  ]
                  __SCREAMING_SNAKE_CASE       :List[str]		    =  (
                      overall_spaces_count % spaces_to_insert_between_words
                  )
                  # distribute spaces via round robin to the left words
                  for i in range(a_							):
                        num_spaces_between_words_list[i] += 1
                  __SCREAMING_SNAKE_CASE       :List[str]		    =  []
                  for i in range(a_							):
                        # add the word
                        aligned_words_list.append(line[i]							)
                        # add the spaces to insert
                        aligned_words_list.append(num_spaces_between_words_list[i] * ''' '''							)
                  # just add the last word to the sentence
                  aligned_words_list.append(line[-1]							)
                  # join the aligned words list to form a justified line
                  return "".join(a_							)

      __SCREAMING_SNAKE_CASE       :Dict		    =  []
      __SCREAMING_SNAKE_CASE       :list[str]		    =  []
      __SCREAMING_SNAKE_CASE       :str		    =  0
      for word in words:
            if width + len(a_							) + len(a_							) <= max_width:
                  # keep adding words until we can fill out max_width
                  # width = sum of length of all words (without overall_spaces_count)
                  # len(word) = length of current word
                  # len(line) = number of overall_spaces_count to insert between words
                  line.append(a_							)
                  width += len(a_							)
            else:
                  # justify the line and add it to result
                  answer.append(justify(a_			,       a_			,       a_							)							)
                  # reset new line and new width
                  __SCREAMING_SNAKE_CASE    ,__SCREAMING_SNAKE_CASE       :List[str]		    =  [word], len(a_							)
      __SCREAMING_SNAKE_CASE       :Tuple		    =  max_width - width - len(a_							)
      answer.append(''' '''.join(a_							) + (remaining_spaces + 1) * ''' '''							)
      return answer


if __name__ == "__main__":
  from doctest import testmod

  testmod()






"""simple docstring"""
from itertools import product



def 					__lowerCamelCase       (							a_					:		int			,       a_					:		int							)      ->				list[int]:
      __SCREAMING_SNAKE_CASE       :Tuple		    =  sides_number
      __SCREAMING_SNAKE_CASE       :List[Any]		    =  max_face_number * dice_number
      __SCREAMING_SNAKE_CASE       :List[Any]		    =  [0] * (max_total + 1)

      __SCREAMING_SNAKE_CASE       :Optional[int]		    =  1
      __SCREAMING_SNAKE_CASE       :Tuple		    =  range(a_			,       max_face_number + 1							)
      for dice_numbers in product(a_			,       repeat=a_							):
            __SCREAMING_SNAKE_CASE       :Any		    =  sum(a_							)
            totals_frequencies[total] += 1

      return totals_frequencies



def 					__lowerCamelCase       (							)      ->				float:
      __SCREAMING_SNAKE_CASE       :Dict		    =  total_frequency_distribution(
          sides_number=4			,       dice_number=9							)
      __SCREAMING_SNAKE_CASE       :Union[str, Any]		    =  total_frequency_distribution(
          sides_number=6			,       dice_number=6							)

      __SCREAMING_SNAKE_CASE       :Optional[Any]		    =  0
      __SCREAMING_SNAKE_CASE       :Any		    =  9
      __SCREAMING_SNAKE_CASE       :List[str]		    =  4 * 9
      __SCREAMING_SNAKE_CASE       :Dict		    =  6
      for peter_total in range(a_			,       max_peter_total + 1							):
            peter_wins_count += peter_totals_frequencies[peter_total] * sum(
                colin_totals_frequencies[min_colin_total:peter_total]							)

      __SCREAMING_SNAKE_CASE       :List[str]		    =  (4**9) * (6**6)
      __SCREAMING_SNAKE_CASE       :Union[str, Any]		    =  peter_wins_count / total_games_number

      __SCREAMING_SNAKE_CASE       :str		    =  round(a_			,       ndigits=7							)

      return rounded_peter_win_probability


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