#include <bits/stdc++.h>
using namespace std;
struct Node {
  int a, p;
} b[101];
const double eps = 1e-5;
int test, n;
double c, T, f[101][1001], m[101];
inline bool cmp(Node x, Node y) { return x.a == y.a ? x.p > y.p : x.a > y.a; }
inline double F(double x, double m) { return m / (1.0 + c * x) + x; }
inline bool check(double m, int k) {
  double l = 0, r = T;
  while (l + eps < r) {
    double x = l + (r - l) / 3, y = r - (r - l) / 3;
    if (F(x, m) < F(y, m))
      r = y;
    else
      l = x;
  }
  return F(l, m) + 10 * k <= T;
}
int main() {
  scanf("%d", &test);
  m[0] = 1;
  for (register int i = 1; i <= 100; ++i) m[i] = m[i - 1] * ((double)10 / 9);
  while (test--) {
    scanf("%d%lf%lf", &n, &c, &T);
    for (register int i = 1; i <= n; ++i) scanf("%d%d", &b[i].a, &b[i].p);
    for (register int i = 0; i <= 100; ++i)
      for (register int j = 0; j <= 1000; ++j) f[i][j] = 1e18;
    f[0][0] = 0;
    sort(b + 1, b + n + 1, cmp);
    for (register int i = 1; i <= n; ++i)
      for (register int j = i; j; --j)
        for (register int k = b[i].p; k <= 10 * j; ++k)
          f[j][k] = min(f[j][k], f[j - 1][k - b[i].p] + (double)b[i].a * m[j]);
    int ans = 0;
    for (register int i = 1; i <= n; ++i)
      for (register int j = ans + 1; j <= 10 * i; ++j)
        if (check(f[i][j], i)) ans = max(ans, j);
    printf("%d\n", ans);
  }
  return 0;
}
