#include <bits/stdc++.h>
using namespace std;
double INF;
const long long int mod = 1000000007;
long long int MOD(long long int a, long long int b) {
  if (a > b)
    return a - b;
  else
    return b - a;
}
long long int max3(long long int a, long long int b, long long int c) {
  return max(c, max(a, b));
}
long long int min3(long long int a, long long int b, long long int c) {
  return min(a, min(b, c));
}
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long int power1(long long int x, long long int y) {
  long long int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res % mod;
}
long long int logg(long long int a) {
  long long int x = 0;
  while (a > 1) {
    x++;
    a /= 2;
  }
  return x;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int abso(long long int x) {
  if (x < 0) {
    return -x;
  }
  return x;
}
long long int ceiling(long long int a, long long int b) {
  if (a % b == 0) {
    return a / b;
  } else {
    return a / b + 1;
  }
}
long long int modinv(long long int x) { return power1(x, mod - 2); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  INF = pow(10, 200);
  int tc;
  cin >> tc;
  vector<double> powers(101);
  powers[0] = 1;
  for (int i = 1; i <= 100; i++) {
    powers[i] = powers[i - 1] * (0.9);
  }
  while (tc--) {
    int n;
    cin >> n;
    double c, t;
    cin >> c >> t;
    vector<int> a(n), p(n);
    for (int i = 0; i < n; i++) {
      cin >> a[i] >> p[i];
    }
    vector<pair<int, int>> temp(n);
    for (int i = 0; i < n; i++) {
      temp[i].first = a[i];
      temp[i].second = p[i];
    }
    sort(temp.begin(), temp.end());
    reverse(temp.begin(), temp.end());
    for (int i = 0; i < n; i++) {
      a[i] = temp[i].first;
      p[i] = temp[i].second;
    }
    vector<vector<double>> dp(1001);
    for (int i = 0; i <= 1000; i++) {
      dp[i].resize(n + 1, INF);
    }
    dp[0][0] = 0;
    for (int i = 0; i < n; i++) {
      for (int j = 1000; j >= p[i]; j--) {
        for (int k = n; k >= 1; k--) {
          dp[j][k] = min(dp[j][k], dp[j - p[i]][k - 1] + a[i] / ((powers[k])));
        }
      }
    }
    int ans = 0;
    for (int j = 0; j <= 1000; j++) {
      for (int k = 1; k <= n; k++) {
        double x = max((double)0, (sqrt(c * (dp[j][k])) - 1) / c);
        if ((dp[j][k] / (1 + c * x)) + 10 * k + x <= t) {
          ans = max(ans, j);
        }
      }
    }
    cout << ans << endl;
  }
}
