#include <bits/stdc++.h>
using namespace std;
int solve();
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  cin >> q;
  while (q--) solve();
  return 0;
}
const int MAXN = 101;
const double INF = 1e18;
pair<int, int> a[MAXN];
double dp[MAXN][MAXN][MAXN * 10];
double pows[MAXN];
int solve() {
  int n;
  cin >> n;
  double C, T;
  cin >> C >> T;
  for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n / 2; i++) swap(a[i], a[n - i + 1]);
  pows[0] = 1.0;
  for (int i = 1; i <= n; i++) pows[i] = pows[i - 1] * 10.0 / 9.0;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      for (int c = 0; c <= 10 * n; c++) dp[i][j][c] = INF;
  for (int i = 0; i <= n; i++) dp[i][0][0] = 0.0;
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= i; j++)
      for (int sum = 0; sum <= 10 * j; sum++) {
        dp[i][j][sum] = dp[i - 1][j][sum];
        if (sum - a[i].second >= 0)
          dp[i][j][sum] =
              min(dp[i][j][sum],
                  dp[i - 1][j - 1][sum - a[i].second] + a[i].first * pows[j]);
        if (dp[i][j][sum] + 10 * j <= T) ans = max(ans, sum);
        double t = (-1.0 + sqrt(C * dp[i][j][sum])) / C;
        if (t > 0.0 && t + dp[i][j][sum] / (C * t + 1.0) + 10 * j <= T) {
          ans = max(ans, sum);
        }
      }
  cout << ans << endl;
  return 0;
}
