





'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase					:					str	,__lowerCamelCase					:					int ):
   lowercase_			:Optional[int]    			= word.split()

   def justify(__lowerCamelCase					:					list	,__lowerCamelCase					:					int	,__lowerCamelCase					:					int ) -> str:
      lowercase_			:int    			= max_width - width
      lowercase_			:Union[str, Any]    			= len(__lowerCamelCase )
      if len(__lowerCamelCase ) == 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:
         lowercase_			: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]
         lowercase_			:str    			= spaces_to_insert_between_words * [
             overall_spaces_count // spaces_to_insert_between_words
         ]
         lowercase_			:List[Any]    			= (
             overall_spaces_count % spaces_to_insert_between_words
         )
         # distribute spaces via round robin to the left words
         for i in range(__lowerCamelCase ):
            num_spaces_between_words_list[i] += 1
         lowercase_			:List[Any]    			= []
         for i in range(__lowerCamelCase ):
            # 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(__lowerCamelCase )

   lowercase_			:Union[str, Any]    			= []
   lowercase_			:list[str]    			= []
   lowercase_			:Tuple    			= 0
   for word in words:
      if width + len(__lowerCamelCase ) + len(__lowerCamelCase ) <= 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(__lowerCamelCase )
         width += len(__lowerCamelCase )
      else:
         # justify the line and add it to result
         answer.append(justify(__lowerCamelCase	,__lowerCamelCase	,__lowerCamelCase ) )
         # reset new line and new width
         lowercase_			,							lowercase_			:Any    			= [word], len(__lowerCamelCase )
   lowercase_			:List[str]    			= max_width - width - len(__lowerCamelCase )
   answer.append(" ".join(__lowerCamelCase ) + (remaining_spaces + 1) * " " )
   return answer


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

 testmod()









'''simple docstring'''


def 							UpperCAmelCase_  (						__lowerCamelCase					:					int = 1_00 ):
   lowercase_			:Tuple    			= n * (n + 1) * (2 * n + 1) / 6
   lowercase_			:List[str]    			= (n * (n + 1) / 2) ** 2
   return int(square_of_sum - sum_of_squares )


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


