object Main extends App {

  import scala.io.StdIn._

  val Array(n, m, k) = readLine.trim.split(' ').map(_.toInt)
  val hatake = readLine.trim.split(' ').map(_.toInt).zip(readLine.trim.split(' ').map(_.toInt)).toList
  println(
    takeRand(hatake, k).map{ l ⇒
      var potato = m
      var sum = 0
      for ((a, b) <- l.sortBy(_._1).reverse) {
        val ue = math.max(0, math.min(potato, b))
        potato -= ue
        sum += ue * a
      }
      sum + potato
    }.max
  )
  def takeRand(target: List[(Int, Int)], count: Int): List[List[(Int, Int)]] = {
    val memo = Array.tabulate(target.length + 1){_ ⇒ Array.tabulate(count){_ ⇒ None: Option[List[List[(Int, Int)]]]}}
    def rand(target: List[(Int, Int)], count: Int): List[List[(Int, Int)]] = {
      if (count == 0) Nil :: Nil
      else {
        memo(target.length)(count - 1) match {
          case None ⇒
            val res = target match {
              case Nil ⇒ Nil
              case h :: t ⇒ rand (t, count - 1).map (h :: _) ++ rand (t, count)
            }
            memo(target.length)(count - 1) = Some(res)
            res
          case Some(r) ⇒ r
        }
      }
    }
    rand(target, count)
  }
}
