#include <bits/stdc++.h>
const int N = 105, P = 10;
const double inf = 1. / 0;
int n, a[N], p[N], rk[N];
double c, t;
double dp[N][N * P];
void down(double &x, double y) { x = std::min(x, y); }
void solve() {
  std::cin >> n >> c >> t;
  int now = 0, sum = 0;
  for (int i = 0; i < n; ++i) std::cin >> a[i] >> p[i], rk[i] = i, sum += p[i];
  std::sort(rk, rk + n, [](int x, int y) { return a[x] < a[y]; });
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= sum; ++j) dp[i][j] = inf;
  dp[0][0] = 0;
  for (int i = 0; i < n; ++i) {
    int a = ::a[rk[i]], p = ::p[rk[i]];
    for (int j = now; ~j; --j)
      for (int k = i; ~k; --k) down(dp[k + 1][j + p], (dp[k][j] + a) / 0.9);
    now += p;
  }
  for (int j = sum; j; --j) {
    for (int i = 0; i <= n; ++i)
      if (dp[i][j] != inf) {
        if (t - 10 * i < 0) continue;
        double a = c * dp[i][j], b = c * (t - 10 * i) + 1;
        bool ok;
        if (a >= 1)
          ok = 4 * a <= b * b;
        else
          ok = a + 1 <= b;
        if (ok) return std::cout << j << '\n', void(0);
      }
  }
  std::cout << "0\n";
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0);
  int tc;
  std::cin >> tc;
  while (tc--) solve();
  return 0;
}
