#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
const long double inf = 1e100;
const int N = 105;
int n;
pair<int, int> a[N];
long double dp[N][N][N * 10];
long double f[N], c, T;
int main() {
  int Tc = read();
  for (int i = 0; i <= 10; i++) dp[0][1][i] = inf;
  while (Tc--) {
    n = read();
    cin >> c >> T;
    for (int i = 1; i <= n; i++) {
      a[i].first = read();
      a[i].second = read();
    }
    sort(&a[1], &a[n + 1]);
    reverse(&a[1], &a[n + 1]);
    f[0] = 1;
    for (int i = 1; i <= n; i++) f[i] = f[i - 1] * 0.9;
    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= i; j++) {
        long double x = a[i].first / f[j];
        for (int k = 0; k < a[i].second; k++)
          dp[i][j][k] = (i == j || k > (i - 1) * 10) ? inf : dp[i - 1][j][k];
        for (int k = a[i].second; k <= j * 10; k++) {
          if (j == i || k > j * 10)
            dp[i][j][k] = (k - a[i].second > (j - 1) * 10)
                              ? inf
                              : dp[i - 1][j - 1][k - a[i].second] + x;
          else
            dp[i][j][k] = min((k - a[i].second <= (j - 1) * 10)
                                  ? (dp[i - 1][j - 1][k - a[i].second] + x)
                                  : inf,
                              dp[i - 1][j][k]);
        }
      }
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      for (int k = 0; k <= i * 10; k++) {
        long double TT = dp[n][i][k];
        if (TT >= inf) continue;
        long double l = 0, r = T, mn = inf;
        for (int i = 1; i <= 100; i++) {
          long double len = (r - l) / 3;
          long double lmid = l + len, rmid = r - len;
          long double ans1 = TT / (1 + c * lmid) + lmid,
                      ans2 = TT / (1 + c * rmid) + rmid;
          mn = min(mn, min(ans1, ans2));
          if (ans1 < ans2)
            r = rmid;
          else
            l = lmid;
        }
        if (mn + i * 10 <= T) ans = max(ans, k);
      }
    }
    cout << ans << endl;
  }
}
