#include <bits/stdc++.h>
using namespace std;
const int N = 127, C = 10, INF = 1e9;
pair<double, int> a[N];
double c, t, f[N][N * C];
int n, kase;
int main() {
  for (scanf("%d", &kase); kase--;) {
    scanf("%d%lf%lf", &n, &c, &t);
    int m = 0, ans = 0;
    for (int i = 1; i <= n; ++i)
      scanf("%lf%d", &a[i].first, &a[i].second), m += a[i].second;
    sort(a + 1, a + n + 1, greater<pair<double, int>>());
    for (int i = 0; i <= n; ++i) fill(f[i], f[i] + m + 1, INF);
    f[0][0] = 0;
    for (int i = 1; i <= n; ++i)
      for (int j = i; j; --j)
        for (int k = m - a[i].second; ~k; --k)
          if (f[j][k + a[i].second] > f[j - 1][k] + a[i].first / pow(0.9, j))
            f[j][k + a[i].second] = f[j - 1][k] + a[i].first / pow(0.9, j);
    for (int j = m; !ans && j; --j)
      for (int i = 0; !ans && i <= n; ++i) {
        double x = max(sqrt(c * f[i][j]) - 1, .0) + 1;
        if (x + c * f[i][j] / x - 1 + c * i * 10 <= t * c) ans = j;
      }
    printf("%d\n", ans);
  }
}
