#include <bits/stdc++.h>
using namespace std;
int a[100];
int p[100];
int idx[100];
bool cmp(int aa, int bb) { return a[aa] < a[bb]; }
double dp[104][1004];
int n;
double C, T;
bool pr = false;
void solve() {
  scanf("%d%lf%lf", &n, &C, &T);
  for (int i = 0; i < n; ++i) {
    idx[i] = i;
    scanf("%d%d", &a[i], &p[i]);
  }
  sort(idx, idx + n, cmp);
  for (int j = 0; j <= 100; ++j) {
    for (int i = 0; i <= 1000; ++i) {
      dp[j][i] = 1e100;
    }
  }
  dp[0][0] = 0;
  for (int i = 0; i < n; ++i) {
    int aa = a[idx[i]];
    int pp = p[idx[i]];
    for (int k = 99; k >= 0; --k) {
      for (int j = 0; j <= 1000 - pp; ++j) {
        double d = (dp[k][j] + aa) * 10. / 9.;
        if (dp[k + 1][j + pp] > d) {
          dp[k + 1][j + pp] = d;
        }
      }
    }
  }
  for (int j = 1000; j >= 0; --j) {
    for (int k = 0; k <= 100; ++k) {
      double TT, t;
      if (dp[k][j] * C < 1.)
        TT = k * 10 + dp[k][j];
      else
        TT = k * 10 + 2 * sqrt(dp[k][j] / C) - 1. / C;
      if (TT < T) {
        printf("%d\n", j, TT);
        return;
      }
    }
  }
  printf("%d\n", 0);
}
int main() {
  int tc;
  scanf("%d", &tc);
  for (int i = 0; i < tc; ++i) solve();
  return 0;
}
