#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long INF = 1e18L + 7;
template <class n, class second>
ostream &operator<<(ostream &p, pair<n, second> x) {
  return p << "<" << x.first << ", " << x.second << ">";
}
template <class n>
auto operator<<(ostream &p, n y) ->
    typename enable_if<!is_same<n, string>::value,
                       decltype(y.begin(), p)>::type {
  int o = 0;
  p << "{";
  for (auto c : y) {
    if (o++) p << ", ";
    p << c;
  }
  return p << "}";
}
void dor() { cerr << '\n'; }
template <class n, class... second>
void dor(n p, second... y) {
  cerr << p << " ";
  dor(y...);
}
template <class n, class second>
void mini(n &p, second y) {
  if (p > y) p = y;
}
template <class n, class second>
void maxi(n &p, second y) {
  if (p < y) p = y;
}
const int N = 107;
int n;
double T, C;
int a[N];
int p[N];
double coef[N];
double dp[N][10 * N];
void add(int ind) {
  for (int i = n - 1; i >= 0; --i) {
    double add = a[ind] * coef[i + 1];
    for (int j = 0; j <= 10 * i; ++j) {
      dp[i + 1][j + p[ind]] = min(dp[i + 1][j + p[ind]], dp[i][j] + add);
    }
  }
}
inline double calc(double t, double sum, int ile) {
  return T + T * C * t - t - C * t * t - sum - (1 + C * t) * 10 * ile;
}
bool ok(double sum, int ile) {
  double l = 0, r = T;
  for (int i = 0; i < 60; ++i) {
    double m1 = 2.0 / 3 * l + 1.0 / 3 * r;
    double m2 = 1.0 / 3 * l + 2.0 / 3 * r;
    double c1 = calc(m1, sum, ile);
    double c2 = calc(m2, sum, ile);
    if (c1 > 0 || c1 > 0) return 1;
    if (c1 > c2)
      r = m2;
    else
      l = m1;
  }
  return calc(l, sum, ile) > 0;
}
void solve() {
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < 10 * N; ++j) {
      dp[i][j] = 1e18;
    }
  }
  dp[0][0] = 0;
  cin >> n >> C >> T;
  vector<int> kol;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i] >> p[i];
    kol.push_back(i);
  }
  sort((kol).begin(), (kol).end(), [](int p, int q) { return a[p] > a[q]; });
  for (auto it : kol) {
    add(it);
  }
  int ans = 0;
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= 10 * i; ++j) {
      if (ok(dp[i][j], i)) ans = max(ans, j);
    }
  }
  cout << ans << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  coef[0] = 1;
  for (int i = 1; i < N; ++i) {
    coef[i] = 10.0 / 9 * coef[i - 1];
  }
  int tc;
  cin >> tc;
  while (tc--) solve();
}
