"""simple docstring"""


class        a				:


    def __init__(					self	:  int   ,				__lowerCAmelCase	:  Tuple   ,				__lowerCAmelCase	:  int   ,				__lowerCAmelCase	:  List[Any]					):
      _UpperCAmelCase						 =      name
      _UpperCAmelCase						 =      value
      _UpperCAmelCase						 =      weight


    def __repr__(					self	:  List[str]					):
      return f'''{self.__class__.__name__}({self.name}, {self.value}, {self.weight})'''


    def      lowerCAmelCase_  (					self	:  Tuple					):
      return self.value


    def      lowerCAmelCase_  (					self	:  Optional[Any]					):
      return self.name


    def      lowerCAmelCase_  (					self	:  Optional[Any]					):
      return self.weight


    def      lowerCAmelCase_  (					self	:  List[str]					):
      return self.value / self.weight






def     __UpperCAmelCase					(			lowercase   ,lowercase   ,lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      []
  for i in range(len(lowercase		)		):
    menu.append(Things(name[i]   ,value[i]   ,weight[i]		)		)
  return menu






def     __UpperCAmelCase					(			lowercase   ,lowercase   ,lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      sorted(lowercase   ,key=lowercase   ,reverse=lowercase		)
  _UpperCAmelCase						 =      []
  _UpperCAmelCase ,				_UpperCAmelCase						 =      0.0, 0.0
  for i in range(len(lowercase		)		):
    if (total_cost + items_copy[i].get_weight()) <= max_cost:
      result.append(items_copy[i]		)
      total_cost += items_copy[i].get_weight()
      total_value += items_copy[i].get_value()
  return (result, total_value)






def     __UpperCAmelCase					(			):







  """simple docstring"""


if __name__ == "__main__":
    import doctest

    doctest.testmod()

"""simple docstring"""


def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      abs(lowercase		)
  _UpperCAmelCase						 =      0
  while n > 0:
    res += n % 10
    n //= 10
  return res






def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  _UpperCAmelCase						 =      abs(lowercase		)
  return n if n < 10 else n % 10 + sum_of_digits(n // 10		)






def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  return sum(int(lowercase		) for c in str(abs(lowercase		)		)		)






def     __UpperCAmelCase					(			):







  """simple docstring"""
  from collections.abc import Callable
  from timeit import timeit

  def benchmark_a_function(lowercase   ,lowercase		) -> None:
    _UpperCAmelCase						 =      f'''{func.__name__}({value})'''
    _UpperCAmelCase						 =      timeit(f'''__main__.{call}'''   ,setup="""import __main__"""		)
    print(f'''{call:56} = {func(lowercase		)} -- {timing:.4f} seconds'''		)

  for value in (26_21_44, 11_25_89_99_06_84_26_24, 1_26_76_50_60_02_28_22_94_01_49_67_03_20_53_76):
    for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
      benchmark_a_function(lowercase   ,lowercase		)
    print()


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()
