#include <bits/stdc++.h>
using namespace std;
const double EPS = 1E-9;
const int MAXN = 110;
const int MAXP = 1010;
double degs[MAXN];
int n;
double c, t;
int a[MAXN], p[MAXN];
double cdp[MAXP][MAXN];
double ndp[MAXP][MAXN];
double Eval(double fix, double mod, double t) {
  return fix + t + mod / (1 + c * t);
}
bool CanFit(double tim, int tasks) {
  if (tim < t + EPS) return true;
  double fix = 10 * tasks;
  double mod = tim - fix;
  if (fix > t + EPS) return false;
  double tlo = 0, thi = t - fix;
  double m1, m2;
  for (int step = 0; step < 100; ++step) {
    m1 = (2 * tlo + thi) / 3;
    m2 = (tlo + 2 * thi) / 3;
    double v1 = Eval(fix, mod, m1);
    double v2 = Eval(fix, mod, m2);
    if (v1 < t + EPS) return true;
    if (v2 < t + EPS) return true;
    if (v1 < v2)
      thi = m2;
    else
      tlo = m1;
  }
  return false;
}
int Solve() {
  for (int i = 0; i < MAXP; ++i)
    for (int j = 0; j < MAXN; ++j) cdp[i][j] = -2;
  scanf("%d", &n);
  cin >> c >> t;
  for (int i = 0; i < n; ++i) scanf("%d%d", &a[i], &p[i]);
  vector<pair<int, int> > nal;
  for (int i = 0; i < n; ++i) nal.push_back(make_pair(a[i], p[i]));
  sort(nal.begin(), nal.end());
  reverse(nal.begin(), nal.end());
  int tot_p = 0;
  int tot_t = 0;
  cdp[0][0] = 0;
  for (const auto& e : nal) {
    int give = e.second;
    int cost = e.first;
    tot_p += give;
    tot_t += 1;
    for (int i = tot_p; i - give >= 0; --i)
      for (int j = tot_t; j > 0; --j) {
        if (cdp[i - give][j - 1] < -1) continue;
        double tim = cdp[i - give][j - 1] + cost / degs[j] + 10;
        if (cdp[i][j] < -1)
          cdp[i][j] = tim;
        else
          (cdp[i][j]) = min((cdp[i][j]), (tim));
      }
  }
  for (int p = tot_p; p > 0; --p) {
    for (int t = 0; t <= tot_t; ++t) {
      if (cdp[p][t] < -1) continue;
      if (CanFit(cdp[p][t], t)) {
        return p;
      }
    }
  }
  return 0;
}
int main() {
  degs[0] = 1.0;
  for (int i = 1; i < MAXN; ++i) degs[i] = 0.9 * degs[i - 1];
  int q;
  scanf("%d", &q);
  while (q-- > 0) {
    printf("%d\n", Solve());
  }
  return 0;
}
