#include <bits/stdc++.h>
using namespace std;
int Casi;
int N;
double C, T;
double f[110][110][1010];
pair<int, int> p[110];
double po[110];
void upd(double &tar, double x) { tar = min(tar, x); }
double ff(double t0, double t) { return t0 / (1 + C * t) + t; }
int main() {
  po[0] = 1;
  for (int i = 1; i <= 100; i++) po[i] = po[i - 1] * 0.9;
  scanf("%d", &Casi);
  while (Casi--) {
    scanf("%d", &N);
    scanf("%lf%lf", &C, &T);
    for (int i = 1; i <= N; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      p[i] = pair<int, int>(u, v);
    }
    sort(p + 1, p + N + 1);
    reverse(p + 1, p + N + 1);
    for (int i = 0; i <= N; i++)
      for (int j = 0; j <= N; j++)
        for (int k = 0; k <= 10 * N; k++) f[i][j][k] = 1e50;
    f[0][0][0] = 0;
    int S = 0;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j <= i; j++)
        for (int k = 0; k <= S; k++) {
          f[i + 1][j][k] = f[i][j][k];
        }
      for (int j = 0; j <= i; j++)
        for (int k = 0; k <= S; k++) {
          upd(f[i + 1][j + 1][k + p[i + 1].second],
              f[i][j][k] + p[i + 1].first / po[j + 1]);
        }
      S += p[i + 1].second;
    }
    for (int j = S; j >= 1; j--)
      for (int i = 0; i <= N; i++) {
        double TT = T - 10 * i;
        if (TT < 0) continue;
        double t0 = f[N][i][j];
        double ans = min(ff(t0, 0), ff(t0, TT));
        double x = (sqrt(C * t0) - 1) / C;
        if (x > 0 && x <= TT) ans = min(ans, ff(t0, x));
        if (ans <= TT) {
          printf("%d\n", j);
          goto END;
        }
      }
    puts("0");
  END:
    int hah = 0;
  }
}
