

'''simple docstring'''




def 							lowerCamelCase			(   UpperCAmelCase__ :      str   ,   UpperCAmelCase__ :      int				)    ->   Optional[Any]:
							lowercase_      :    Optional[Any]       		= word.split()

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

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


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

						testmod()






'''simple docstring'''




from collections.abc import Callable

import numpy as np




def 							lowerCamelCase			(   UpperCAmelCase__ :      Callable   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float   ,   UpperCAmelCase__ :      float				)    ->   np.array:
							lowercase_      :    Any       		= int(np.ceil((x_end - xa) / step_size				)				)
							lowercase_      :    List[Any]       		= np.zeros((n + 1,)				)
							lowercase_      :    List[Any]       		= ya
							lowercase_      :    List[str]       		= xa

							for k in range(UpperCAmelCase__				):
														lowercase_      :    Optional[Any]       		= y[k] + step_size * ode_func(UpperCAmelCase__   ,   y[k]				)
														lowercase_      :    List[Any]       		= y[k] + (
														    (step_size / 2) * (ode_func(UpperCAmelCase__   ,   y[k]				) + ode_func(x + step_size   ,   UpperCAmelCase__				))
														)
														x += step_size

							return y


if __name__ == "__main__":
						import doctest

						doctest.testmod()





