#include <bits/stdc++.h>
using namespace std;
int a[105];
double C, T;
int p[105];
double pre_d[105];
double dp[105][1005];
double f(int k, double tt, double it) {
  return it / (1.0 + tt * C) + 10.0 * (double)(k) + tt;
}
template <class T>
T TripleSearch(T l, T r, T lim, std::function<bool(T, T)> comp) {
  while (r - l > lim) {
    T lm = l + (r - l) / static_cast<T>(3.0);
    T rm = r - (r - l) / static_cast<T>(3.0);
    if (comp(lm, rm))
      r = rm;
    else
      l = lm;
  }
  T ans = (l + r) / static_cast<T>(2.0);
  return ans;
}
template <class T, class V>
pair<T, V> TripleSearch(T l, T r, T lim, std::function<V(T)> obj_func) {
  T ans = TripleSearch<T>(l, r, lim, [obj_func](T x, T y) -> bool {
    return obj_func(x) < obj_func(y);
  });
  return make_pair(ans, obj_func(ans));
}
double find_min(int k, double it) {
  double l = 0, r = T;
  while (r - l > 1e-6) {
    double lm = l + (r - l) / 3.0;
    double rm = r - (r - l) / 3.0;
    if (f(k, lm, it) < f(k, rm, it)) {
      r = rm;
    } else {
      l = lm;
    }
  }
  return f(k, (l + r) / 2.0, it);
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int tc, n;
  cin >> tc;
  while (tc--) {
    cin >> n;
    cin >> C >> T;
    for (int i = 1; i <= n; i++) cin >> a[i] >> p[i];
    pre_d[0] = 1.0;
    for (int i = 1; i <= n; i++) pre_d[i] = pre_d[i - 1] * 0.9;
    for (int i = 1; i <= n; i++) {
      for (int j = i + 1; j <= n; j++) {
        if (a[i] < a[j]) {
          swap(a[i], a[j]);
          swap(p[i], p[j]);
        }
      }
    }
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= 1000; j++) dp[i][j] = 1e18;
    dp[0][0] = 0;
    int s = 0;
    for (int i = 1; i <= n; i++) {
      s += p[i];
      for (int k = n; k > 0; k--) {
        for (int j = s; j >= p[i]; j--) {
          dp[k][j] =
              min(dp[k - 1][j - p[i]] + (double)(a[i]) / pre_d[k], dp[k][j]);
        }
      }
    }
    int ans = 0;
    for (int j = s; j > 0; j--) {
      for (int k = 1; k <= n; k++) {
        double it = dp[k][j];
        if (TripleSearch<double, double>(
                0, T, 1e-6,
                [k, it](double tt) -> double { return f(k, tt, it); })
                .second < T) {
          ans = j;
          break;
        }
      }
      if (ans != 0) break;
    }
    cout << ans << endl;
  }
}
