output_description: If Takahashi can calculate A \times B, print the result; if he cannot, print
  `-1`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B
attempt: n, k = map(int, input().split())
  
  a = list(map(int, input().split()))
  f = list(map(int, input().split()))
  a = sorted(a)
  f = sorted(f, reverse=True)
  
  l = -1
  r = 10**12
  
  
  def ok():
      s = 0
      for i in range(n):
          s += max(0, int(int(a[i]) - int(c / f[i])))
      return s <= k
  
  
  while l + 1 < r:
      c = int((l + r) / 2)
      if ok():
          r = c
      else:
          l = c
  print(r)
  
problem_description: Statement
  
  Having learned the multiplication table, Takahashi can multiply two integers
  between 1 and 9 (inclusive) together. He cannot do any other calculation.
  
  Given are two integers A and B.
  
  If Takahashi can calculate A \times B, print the result; if he cannot, print
  `-1` instead.
samples: [{"input": "2 5", "output": "10\n    \n\n2 \\times 5 = 10.\n\n* * *"}, {"input": "5 10", "output": "-1\n    \n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print `-1`\ninstead.\n\n* * *"}, {"input": "9 9", "output": "81"}]