


"""simple docstring"""





from bisect import bisect
from itertools import accumulate


def    _snake_case  (  _snake_case :	Union[str, Any]       ,      _snake_case :	Optional[Any]       ,      _snake_case :	str       ,      _snake_case :	int	):
      lowerCAmelCase    :		Any				=      sorted(zip(A_       ,      A_	)       ,      key=lambda _snake_case	: x[0] / x[1]       ,      reverse=A_	)
      lowerCAmelCase    :		int				=      [i[0] for i in r], [i[1] for i in r]
      lowerCAmelCase    :		Union[str, Any]				=      list(accumulate(A_	)	)
      lowerCAmelCase    :		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() = }''')






