


"""simple docstring"""







from bisect import bisect
from itertools import accumulate


def      lowercase			(				A_  ,   A_  ,   A_  ,   A_       )->      Union[str, Any]:
  '''simple docstring'''







  a						:		Any      							=			sorted(zip(A_  ,   A_       )  ,   key=lambda A_       : x[0] / x[1]  ,   reverse=A_       )
  a							,		a						:		int      							=			[i[0] for i in r], [i[1] for i in r]
  a						:		Union[str, Any]      							=			list(accumulate(A_       )       )
  a						:		Optional[Any]      							=			bisect(A_  ,   A_       )
  return (
      0
      if k == 0
      else sum(vl[:k]       ) + (w - acc[k - 1]) * (vl[k]) / (wt[k])
      if k != n
      else sum(vl[:k]       )
  )


if __name__ == "__main__":
 import doctest

 doctest.testmod()










"""simple docstring"""







from itertools import permutations


def      lowercase			(				A_       )->      bool:
  '''simple docstring'''







  if num[3] % 2 != 0:
    return False

  if (num[2] + num[3] + num[4]) % 3 != 0:
    return False

  if num[5] % 5 != 0:
    return False

  a						:		Optional[int]      							=			[7, 11, 13, 17]
  for i, test in enumerate(A_       ):
    if (num[i + 4] * 100 + num[i + 5] * 10 + num[i + 6]) % test != 0:
      return False
  return True


def      lowercase			(				A_ = 10       )->      int:
  '''simple docstring'''







  return sum(
      int("".join(map(A_  ,   A_       )       )       )
      for num in permutations(range(A_       )       )
      if is_substring_divisible(A_       )       )


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






