#include <bits/stdc++.h>
using namespace std;
double dp[105][105][1005];
double c, nc[105], t;
int n;
pair<int, int> a[105];
double f(double x) {
  double ret = x;
  double c3 = sqrtl(c * c * c * x);
  double c2 = c * c;
  double pt = (c3 - c) / c2;
  if (pt >= 0) ret = min(ret, x / (c * pt + 1) + pt);
  return ret;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    scanf("%lf%lf", &c, &t);
    nc[0] = 0.9;
    for (int i = 1; i <= n; ++i) nc[i] = nc[i - 1] * 0.9;
    for (int i = 1; i <= n; ++i) scanf("%d%d", &a[i].first, &a[i].second);
    sort(a + 1, a + 1 + n);
    reverse(a + 1, a + 1 + n);
    for (int i = 0; i <= n; ++i)
      for (int j = 0; j <= n; ++j)
        for (int k = 0; k <= 1000; ++k) dp[i][j][k] = 1e16;
    dp[0][0][0] = 0;
    for (int x = 0; x < n; ++x)
      for (int y = 0; y <= x; ++y)
        for (int k = 0; k <= 1000; ++k) {
          double v = dp[x][y][k];
          dp[x + 1][y][k] = min(dp[x + 1][y][k], v);
          dp[x + 1][y + 1][k + a[x + 1].second] =
              min(dp[x + 1][y + 1][k + a[x + 1].second],
                  v + a[x + 1].first / nc[y]);
        }
    int ans = 0;
    for (int k = 1000; k; --k) {
      for (int y = 0; y <= n; ++y)
        if (f(dp[n][y][k]) + y * 10 <= t) {
          ans = k;
          break;
        }
      if (ans) break;
    }
    printf("%d\n", ans);
  }
  return 0;
}
