#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18, IT_CNT = 30, MAX_SCORE = 1000 + 10;
const long double EPS = 1e-7;
long long n;
long double c, t;
vector<long double> s;
vector<pair<long long, long long> > pr;
vector<vector<long double> > dp;
bool same(long double a, long double b) {
  if (abs(a - b) < EPS) {
    return true;
  }
  return false;
}
long double f(long double t, long double dp_val, long long cnt_pr) {
  return 10 * cnt_pr + dp_val / (1 + c * t) + t;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  for (long long w = 0; w < q; ++w) {
    cin >> n >> c >> t;
    pr.clear();
    pr.resize(n);
    for (auto& it : pr) {
      cin >> it.first >> it.second;
    }
    sort(pr.rbegin(), pr.rend());
    s.clear();
    s.resize(n + 1);
    s[0] = 1;
    for (long long i = 1; i <= n; ++i) {
      s[i] = s[i - 1] * 0.9;
    }
    dp.clear();
    dp.resize(n + 1, vector<long double>(MAX_SCORE, INF));
    dp[0][0] = 0;
    for (auto it : pr) {
      for (long long j = n; j > 0; --j) {
        long double t_to_solve = (long double)it.first / s[j];
        for (long long k = it.second; k < MAX_SCORE; ++k) {
          dp[j][k] = min(dp[j][k], dp[j - 1][k - it.second] + t_to_solve);
        }
      }
    }
    bool find_ans = false;
    for (long long i = MAX_SCORE - 1; i >= 0 && !find_ans; --i) {
      for (long long j = 0; j <= n; ++j) {
        long double l = 0, r = t;
        for (long long p = 0; p < IT_CNT; ++p) {
          long double m1 = l + (r - l) / 3;
          long double m2 = r - (r - l) / 3;
          if (f(m1, dp[j][i], j) < f(m2, dp[j][i], j)) {
            r = m2;
          } else {
            l = m1;
          }
        }
        if (f(l, dp[j][i], j) < t || same(f(l, dp[j][i], j), t)) {
          cout << i << endl;
          find_ans = true;
          break;
        }
      }
    }
  }
  return 0;
}
