#include <bits/stdc++.h>
using namespace std;
const int duzo = 107;
const long double inf = 1e300, maleinf = 1e250;
vector<pair<int, int> > v;
long double dp[10 * duzo][duzo];
long double pot[duzo];
const long double mno = 10.0 / 9.0;
int main() {
  pot[0] = 1.0;
  for (int i = 1; i < duzo; ++i) pot[i] = pot[i - 1] * mno;
  int ttt;
  cin >> ttt;
  while (ttt--) {
    int n;
    cin >> n;
    long double c, T;
    cin >> c >> T;
    v.clear();
    for (int i = 0; i < n; ++i) {
      int a, p;
      cin >> a >> p;
      v.push_back({-a, p});
    }
    sort(v.begin(), v.end());
    for (int i = 0; i <= 10 * n; ++i) {
      for (int j = 0; j <= n; ++j) {
        dp[i][j] = inf;
      }
    }
    dp[0][0] = 0.0;
    for (int i = 0; i < n; ++i) {
      int p = v[i].second;
      long double a = -v[i].first;
      for (int k = n; k >= 1; --k) {
        for (int j = p; j <= 10 * n; ++j) {
          dp[j][k] = min(dp[j][k], dp[j - p][k - 1] + pot[k] * a);
        }
      }
    }
    for (int i = 0; i <= 11; ++i) {
      if (0) cout << "suma " << i << '\t';
      for (int j = 0; j <= 4; ++j) {
        if (0) cout << dp[i][j] << "\t";
      }
      if (0) cout << '\n';
    }
    long double s = 1.0;
    bool czy = true;
    for (int i = 10 * n; i >= 0 && czy; --i) {
      for (int j = 0; j <= n && czy; ++j) {
        long double cz = dp[i][j];
        if (cz > maleinf) continue;
        long double t = T - (10.0 * j);
        if (0) cout << i << " " << cz << " ";
        long double delta = (t * c - s) * (t * c - s) + 4.0 * c * (t * s - cz);
        if (0) cout << delta << " ";
        if (delta >= 0.0) {
          long double pierw1 = (t * c - s + sqrt(delta)) / (2.0 * c);
          long double pierw2 = (t * c - s - sqrt(delta)) / (2.0 * c);
          if (0) cout << pierw1 << " " << pierw2 << "\n";
          if ((pierw1 >= 0.0 && pierw1 <= t) ||
              (pierw2 >= 0.0 && pierw2 <= t)) {
            cout << i << "\n";
            czy = false;
          }
        }
        if (0) cout << "\n";
      }
    }
    if (czy) cout << "0\n";
  }
  return 0;
}
