#include <bits/stdc++.h>
using namespace std;
int n, a[101], p[101], id[101], sump;
double c, T, remainSkill[101];
double dp[101][101 * 10];
void Prepare() {
  remainSkill[0] = 1;
  for (int i = (1); i <= (n); ++i) remainSkill[i] = remainSkill[i - 1] * 0.9;
  for (int i = (0); i <= (n); ++i)
    for (int j = (0); j <= (sump); ++j) dp[i][j] = 1e18;
  dp[0][0] = 0;
  for (int i = (1); i <= (n); ++i) {
    for (int j = (i); j >= (1); --j) {
      for (int k = (0); k <= (sump); ++k) {
        if (p[id[i]] <= k) {
          dp[j][k] = min(dp[j][k], dp[j - 1][k - p[id[i]]] +
                                       1.0 * a[id[i]] / remainSkill[j]);
        }
      }
    }
  }
}
double val(double t, int cntProblems, int Points) {
  return t + 10.0 * cntProblems + dp[cntProblems][Points] / (c * t + 1);
}
void Solve() {
  cin >> n;
  cin >> c >> T;
  sump = 0;
  for (int i = (1); i <= (n); ++i) {
    cin >> a[i] >> p[i];
    id[i] = i;
    sump += p[i];
  }
  sort(id + 1, id + n + 1, [](int x, int y) { return a[x] > a[y]; });
  Prepare();
  for (int Points = (sump); Points >= (1); --Points)
    for (int cntProblems = (1); cntProblems <= (n); ++cntProblems)
      if (dp[cntProblems][Points] != 1e18) {
        double l = 0, r = T;
        for (int loop = 0; loop < (100); ++loop) {
          double m1 = (l + l + r) / 3;
          double m2 = (l + r + r) / 3;
          if (val(m1, cntProblems, Points) >= val(m2, cntProblems, Points)) {
            l = m1;
          } else
            r = m2;
        }
        if (val(l, cntProblems, Points) <= T) {
          cout << Points << '\n';
          return;
        }
      }
  cout << 0 << '\n';
}
int main() {
  srand(time(NULL));
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int test;
  cin >> test;
  while (test--) Solve();
}
