#include<bits/stdc++.h>

using namespace std;

template< class T >
struct CumulativeSum
{
  vector< T > data;

  CumulativeSum(int sz) : data(sz, 0) {};

  void add(int k, T x)
  {
    data[k] += x;
  }

  void build()
  {
    for(int i = 1; i < data.size(); i++) {
      data[i] += data[i - 1];
    }
  }

  T query(int k)
  {
    if(k < 0) return (0);
    return (data[min(k, (int) data.size() - 1)]);
  }
};

typedef long long int64;

int main()
{
  int64 N, L, K, A[100000], D[100000];

  cin >> N >> L >> K;
  for(int i = 0; i < N; i++) {
    cin >> A[i] >> D[i];
  }

  auto getSum = [&](int64 a, int64 l, int64 d)
  {
    return ((2 * a + (l - 1) * d) * l / 2);
  };

  CumulativeSum< int64 > sum(N);
  for(int i = 0; i < N; i++) {
    sum.add(i, getSum(A[i], L, D[i]));
  }
  sum.build();

  int64 ret = numeric_limits< int64 >::min();

  auto check = [&](int64 st)
  {
    int64 ed = st + K - 1;
    int64 range = sum.query(ed / L - 1) - sum.query(st / L);
    int64 st_index = st / L, ed_index = ed / L;
    st %= L, ed %= L;
    range += getSum(A[st_index] + D[st_index] * st, L - st, D[st_index]);
    range += getSum(A[ed_index], ed + 1, D[ed_index]);
    return (range);
  };

  for(int64 i = 0; i < N; i++) {
    int64 low = i * L, high = min(N * L - K + 1, i * L + L);
    if(low >= high) break;
    while(high - low > 1) {
      int64 mid = (low + high) >> 1LL;
      if(check(mid) - check(mid - 1) > 0) low = mid;
      else high = mid;
    }
    ret = max(ret, check(low));
  }
  cout << ret << endl;
}