#include <bits/stdc++.h>
char ch;
bool fs;
void re(int& x) {
  while (ch = getchar(), ch < 33)
    ;
  if (ch == '-')
    fs = 1, x = 0;
  else
    fs = 0, x = ch - 48;
  while (ch = getchar(), ch > 33) x = x * 10 + ch - 48;
  if (fs) x = -x;
}
using namespace std;
const double eps = 1e-7;
int n, ans;
double c, t, f[101][101][101 * 10], mxt[101], bs[101];
struct node {
  int a, p;
  bool operator<(const node& i) const { return a > i.a; }
} e[101];
int main() {
  int T;
  re(T);
  bs[0] = 1;
  for (int i = 1; i <= 100; ++i) bs[i] = bs[i - 1] / 0.9;
  while (T--) {
    re(n);
    ans = 0;
    scanf("%lf%lf", &c, &t);
    for (int i = 1; i <= n; ++i) re(e[i].a), re(e[i].p);
    sort(e + 1, e + n + 1);
    for (int i = 1; i <= n; ++i) {
      double tnow = t - i * 10;
      if (tnow < 0) {
        mxt[i] = -1e100;
        continue;
      }
      double l = 0, r = tnow;
      for (int j = 1; j <= 1000; ++j) {
        double m1 = l + (r - l) / 3, m2 = r - (r - l) / 3;
        if ((tnow - m1) * (1 + m1 * c) > (tnow - m2) * (1 + m2 * c))
          r = m2;
        else
          l = m1;
      }
      l = (l + r) / 2;
      mxt[i] = (tnow - l) * (1 + l * c);
    }
    for (int i = 0; i <= n; ++i)
      for (int j = 0; j <= n; ++j)
        for (int k = 0; k <= 1000; ++k) f[i][j][k] = 1e100;
    for (int i = 0; i <= n; ++i) f[i][0][0] = 0;
    for (int i = 1; i <= n; ++i)
      for (int j = 0; j <= i; ++j)
        for (int k = 0; k <= j * 10; ++k) {
          f[i][j][k] = f[i - 1][j][k];
          if (k >= e[i].p)
            f[i][j][k] =
                min(f[i][j][k], f[i - 1][j - 1][k - e[i].p] + e[i].a * bs[j]);
          if (mxt[j] + eps > f[i][j][k]) ans = max(ans, k);
        }
    printf("%d\n", ans);
  }
}
