


'''simple docstring'''






from __future__ import annotations

a_   :      List[str]				    =      1_0






def 		_A			(lowerCAmelCase__					:list[int]						)				->					list[int]:




     '''simple docstring'''



     _a      =							1
     _a      =							max(lowerCAmelCase__						)
     while placement <= max_digit:
          # declare and initialize empty buckets
          _a      =							[[] for _ in range(lowerCAmelCase__						)]
          # split list_of_ints between the buckets
          for i in list_of_ints:
               _a      =							int((i / placement) % RADIX						)
               buckets[tmp].append(lowerCAmelCase__						)
          # put each buckets' contents into list_of_ints
          _a      =							0
          for b in range(lowerCAmelCase__						):
               for i in buckets[b]:
                    _a      =							i
                    a += 1
        # move to next
          placement *= RADIX
     return list_of_ints


if __name__ == "__main__":
 import doctest

 doctest.testmod()





'''simple docstring'''






def 		_A			(lowerCAmelCase__					:list						)				->					float:




     '''simple docstring'''



     _a      =							0
     while len(lowerCAmelCase__						) > 1:
          _a      =							0
          # Consider two files with minimum cost to be merged
          for _ in range(2						):
               _a      =							files.index(min(lowerCAmelCase__						)						)
               temp += files[min_index]
               files.pop(lowerCAmelCase__						)
          files.append(lowerCAmelCase__						)
          optimal_merge_cost += temp
     return optimal_merge_cost


if __name__ == "__main__":
 import doctest

 doctest.testmod()

