#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
istream &operator>>(istream &in, pair<T, U> &data) {
  in >> data.first >> data.second;
  return in;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &vect) {
  for (unsigned i = 0; i < vect.size(); i++) {
    in >> vect[i];
  }
  return in;
}
namespace std {
template <>
struct hash<std::pair<int, int>> {
  inline size_t operator()(const std::pair<int, int> &v) const {
    std::hash<int> int_hasher;
    return int_hasher(v.first) ^ int_hasher(v.second);
  }
};
}  // namespace std
template <typename Out>
void Split(const std::string &s, char delim, Out result) {
  std::stringstream ss(s);
  std::string item;
  while (std::getline(ss, item, delim)) {
    *(result++) = item;
  }
}
std::vector<std::string> str_split(const std::string &s, char delim) {
  std::vector<std::string> elems;
  Split(s, delim, std::back_inserter(elems));
  return elems;
}
int main() {
  ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  for (int ti = 1; ti <= t; ti++) {
    int n;
    cin >> n;
    double c, time;
    cin >> c >> time;
    vector<pair<int, int>> ap(n);
    for (int i = 0; i < n; i++) {
      cin >> ap[i].first >> ap[i].second;
    }
    sort(ap.begin(), ap.end());
    reverse(ap.begin(), ap.end());
    vector<vector<double>> dp(
        1001, vector<double>(n + 1, numeric_limits<double>::max()));
    dp[0][0] = 0;
    for (int pi = 0; pi < n; pi++) {
      int curr_dif = ap[pi].second;
      int curr_dur = ap[pi].first;
      for (int si = pi; si >= 0; si--) {
        double s = 0.9;
        for (int sii = 0; sii < si; sii++) {
          s *= 0.9;
        }
        for (int di = 1000; di >= 0; di--) {
          if (dp[di][si] < numeric_limits<double>::max()) {
            dp[di + curr_dif][si + 1] =
                min(dp[di + curr_dif][si + 1], dp[di][si] + curr_dur / s);
          }
        }
      }
    }
    bool found = false;
    for (int di = 1000; di >= 0 && !found; di--) {
      for (int num_problems = 1; num_problems <= n && !found; num_problems++) {
        if (dp[di][num_problems] < numeric_limits<double>::max()) {
          double min_time = num_problems * 10;
          double c1 = dp[di][num_problems];
          double c2 = c;
          double x = sqrt(c1 * c2);
          x = max(1.0, x);
          double minimize = c1 / x + (x - 1) / c2;
          min_time += minimize;
          if (min_time < time || fabs(min_time - time) < (1e-6)) {
            found = true;
            cout << di << endl;
          }
        }
      }
    }
    if (!found) {
      cout << 0 << endl;
    }
  };
  return 0;
}
