#include <bits/stdc++.h>
double f[1010][110], g[1010][110];
const double inf = 1.0 / 0.0;
struct item {
  int a, b;
  inline bool operator<(const item &that) const { return a > that.a; }
} p[1010];
inline bool check(double a, double b, double c) {
  double t = -b / 2.0 / a;
  t < 0 ? t = 0 : 0;
  return a * t * t + b * t + c <= 0;
}
int main() {
  int tc;
  scanf("%d", &tc);
  for (int Cas = 1; Cas <= tc; ++Cas) {
    int n;
    scanf("%d", &n);
    double C, T;
    scanf("%lf%lf", &C, &T);
    int sum = 0;
    for (int i = 1; i <= n; ++i) scanf("%d%d", &p[i].a, &p[i].b), sum += p[i].b;
    std::sort(p + 1, p + n + 1);
    for (int i = 0; i <= sum; ++i)
      for (int j = 0; j <= n; ++j) f[i][j] = inf;
    f[0][0] = 0;
    for (int i = 1; i <= n; ++i) {
      for (int j = i; j; --j)
        for (int k = p[i].b; k <= sum; ++k) {
          if (f[k - p[i].b][j - 1] > 1e20) continue;
          (f[k][j] > (f[k - p[i].b][j - 1] + p[i].a / pow(0.9, j))
               ? f[k][j] = (f[k - p[i].b][j - 1] + p[i].a / pow(0.9, j))
               : 0);
        }
    }
    int ans = 0;
    for (int i = 1; i <= sum; ++i) {
      for (int j = 1; j <= n; ++j)
        if (check(C, 1 + 10.0 * j * C - T * C, 10.0 * j - T + f[i][j])) {
          ans = i;
          break;
        }
    }
    printf("%d\n", ans);
  }
  return 0;
}
