#include <bits/stdc++.h>
using namespace std;
void chmin(double& a, double b) { a = min(a, b); }
void solve() {
  int N;
  double C, T;
  cin >> N >> C >> T;
  pair<int, int> AP[100];
  for (int i = 0; i < N; i++) {
    int a, p;
    cin >> a >> p;
    AP[i] = {a, p};
  }
  sort(AP, AP + N);
  vector<vector<double>> dp(101, vector<double>(1001, 1e9));
  dp[0][0] = 0;
  int sum = 0;
  for (int i = 0; i < N; i++) {
    int a = AP[i].first, p = AP[i].second;
    for (int j = i; j >= 0; j--)
      for (int k = sum; k >= 0; k--) {
        chmin(dp[j + 1][k + p], dp[j][k] / 0.9 + a);
      }
    sum += p;
  }
  for (int k = sum; k >= 0; k--) {
    for (int j = 0; j <= N; j++) {
      double A = dp[j][k] / 0.9;
      double res = (A * C >= 1 ? 2 * sqrt(A / C) - 1 / C : A);
      res += 10 * j;
      if (res <= T) {
        cout << k << endl;
        return;
      }
    }
  }
}
int main() {
  int T;
  cin >> T;
  while (T--) solve();
  return 0;
}
