#include <bits/stdc++.h>
using namespace std;
const double inf = 1e15;
const double eps = 1e-15;
double pw[1000];
double dp[110][110][1010];
pair<int, int> a[110];
bool has(double a, double b, double c) {
  if (b * b - 4 * a * c > 0) return true;
  return false;
}
double root(double a, double b, double c) {
  double d = sqrt(b * b - 4 * a * c);
  return max((-b + d) / (2 * a), (-b - d) / (2 * a));
}
int main() {
  ios_base::sync_with_stdio(false);
  int tc;
  cin >> tc;
  pw[0] = 1;
  for (int i = 1; i <= 100; i++) pw[i] = pw[i - 1] * 0.9;
  while (tc--) {
    int n;
    cin >> n;
    double c, t;
    cin >> 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 = 0; i <= n; i++)
      for (int j = 0; j <= n; j++)
        for (int z = 0; z <= 1000; z++) dp[i][j][z] = inf;
    dp[0][0][0] = 0;
    for (int i = 0; i < n; i++)
      for (int j = 0; j <= n; j++) {
        if (j == 0) dp[i][j][0] = 0;
        for (int z = 0; z <= 1000; z++) {
          if (dp[i][j][z] + eps < inf) {
            dp[i + 1][j][z] = min(dp[i][j][z], dp[i + 1][j][z]);
            dp[i + 1][j + 1][z + a[i + 1].second] =
                min(dp[i][j][z] + a[i + 1].first / pw[j + 1],
                    dp[i + 1][j + 1][z + a[i + 1].second]);
          }
        }
      }
    bool f = false;
    for (int j = 1000; j >= 0 and !f; j--) {
      if (j == 0) {
        cout << 0 << endl;
        break;
      }
      for (int i = 1; i <= n; i++) {
        if (dp[n][i][j] + eps < inf) {
          if (10 * i > t) continue;
          if (has(c, 1 - (t - 10 * i) * c, dp[n][i][j] - (t - 10 * i))) {
            if (root(c, 1 - (t - 10 * i) * c, dp[n][i][j] - (t - 10 * i)) >=
                0) {
              cout << j << endl;
              f = true;
              break;
            }
          }
        }
      }
    }
  }
}
