#include <bits/stdc++.h>
using namespace std;
pair<int, int> pos[105];
double dp[1005][105];
void solve() {
  int n;
  scanf("%d", &n);
  double C, T;
  scanf("%lf %lf", &C, &T);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    pos[i] = pair<int, int>(a, b);
  }
  sort(pos, pos + n, greater<pair<int, int> >());
  for (int i = 0; i < 1005; i++) {
    for (int j = 0; j <= n; j++) {
      dp[i][j] = -1.0;
    }
  }
  dp[0][0] = 0.0;
  for (int i = 0; i < n; i++) {
    pair<int, int> p = pos[i];
    for (int j = 1005 - 1; j >= 0; j--) {
      double t = p.first;
      for (int k = 0; k <= i; k++) {
        t /= 0.9;
        if (dp[j][k] < -1e-10) continue;
        if (dp[j + p.second][k + 1] < -1e-10)
          dp[j + p.second][k + 1] = dp[j][k] + t;
        else
          dp[j + p.second][k + 1] = min(dp[j + p.second][k + 1], dp[j][k] + t);
      }
    }
  }
  for (int i = 1005 - 1; i >= 0; i--) {
    bool up = false;
    for (int j = 0; j <= n; j++) {
      if (dp[i][j] > -1e-10) {
        double zan = T - 10.0 * (double)j;
        if (zan > -1e-10) {
          double a = 1.0 / C - zan;
          double b = (dp[i][j] - zan) / C;
          if (b < 1e-10 || zan * zan + a * zan + b < 1e-10)
            up = true;
          else if (a < 1e-10 && b - a * a / 4.0 < 1e-10)
            up = true;
        }
      }
    }
    if (up) {
      printf("%d\n", i);
      break;
    }
  }
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) solve();
  return 0;
}
