import scala.io.StdIn._
object Main extends App {
  val Array(n, l, k) = readLine.trim.split(' ').map(_.toLong)
  val sequence = Array.tabulate(n.toInt){_ ⇒
    val Array(a, d) = readLine.trim.split(' ').map(_.toLong)
    (a, d)
  }
  val sums = sequence.map{seq ⇒ all(seq)}
  var max = 0L
  for (i ← 1 until n.toInt) sums(i) += sums(i - 1)
  for (left ← 0 until n.toInt) {
    if (k / l >= 1 && (0L until n).contains(left + k / l)) {
      val temp = sums((left + k / l).toInt - 1) - sums(left) + calMaxSum(sequence(left), sequence((left + k / l).toInt), k - l * (k / l - 1))
      if (temp > max) max = temp
    }
    if ((0L until n).contains(left + k / l + 1)) {
      val temp = sums((left + k / l).toInt) - sums(left) + calMaxSum(sequence(left), sequence((left + k / l).toInt + 1), k - l * (k / l))
      if (temp > max) max = temp
    }
  }
  if (k == l * n) max = sums.last
  println(max)
  def calMaxSum(left: (Long, Long), right: (Long, Long), length: Long): Long = {
    if (length >= l) {
      val initialDiff = right._1 + right._2 * (length % l) - left._1
      val diffDiff = right._2 - left._2
      if (initialDiff >= 0 && diffDiff < 0) {
          val shift = (initialDiff - diffDiff - 1) / -diffDiff
          if (length % l + shift >= l) sum_seq(left, length % l, right, l)
          else sum_seq(left, l - shift, right, length % l + shift)
      }else {
        math.max(sum_seq(left, l, right, length % l), sum_seq(left, length % l, right, l))
      }
    }else {
      val initialDiff = right._1 - left._1 - left._2 * (l - length)
      val diffDiff = right._2 - left._2
      if (initialDiff >= 0 && diffDiff < 0) {
        val shift = (initialDiff - diffDiff - 1) / -diffDiff
        if (length < shift) sum_seq(right, length)
        else sum_seq(left, length - shift, right, shift)
      }else {
        math.max(sum_seq(left, length, right, 0), sum_seq(left, 0, right, length))
      }
    }
  }
  def all(sequence: (Long, Long)): Long = {
    sequence._1 * l + l * (l - 1) / 2 * sequence._2
  }
  def sum_seq(left: (Long, Long), leftCount: Long, right: (Long, Long), rightCount: Long): Long = {
    sum_seq(left, l - leftCount, l) + sum_seq(right, rightCount)
  }
  def sum_seq(sequence: (Long, Long), from: Long, until: Long): Long = {
    sum_seq(sequence, until) - sum_seq(sequence, from)
  }
  def sum_seq(sequence: (Long, Long), until: Long): Long = {
    sequence._1 * until + until * (until - 1) / 2 * sequence._2
  }
}
