#include <bits/stdc++.h>
using std::max;
using std::min;
using std::sort;
const int MAXN = 111, MAXV = 10;
const double eps = 1e-9;
int Tests;
int N;
int Ans;
double ss[MAXN];
double C, T;
struct Prob {
  int Diff, Val;
} P[MAXN];
inline bool operator<(const Prob &A, const Prob &B) { return A.Diff > B.Diff; }
double F[MAXN][MAXN * MAXV];
double Calc(int p, int d) { return (double)(d) / ss[p]; }
double Val(double v, double t) { return v / (1.0 + C * t) + t; }
bool Test(int c, double v) {
  double l = 0.0, r = T, ml, mr;
  while (r - l > eps) {
    ml = (l * 2.0 + r) / 3.0;
    mr = (l + r * 2.0) / 3.0;
    if (Val(v, ml) < Val(v, mr))
      r = mr;
    else
      l = ml;
  }
  return Val(v, (l + r) / 2.0) <= T - 10.0 * c;
}
inline void relax(double &f, double v) { f = min(f, v); }
int main() {
  scanf("%d", &Tests);
  while (Tests--) {
    scanf("%d", &N);
    ss[0] = 1.0;
    for (int i = 1; i <= N; ++i) ss[i] = ss[i - 1] * 0.9;
    scanf("%lf%lf", &C, &T);
    for (int i = 1; i <= N; ++i) scanf("%d%d", &P[i].Diff, &P[i].Val);
    sort(P + 1, P + N + 1);
    for (int i = 0; i <= N; ++i)
      for (int j = 0; j <= i * MAXV; ++j) F[i][j] = 1e12;
    F[0][0] = 0.0;
    for (int i = 1; i <= N; ++i)
      for (int j = i - 1; j >= 0; --j)
        for (int k = j * MAXV; k >= 0; --k)
          relax(F[j + 1][k + P[i].Val], F[j][k] + Calc(j + 1, P[i].Diff));
    Ans = 0;
    for (int i = 0; i <= N; ++i)
      for (int j = 0; j <= i * MAXV; ++j)
        if (F[i][j] < 1e12 && Test(i, F[i][j])) Ans = max(Ans, j);
    printf("%d\n", Ans);
  }
  return 0;
}
