#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60777216")
using namespace std;
double d[101][1001];
double pw[101];
pair<int, int> a[101];
int n;
double c, t;
int main() {
  pw[0] = 1 / 0.9;
  for (int i = (1); i < (101); i++)
    pw[i] = pw[i - 1] / 0.9, pw[i] = min(pw[i], 1e10);
  int tc;
  cin >> tc;
  for (int TC = (0); TC < (tc); TC++) {
    cin >> n;
    cin >> c >> t;
    for (int i = (0); i < (n); i++) cin >> a[i].first >> a[i].second;
    sort(a, a + n);
    reverse(a, a + n);
    double v;
    for (int i = (0); i < (101); i++)
      for (int j = (0); j < (1001); j++) d[i][j] = -1;
    d[0][0] = 0;
    for (int i = (0); i < (n); i++) {
      for (int j = i; j >= 0; j--)
        for (int k = (j); k < (10 * j + 1); k++)
          if ((v = d[j][k]) >= 0) {
            double &r = d[j + 1][k + a[i].second];
            if (r < 0 || r > v + a[i].first * pw[j]) r = v + a[i].first * pw[j];
          }
    }
    int res = 0;
    for (int i = (0); i < (101); i++)
      for (int j = (0); j < (1001); j++)
        if ((v = d[i][j]) >= 0) {
          double rt = t - i * 10;
          if (v <= rt) res = max(res, j);
          double x = -(1 - rt * c) / 2 / c;
          if (x >= 0 && x <= rt) {
            if (v / (1 + c * x) <= rt - x) {
              res = max(res, j);
            }
          }
        }
    cout << res << endl;
  }
  return 0;
}
