


from __future__ import annotations


def    __lowerCamelCase   (      A__						: list[int]						,						A__						: list[int]						,						A__						: int					)     ->    tuple[float, list[float]]:
   lowerCamelCase_						:   List[Any]		= list(range(len(A__					)					)					)
   lowerCamelCase_						:   Optional[int]		= [v / w for v, w in zip(A__						,						A__					)]
   index.sort(key=lambda A__					: ratio[i]						,						reverse=A__					)

   lowerCamelCase_						:   float		= 0
   lowerCamelCase_						:   list[float]		= [0] * len(A__					)
   for i in index:
      if weight[i] <= capacity:
         lowerCamelCase_						:   Optional[int]		= 1
         max_value += value[i]
         capacity -= weight[i]
      else:
         lowerCamelCase_						:   Tuple		= capacity / weight[i]
         max_value += value[i] * capacity / weight[i]
         break

   return max_value, fractions


if __name__ == "__main__":
      import doctest

      doctest.testmod()









def    __lowerCamelCase   (      A__						: int						,						A__						: int					)     ->    int:
   return int((input_a, input_a).count(0					) == 0					)


def    __lowerCamelCase   (      )     ->    None:
   assert and_gate(0						,						0					) == 0
   assert and_gate(0						,						1					) == 0
   assert and_gate(1						,						0					) == 0
   assert and_gate(1						,						1					) == 1


if __name__ == "__main__":
      test_and_gate()
      print(and_gate(1, 0))
      print(and_gate(0, 0))
      print(and_gate(0, 1))
      print(and_gate(1, 1))





