#include <bits/stdc++.h>
int ans, a, i, j, k, m;
long double y, h, z, t, aa, bb, cc, K, C, T, X[102], D[102][1002];
struct A {
  int x, p;
} data[111];
bool cmp(A aa, A bb) { return aa.x > bb.x; }
int main() {
  X[1] = (long double)10 / (long double)9;
  for (i = 2; i <= 100; i++) X[i] = X[i - 1] * X[1];
  int tc;
  scanf("%d", &tc);
  while (tc--) {
    scanf("%d", &a);
    std::cin >> C >> T;
    for (i = 1; i <= a; i++) scanf("%d%d", &data[i].x, &data[i].p);
    std::sort(data + 1, data + a + 1, cmp);
    for (i = 0; i <= a; i++)
      for (j = 0; j <= 1000; j++) D[i][j] = -1.0;
    m = 0;
    D[0][0] = 0.0;
    for (i = 1; i <= a; i++) {
      for (j = i - 1; j >= 0; j--) {
        for (k = 0; k <= m; k++) {
          if (D[j][k] > -0.1 &&
              (D[j + 1][k + data[i].p] < -0.1 ||
               D[j + 1][k + data[i].p] >
                   D[j][k] + (long double)data[i].x * X[j + 1])) {
            D[j + 1][k + data[i].p] =
                D[j][k] + (long double)data[i].x * X[j + 1];
          }
        }
      }
      m += data[i].p;
    }
    ans = 0;
    for (j = 1; j <= a; j++) {
      for (k = 1; k <= m; k++) {
        if (D[j][k] > -0.1) {
          t = T - 10.0 * j;
          if (D[j][k] <= t) {
            ans = std::max(ans, k);
            continue;
          }
          z = (C * t - 1.0) / (2.0 * C);
          if (z + D[j][k] / (1.0 + z * C) - t > 0.0) continue;
          if (z > 0.0) {
            ans = std::max(ans, k);
            continue;
          }
          y = t;
          while (y - z > 0.0001) {
            h = (y + z) / (2.0);
            if (h + D[j][k] / (1.0 + h * C) - t > 0.0)
              y = h;
            else
              z = h;
          }
          if (z > 0.0) {
            ans = std::max(ans, k);
            continue;
          }
        }
      }
    }
    printf("%d\n", ans);
  }
}
