import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
import scala.reflect.ClassTag

object Main extends App {

  import scala.io.StdIn._

  implicit object G extends Group[Int] {
    override def plus(a: Int, b: Int): Int = a + b

    override def minus(a: Int, b: Int): Int = a - b

    override def times(a: Int, b: Int): Int = a * b

    override def maxSentinel: Int = Int.MaxValue

    override def zero: Int = 0
  }
  solve
  def solve: Unit = {
    val Array(n, m, k) = readLine.trim.split(' ').map(_.toInt)
    val ikaScore = readLine.trim.split(' ').map(_.toInt)
    if (m == 0) {
      println(ikaScore.sum)
    } else {
      val friendsScores = Array.tabulate(m) { _ ⇒ readLine.trim.split(' ').map(_.toInt) }
      val t = readLine.trim.split(' ').map(_.toInt)
      val edges = ArrayBuffer[(Int, Int, Int, Int)]()
      for (i ← friendsScores.indices) {
        edges.append((m + n, i, t(i), 0))
      }
      for (i ← friendsScores.indices; j ← ikaScore.indices if ikaScore(j) < friendsScores(i)(j)) {
        edges.append((i, m + j, 1, ikaScore(j) - friendsScores(i)(j)))
      }
      for (j ← ikaScore.indices) {
        edges.append((m + j, m + n + 1, 1, 0))
      }
      println(ikaScore.sum - minCostFlow(m + n, m + n + 1, m + n + 2, edges.toArray, n - k))
    }
  }
  implicit class Extend[T](value: T){
    def let[R](func: T ⇒ R): R = func(value)
    def also(func: T ⇒ Unit): T = {func(value); value}
  }

  trait Group[N]{
    def plus(a: N, b: N): N
    def minus(a: N, b: N): N
    def times(a: N, b: Int): N
    def maxSentinel: N
    def zero: N
  }

  private case class Edge[N](to: Int, capacity: Int, pair: Int, cost: N)
  //edge => (from, to, capacity, cost)
  def minCostFlow[N : ClassTag](source: Int, drain: Int, size: Int, edge: Array[(Int, Int, Int, N)], flowLimit: Int = Int.MaxValue)(implicit m: Group[N], o: Ordering[N]): N = {
    val edges = makeGraph(size, edge)
    val potential = Array.tabulate(size){_ ⇒ m.maxSentinel}
    for (e ← edges) for (Edge(to, cap, _, c) ← e if cap > 0 && o.compare(potential(to), c) > 0) potential(to) = c
    potential(source) = m.zero
    potential(drain) = m.zero
    val prevEdge = Array.tabulate(size){_ ⇒ (Edge(-1, -1, -1, m.zero), Int.MaxValue)}
    val minCost = Array.tabulate(size){_ ⇒ m.maxSentinel}
    val queue = mutable.PriorityQueue()(Ordering.by[(Int, N), N](_._2).reverse)
    var canMatch = true
    var result = m.zero
    var restFlow = flowLimit
    while(canMatch) {
      canMatch = false
      queue.enqueue((source, m.zero))
      minCost.indices.foreach(i ⇒ minCost(i) = m.maxSentinel)
      minCost(source) = m.zero
      while(queue.nonEmpty){
        val (prev, cost) = queue.dequeue()
        if (prev != drain && o.compare(minCost(prev), cost) == 0){
          for (e@Edge(to, cap, pair, c) ← edges(prev) if cap > 0){
            //minCost(to) > potential(prev) + c - potential(to) + cost
            if (o.equiv(minCost(to), m.maxSentinel) || o.compare(m.minus(m.minus(minCost(to), potential(prev)), cost), m.minus(c, potential(to))) > 0) {
              minCost(to) = m.plus(m.minus(potential(prev), potential(to)), m.plus(c, cost))
              prevEdge(to) = (edges(to)(pair), math.min(prevEdge(prev)._2, cap))
              queue.enqueue((to, minCost(to)))
            }
          }
        }
      }
      if (minCost(drain) != m.maxSentinel && o.gt(m.zero, minCost(drain))) {
        canMatch = true
        var last = drain
        val bottleNeck = prevEdge(drain)._2
        var current = minCost(drain)
        while (last != source) {
          val (r, _) = prevEdge(last)
          val e = edges(r.to)(r.pair)
          edges(last)(e.pair) = r.copy(capacity = r.capacity + bottleNeck)
          edges(r.to)(r.pair) = e.copy(capacity = e.capacity - bottleNeck)
          last = r.to
        }
        if (bottleNeck > restFlow) {
          result = m.plus(result, m.times(current, restFlow))
          canMatch = false
        } else {
          restFlow -= bottleNeck
          result = m.plus(result, m.times(current, bottleNeck))
        }
        for (x ← 0 until size if x != source && x != drain){
          potential(x) = m.plus(potential(x), minCost(x))
        }
      }
    }
    result
  }
  private def makeGraph[N](size: Int, edge: Array[(Int, Int, Int, N)])(implicit m: Group[N]): Array[Array[Edge[N]]] = {
    val nodes = Array.tabulate(size){_ ⇒ ArrayBuffer[Edge[N]]()}
    for ((from, to, capacity, cost) ← edge){
      nodes(from).append(Edge(to, capacity, nodes(to).length, cost))
      nodes(to).append(Edge(from, 0, nodes(from).length - 1, m.minus(m.zero, cost)))
    }
    nodes.map{_.toArray}
  }
}


Measured memory_bytes: 69688