#include <bits/stdc++.h>
using namespace std;
const int N = 101;
int n, m, a[N], p[N];
double f[2][N][1001];
double C, T, z[N];
void update(double &x, double y) { x = min(x, y); }
int work() {
  cin >> n;
  z[0] = 1;
  for (int i(0); i < (int)(n); i++) z[i + 1] = z[i] / 0.9;
  double inf = 1e9 * z[n];
  cin >> C >> T;
  for (int i(0); i < (int)(n); i++) cin >> a[i] >> p[i];
  for (int i(0); i < (int)(n); i++)
    for (int j(0); j < (int)(i); j++)
      if (a[i] > a[j] || a[i] == a[j] && p[i] > p[j])
        swap(a[i], a[j]), swap(p[i], p[j]);
  int o = 0, e = 1;
  for (int i(0); i < (int)(11); i++) f[o][0][i] = inf;
  f[o][0][0] = 0;
  for (int w(0); w < (int)(n); w++) {
    for (int i(0); i < (int)(w + 2); i++)
      for (int j(0); j < (int)(i * 10 + 1); j++) f[e][i][j] = inf;
    for (int i(0); i < (int)(w + 1); i++)
      for (int j(0); j < (int)(i * 10 + 1); j++)
        if (f[o][i][j] < inf) {
          update(f[e][i][j], f[o][i][j]);
          update(f[e][i + 1][j + p[w]], f[o][i][j] + a[w] * z[i + 1]);
        }
    swap(o, e);
  }
  int ans = 0;
  for (int i(0); i < (int)(n + 1); i++)
    for (int j(0); j < (int)(i * 10 + 1); j++)
      if (f[o][i][j] < inf) {
        double t = max(0.0, (sqrt(f[o][i][j] * C) - 1) / C);
        double x = t + f[o][i][j] / (C * t + 1) + 10 * i;
        if (x <= T) ans = max(ans, j);
      }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  int tc;
  cin >> tc;
  for (int t(0); t < (int)(tc); t++) cout << work() << endl;
  return 0;
}
