#include <bits/stdc++.h>
using namespace std;
int main() {
  int aa[10000];
  int bb[10000];
  int cc[10000];
  int u = 0;
  int i = 1;
  int a = 0;
  int c = 0;
  int n = 0;
  int t = 0;
  t = c / a;
  cin >> a >> c >> n;
  int b[10000];
  int d[10000];
  double e[10000];
  e[0] = 1;
  while (true) {
    cin >> b[i] >> d[i];
    e[i] = d[i] / b[i];
    if (i > n + 1)
      break;
    else
      i++;
  }
  sort(e, e + n, greater<int>());
  while (true) {
    if (cc[u] < e[i - u] || a / c < e[u]) {
      bb[u] = (c / a) + (e[u] * a);
      cc[u] = bb[u] / 2;
      u++;
    } else
      break;
  }
  cout << cc[u] << endl;
  return 0;
}
