#include <bits/stdc++.h>
const double PI = acos(-1.0);
using namespace std;
int setb(int n, int pos) { return n = n | (1 << pos); }
int resb(int n, int pos) { return n = n & ~(1 << pos); }
bool checkb(int n, int pos) { return (bool)(n & (1 << pos)); }
inline long long bigmod(long long b, long long p, long long m) {
  long long ret = 1, cur = b % m;
  while (p) {
    if (p & 1) ret = (ret * cur) % m;
    cur = (cur * cur) % m;
    p = p >> 1;
  }
  return ret;
}
struct info {
  int hard, p;
  info() {}
  info(int hard, int p) : hard(hard), p(p) {}
  void take_input() { cin >> hard >> p; }
  bool operator<(const info &other) const { return hard > other.hard; }
};
info ara[102];
int n, tot;
double C, T;
double s[102];
void prework() {
  s[0] = 1;
  for (int i = 1; i <= 100; i++) s[i] = s[i - 1] * 0.9;
}
int visit[102][102][102 * 10], cs;
double dp[102][102][102 * 10];
void dp_solve() {
  for (int k = 0; k <= n; k++)
    for (int baki = 0; baki <= tot; baki++) dp[0][k][baki] = 1e18;
  dp[0][0][0] = 0;
  for (int pos = 1; pos <= n; pos++) {
    for (int k = 0; k <= n; k++) {
      for (int baki = 0; baki <= tot; baki++) {
        double ret = dp[pos - 1][k][baki];
        if (k && baki - ara[pos].p >= 0)
          ret = min(ret, ara[pos].hard / s[k] +
                             dp[pos - 1][k - 1][baki - ara[pos].p]);
        dp[pos][k][baki] = ret;
      }
    }
  }
}
double table[102 * 10];
void init() {
  cs++;
  dp_solve();
}
inline double go(double st, int pt) {
  double train = 1 + C * st;
  double ret = 1e18;
  for (int k = 0; k <= n; k++) {
    double t = dp[n][k][pt] / train + k * 10 + st;
    ret = min(ret, t);
  }
  return ret;
}
inline bool single_solve(int pt) {
  double low = 0, high = T, a, b;
  int cnt = 40;
  while (cnt--) {
    a = low + 1 * (high - low) / 3;
    b = low + 2 * (high - low) / 3;
    double mya = go(a, pt);
    double myb = go(b, pt);
    if (mya < myb)
      high = b;
    else
      low = a;
  }
  if (go(low, pt) < T)
    return true;
  else
    return false;
}
int solve() {
  init();
  for (int i = tot; i >= 0; i--)
    if (single_solve(i)) return i;
}
int main() {
  prework();
  int t, i;
  scanf("%d", &t);
  while (t--) {
    cin >> n >> C >> T;
    tot = 0;
    for (i = 1; i <= n; i++) ara[i].take_input(), tot += ara[i].p;
    sort(ara + 1, ara + n + 1);
    int ret = solve();
    printf("%d\n", ret);
  }
  return 0;
}
