#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long res = 0, f = 1;
  char ch = getchar();
  while (ch != '-' && (ch > '9' || ch < '0')) ch = getchar();
  if (ch == '-') f = -1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    res = (res << 1) + (res << 3) + (ch ^ 48), ch = getchar();
  return res * f;
}
const int Mod = 993244853;
const long long INF = 1e18;
const double eps = 1e-5;
struct node {
  double s;
  int p;
} a[105];
bool cmp(node x, node y) { return x.s > y.s; }
int n;
double pw[105];
double C, Time, f[105][1005];
bool check(int k, double p) {
  double l = 0, r = Time, lmid, rmid;
  while (r - l >= eps) {
    lmid = l + (r - l) / 3;
    rmid = lmid + (r - l) / 3;
    if (p / (1 + C * lmid) + lmid < p / (1 + C * rmid) + rmid)
      r = rmid;
    else
      l = lmid;
  }
  return 10 * k + p / (1 + C * l) + l < Time;
}
int main() {
  pw[0] = 1;
  for (register int i = 1; i <= 100; ++i) pw[i] = pw[i - 1] * 10 / 9;
  int T = read();
  while (T--) {
    scanf("%d%lf%lf", &n, &C, &Time);
    for (register int i = 1; i <= n; ++i) scanf("%lf%d", &a[i].s, &a[i].p);
    sort(a + 1, a + n + 1, cmp);
    for (register int i = 0; i <= n; ++i)
      for (register int j = 0; j <= 1000; ++j) f[i][j] = INF;
    f[0][0] = 0;
    for (register int i = 1; i <= n; ++i)
      for (register int j = i; j >= 0; j--)
        for (register int k = a[i].p; k <= 10 * j; k++)
          f[j][k] = min(f[j][k], f[j - 1][k - a[i].p] + a[i].s * pw[j]);
    int ans = 0;
    for (register int j = 1; j <= n; ++j)
      for (register int k = ans + 1; k <= 10 * j; ++k)
        if (check(j, f[j][k])) ans = k;
    printf("%d\n", ans);
  }
  return 0;
}
