#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
const int MAXV = 1010;
const double EPS = 1e-3;
static int TC, N, ans, sum;
static pair<int, int> prob[MAXN];
static double C, T, K[MAXN], dp[MAXN][MAXV];
int main() {
  K[0] = 1.0;
  for (int i = 1; i < MAXN; i++) K[i] = K[i - 1] * (1.0 / 0.9);
  scanf("%d", &TC);
  while (TC--) {
    scanf("%d%lf%lf", &N, &C, &T);
    ans = sum = 0;
    for (int i = 1; i <= N; i++) {
      scanf("%d%d", &prob[i].first, &prob[i].second);
      sum += prob[i].second;
    }
    sort(prob + 1, prob + N + 1, greater<pair<int, int>>());
    for (int i = 0; i <= N; i++)
      for (int j = 0; j <= sum; j++) dp[i][j] = LLONG_MAX;
    dp[0][0] = 0;
    for (int i = 1; i <= N; i++)
      for (int j = i; j; j--)
        for (int k = prob[i].second; k <= sum; k++)
          dp[j][k] = min(dp[j][k],
                         dp[j - 1][k - prob[i].second] + K[j] * prob[i].first);
    ans = 0;
    for (int j = sum; !ans && j; j--)
      for (int i = 1; !ans && i <= N; i++) {
        double t = (sqrt(C * dp[i][j]) - 1.0) / C;
        if (t < 0) t = 0;
        if (10 * i + t + dp[i][j] / (1 + C * t) < T + EPS) ans = j;
      }
    printf("%d\n", ans);
  }
  return 0;
}
