#include <bits/stdc++.h>
using namespace std;
void relax(double& a, double b) { a = min(a, b); }
pair<int, int> a[100];
double X[101];
double dp[1001][101];
double aa[100];
void solve() {
  int n;
  double C, T;
  ignore = scanf("%d %lf %lf", &n, &C, &T);
  for (int i = 0; i < n; i++) {
    ignore = scanf("%d %d", &a[i].first, &a[i].second);
  }
  sort(a, a + n);
  reverse(a, a + n);
  for (int k = 1; k <= n; k++) {
    double t0 = (T * C - 10.0 * k * C - 1.0) / (2.0 * C);
    if (t0 < 0) t0 = 0;
    X[k] = -C * t0 * t0 + (T * C - 10.0 * k * C - 1.0) * t0 + T - 10.0 * k;
  }
  for (int i = 0; i < 1001; i++) {
    for (int j = 0; j < 101; j++) {
      dp[i][j] = 1000000000000000;
    }
  }
  dp[0][0] = 0;
  int maxP = 0;
  for (int i = 0; i < n; i++) {
    aa[0] = a[i].first / 0.9;
    for (int j = 1; j <= i; j++) {
      aa[j] = aa[j - 1] / 0.9;
    }
    int PP = a[i].second;
    for (int cnt = i; cnt >= 0; cnt--) {
      for (int p = maxP; p >= 0; p--) {
        relax(dp[p + PP][cnt + 1], dp[p][cnt] + aa[cnt]);
      }
    }
    maxP += PP;
  }
  int ans = 0;
  for (int cnt = 1; cnt <= n; cnt++) {
    for (int p = 1; p <= maxP; p++) {
      if (dp[p][cnt] < X[cnt] + 0.00001) {
        ans = max(ans, p);
      }
    }
  }
  printf("%d\n", ans);
}
int main() {
  int tc;
  ignore = scanf("%d", &tc);
  while (tc--) {
    solve();
  }
}
