#include <bits/stdc++.h>
using namespace std;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const int M = 1e9 + 7;
const int N = 1e5 + 7;
const double eps = 1e-5;
int n, a, b;
double c, T;
vector<pair<int, int> > x;
void upd(double &a, double b) { a = min(a, b); }
bool can(double x, int k) {
  double l = 0, r = T;
  while (r - l > eps) {
    double m1 = l + (r - l) / (double)3;
    double m2 = r - (r - l) / (double)3;
    double s1 = 1 + c * m1;
    double s2 = 1 + c * m2;
    if (m1 + x / s1 < m2 + x / s2)
      r = m2;
    else
      l = m1;
  }
  return (l + x / (1 + c * l)) + k * 10 < T;
}
int f() {
  vector<vector<vector<double> > > dp(
      n + 2, vector<vector<double> >(n + 2, vector<double>(n * 10 + 22, 1e17)));
  dp[0][0][0] = 0;
  for (int i = 0; i < n; i++) {
    double Ss = 1;
    for (int j = 0; j <= i; j++) {
      Ss *= (double)0.9;
      for (int l = 0; l < j * 10 + 11; l++) {
        upd(dp[i + 1][j][l], dp[i][j][l]);
        upd(dp[i + 1][j + 1][l + x[i].second], dp[i][j][l] + x[i].first / Ss);
      }
    }
  }
  int res = 0;
  for (int i = n * 10; i >= 0; i--)
    for (int j = 0; j <= n; j++)
      if (can(dp[n][j][i], j)) return i;
  return -1;
}
void solve() {
  cin >> n;
  cin >> c >> T;
  x.clear();
  for (int i = 0; i < n; i++) cin >> a >> b, x.push_back({a, b});
  sort(x.rbegin(), x.rend());
  cout << f() << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
