#include <bits/stdc++.h>
using namespace std;
const int N = 105, M = 1005;
int n, m, T, ans;
double c, t;
double pw[N], dp[N][M], b[N][N];
pair<double, int> a[N];
bool cmp(pair<double, int> x, pair<double, int> y) { return x.first > y.first; }
void mini(double &x, double y) {
  if (x > y) x = y;
}
double tim(double sum, double i) {
  double x = max(0., (sqrt(sum * c) - 1.) / c);
  double ans = x + sum / (1. + c * x) + i * 10.;
  return ans;
}
int main() {
  pw[0] = 1;
  for (int i = pw[0] = 1; i <= 100; i++) pw[i] = pw[i - 1] / 0.9;
  scanf("%d", &T);
  while (T--) {
    scanf("%d%lf%lf", &n, &c, &t);
    m = 0;
    for (int i = 1; i <= n; i++)
      scanf("%lf%d", &a[i].first, &a[i].second), m += a[i].second;
    sort(a + 1, a + n + 1, cmp);
    for (int i = 0; i <= n; i++)
      for (int j = 0; j <= m; j++) dp[i][j] = 1e12;
    dp[0][0] = 0;
    for (int i = 1; i <= n; i++)
      for (int j = 0; j <= n; j++) b[i][j] = a[i].first * pw[j];
    for (int i = 1; i <= n; i++)
      for (int j = i; j--;)
        for (int k = m - a[i].second; k >= 0; k--)
          mini(dp[j + 1][k + a[i].second], dp[j][k] + b[i][j + 1]);
    for (int j = m; j >= 0; j--)
      for (int i = 0; i <= n; i++)
        if (tim(dp[i][j], i) <= t) {
          ans = j;
          goto o;
        }
  o:;
    printf("%d\n", ans);
  }
}
