#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 3;
const long double inf = 1e18 + 3;
const int md = 1e9 + 7;
const long double eps = 0.000000001;
int tc;
long double C, T;
pair<int, int> a[103];
int n;
long double dp[103][103][1002];
long double st[103];
long double mn[1002];
long double f(int i, long double j) { return mn[i] / (1.0 + C * j) + j; }
int answer() {
  st[0] = 1;
  for (int i = 1; i <= 101; ++i) {
    st[i] = st[i - 1] * 0.9;
  }
  cin >> n >> C >> T;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n + 1; ++i) {
    for (int j = 0; j <= n; ++j) {
      for (int k = 0; k <= n * 10; ++k) {
        dp[i][j][k] = inf;
      }
    }
  }
  for (int k = 0; k <= n * 10; ++k) mn[k] = inf;
  int b = n * 10;
  dp[1][0][0] = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j < n; ++j) {
      for (int k = 0; k <= b; ++k) {
        dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k]);
        if (k + a[i].second > b) continue;
        dp[i + 1][j + 1][k + a[i].second] =
            min(dp[i + 1][j + 1][k + a[i].second],
                dp[i][j][k] + a[i].first / st[j + 1]);
      }
    }
  }
  int ans = 0;
  for (int j = 1; j <= n; ++j) {
    for (int i = 1; i <= b; ++i) {
      mn[i] = dp[n + 1][j][i];
      if (mn[i] > inf / 2) continue;
      long double l = 0;
      long double r = T;
      for (int s = 1; s <= 40; s++) {
        long double m1 = l + (r - l) / 3;
        long double m2 = r - (r - l) / 3;
        if (f(i, m2) - f(i, m1) < eps)
          l = m1;
        else
          r = m2;
      }
      long double mn = inf;
      mn = min(mn, f(i, 0));
      mn = min(mn, f(i, T));
      mn = min(mn, f(i, l));
      if (mn + j * 10 - T < eps) ans = max(ans, i);
    }
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(10);
  cin >> tc;
  while (tc--) {
    cout << answer() << '\n';
  }
}
