#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10, MOD = 1e9 + 7;
long double dp[N][N][N * 10], pw[N], C, T;
int t, n;
pair<int, int> A[N];
void Solve() {
  cin >> n >> C >> T;
  for (int i = 1; i <= n; i++) scanf("%d%d", &A[i].first, &A[i].second);
  sort(A + 1, A + n + 1, greater<pair<int, int> >());
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      for (int k = 0; k <= 10 * n; k++) dp[i][j][k] = 1e18;
  dp[0][0][0] = 0;
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += A[i].second;
    for (int j = 0; j <= n; j++) {
      for (int k = 0; k <= sum; k++) {
        dp[i][j][k] = dp[i - 1][j][k];
        if (j && A[i].second <= k) {
          dp[i][j][k] =
              min(dp[i][j][k], dp[i - 1][j - 1][k - A[i].second] +
                                   (long double)1.0 * A[i].first / pw[j]);
        }
      }
    }
  }
  int res = 0;
  for (int i = 0; i <= n * 10; i++) {
    for (int j = 0; j <= n; j++) {
      long double l = 0, r = T;
      for (int _ = 0; _ < 30; _++) {
        long double mid1 = (2.0 * l + r) / 3.0, mid2 = (2.0 * r + l) / 3.0;
        long double x = mid1 + dp[n][j][i] / (1.0 + C * mid1);
        long double y = mid2 + dp[n][j][i] / (1.0 + C * mid2);
        if (x >= y)
          l = mid1;
        else
          r = mid2;
      }
      if (10.0 * j + l + dp[n][j][i] / (1.0 + C * l) <= T) res = max(res, i);
    }
  }
  printf("%d\n", res);
}
int main() {
  pw[0] = 1;
  for (int i = 1; i < N; i++) {
    pw[i] = pw[i - 1] * .9;
  }
  for (scanf("%d", &t); t; t--) {
    Solve();
  }
  return 0;
}
