#include <bits/stdc++.h>
const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};
const int N = 105;
const double INF = 1e9 + 228.0;
const double eps = 1e-9;
using namespace std;
double dp[N][N][N * 10], f[N];
pair<int, int> a[N];
void solve() {
  int n;
  scanf("%d", &n);
  double c, T;
  scanf("%lf%lf", &c, &T);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a[i].first, &a[i].second);
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  f[0] = 1.0;
  for (int i = 1; i <= n; i++) f[i] = f[i - 1] * 0.9;
  int sum = 0;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= n; j++)
      for (int k = 0; k <= n * 10; k++) dp[i][j][k] = INF;
  dp[0][0][0] = 0.0;
  for (int i = 1; i <= n; i++) {
    sum += a[i].second;
    for (int j = 0; j <= i; j++) {
      for (int k = 0; k <= sum; k++) {
        dp[i][j][k] = dp[i - 1][j][k];
        if (j > 0 && k >= a[i].second)
          dp[i][j][k] = min(dp[i][j][k], dp[i - 1][j - 1][k - a[i].second] +
                                             1.0 * a[i].first / f[j]);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= sum; j++) {
      double l = 0.0;
      double r = T;
      for (int k = 0; k <= 100; k++) {
        double tl = l + (r - l) / 3.0;
        double tr = l + 2.0 * (r - l) / 3.0;
        if (tl + 10.0 * i + dp[n][i][j] / (1.0 + tl * c) >
            tr + 10.0 * i + dp[n][i][j] / (1.0 + tr * c))
          l = tl;
        else
          r = tr;
      }
      if (l + 10.0 * i + dp[n][i][j] / (1.0 + l * c) < T + 0.001)
        ans = max(ans, j);
    }
  }
  printf("%d\n", ans);
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) solve();
  return 0;
}
