#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const int inf = numeric_limits<int>::max() / 10;
const long double eps = 1e-9;
const long double pi = acos(-1);
template <typename T>
inline bool mineq(T& a, T b) {
  return (a > b) ? (a = b, 1) : 0;
}
template <typename T>
inline bool maxeq(T& a, T b) {
  return (a < b) ? (a = b, 1) : 0;
}
inline void solve(), read();
const string file = "";
signed main() {
  if (file != "") {
    freopen((file + ".in").c_str(), "r", stdin);
    freopen((file + ".out").c_str(), "w", stdout);
  }
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  read();
  return 0;
}
int n;
long double C, T;
vector<pair<long double, long double> > a;
vector<vector<long double> > dp;
long double sum;
void calc() {
  sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i].second;
  }
  dp.assign(n + 1, vector<long double>(sum + 1, inf));
  dp[0][0] = 0;
  for (int i = 0; i < n; i++) {
    long double st = 0.9;
    for (int j = 0; j < n; j++) {
      st *= 0.9;
    }
    for (int j = n - 1; j >= 0; j--) {
      st /= 0.9;
      for (int k = sum - a[i].second; k >= 0; k--) {
        if (mineq(dp[j + 1][k + a[i].second], dp[j][k] + a[i].first / st)) {
          continue;
        }
      }
    }
  }
}
inline long double f(long double k, long double x, long double t) {
  return 10.0 * k + dp[k][x] / (1.0 + C * t) + t;
}
long double tern(long double k, long double x) {
  long double l = 0, r = T;
  for (int i = 0; i < 80; i++) {
    long double d = (r - l) / 3;
    long double m1 = l + d, m2 = r - d;
    long double a1 = f(k, x, m1), a2 = f(k, x, m2);
    if (a2 < a1) {
      l = m1;
    } else {
      r = m2;
    }
  }
  return f(k, x, l);
}
inline void solve() {
  calc();
  int ans = 0;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= sum; j++) {
      long double cur = tern(i, j);
      if (cur < T) {
        maxeq(ans, j);
      }
    }
  }
  cout << ans << "\n";
}
inline void read() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> n >> C >> T;
    a.resize(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i].first >> a[i].second;
    }
    sort((a).begin(), (a).end(), greater<pair<int, int> >());
    solve();
  }
}
