let nk = stdin.ReadLine().Split() |> Array.map int64
let a = stdin.ReadLine().Split() |> Array.map int |> Array.sort
let f = stdin.ReadLine().Split() |> Array.map int |> Array.sort
let n = (nk.[0] |> int)

let set_a = Set.ofList [for i in 1..n do yield (f.[i - 1] * a.[n - i],a.[n - i],i)]

let rec g set count =
 let (x,y,z) as xyz = Set.maxElement set
 match count with
 |0L -> set
 |_ -> if x = 0 then set else
       let set1 = Set.remove xyz set
       let set2 = Set.add (x / y * (y - 1),y - 1,z) set1
       g set2 (count - 1L)

let last = g set_a nk.[1]
let (x,y,z) = Set.maxElement last

x
|>stdout.WriteLine