#include <bits/stdc++.h>
using namespace std;
const int N = 102, NP = N * 12;
int n, q;
long double C, T, dp[N][NP], dpt[N][NP];
inline long double Get(long double _dp, long double t) {
  return (_dp / (C * t + 1) + t);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> q;
  while (q--) {
    cin >> n >> C >> T;
    vector<pair<int, int> > A;
    for (int i = 1; i <= n; i++) {
      int a, p;
      cin >> a >> p;
      A.push_back({a, p});
    }
    for (int i = 0; i < N; i++)
      for (int j = 0; j < NP; j++) dp[i][j] = dpt[i][j] = 1e18;
    dp[0][0] = 0;
    sort(A.begin(), A.end());
    int sum = 0;
    for (int i = 0; i < n; i++) {
      sum += A[i].second;
      for (int h = 1; h <= i + 1; h++)
        for (int j = A[i].second; j <= sum; j++)
          dpt[h][j] = (dp[h - 1][j - A[i].second] + A[i].first) *
                      (long double)10 / (long double)9;
      for (int h = 1; h <= i + 1; h++)
        for (int j = sum; j >= 0; j--) {
          if (j >= A[i].second) dp[h][j] = min(dp[h][j], dpt[h][j]);
          dp[h][j] = min(dp[h][j], dp[h][j + 1]);
        }
    }
    int Mx = 0;
    for (int j = 1; j <= n; j++)
      for (int i = sum; i; i--) {
        if (dp[j][i] >= 1e11) continue;
        if (i <= Mx) continue;
        long double TT = T - 10.0 * j;
        if (TT < 0) continue;
        long double le = 0, ri = TT, md1, md2;
        if (Get(dp[j][i], 0.0) <= TT) {
          Mx = max(Mx, i);
          continue;
        }
        for (int tst = 1; tst <= 80; tst++) {
          md1 = (le + le + ri) / 3;
          md2 = (le + ri + ri) / 3;
          if (Get(dp[j][i], md1) < Get(dp[j][i], md2))
            ri = md2;
          else
            le = md1;
        }
        if (Get(dp[j][i], le) <= TT) Mx = max(Mx, i);
      }
    cout << Mx << endl;
  }
  return (0);
}
