#include <bits/stdc++.h>
using namespace std;
const int maxn = 105, maxv = 1005;
int t, n;
long double dp[maxn][maxn][maxv];
long double C, T;
pair<int, int> a[maxn];
inline long double f(long double x, long double T) {
  return -C * x * x + (C * T - 1) * x + T;
}
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf(" %d %Lf %Lf", &n, &C, &T);
    int sum = 0;
    for (int i = 1; i <= n; i++) {
      scanf(" %d %d", &a[i].first, &a[i].second);
      sum += a[i].second;
    }
    sort(a + 1, a + n + 1);
    for (int i = 0; i < maxn; i++)
      for (int k = 0; k < maxn; k++)
        for (int v = 0; v < maxv; v++) dp[i][k][v] = LLONG_MAX;
    for (int i = 0; i <= n; i++) dp[0][i][0] = 0;
    for (int t = 1; t <= n; t++) {
      for (int i = 1; i <= n; i++) {
        dp[t][i][0] = 0;
        for (int v = 1; v <= sum; v++) {
          dp[t][i][v] = dp[t][i - 1][v];
          if (a[i].second <= v)
            dp[t][i][v] =
                min(dp[t][i][v],
                    (dp[t - 1][i - 1][v - a[i].second] + a[i].first) / 0.9);
        }
      }
    }
    int res = 0;
    for (int t = 1; t <= n; t++) {
      long double lo = 0, hi = 1e8, ans = 0;
      long double rem = T - 10 * t;
      while (hi - lo > 1e-5) {
        long double mid = (lo + hi) / 2;
        long double fi = f(mid, rem), fi2 = f(mid + 1e-5, rem);
        if (fi <= fi2) {
          ans = mid;
          lo = mid + 1e-5;
        } else
          hi = mid - 1e-5;
      }
      long double best = f(ans, rem);
      for (int v = 1; v <= sum; v++)
        if (dp[t][n][v] <= best) res = max(res, v);
    }
    printf("%d\n", res);
  }
}
