#include <bits/stdc++.h>
const int N = 105, M = 1005;
const double INF = 1e13 + 7;
double dp[N][M];
struct Problem {
  int a, p;
  bool operator<(const Problem &b) const { return a < b.a; }
  void input() { scanf("%d%d", &a, &p); }
} a[N];
int tc, n;
double C, T;
int main() {
  scanf("%d", &tc);
  while (tc--) {
    scanf("%d%lf%lf", &n, &C, &T);
    int tot = 0;
    for (int i = 0; i < n; i++) a[i].input(), tot += a[i].p;
    std::sort(a, a + n);
    for (int j = 0; j <= n; j++)
      for (int i = 0; i <= tot; i++) dp[j][i] = INF;
    dp[0][0] = 0;
    for (int i = 0; i < n; i++)
      for (int j = n - 1; ~j; j--)
        for (int k = tot - a[i].p; ~k; k--)
          if (dp[j][k] < INF)
            dp[j + 1][k + a[i].p] =
                std::min(dp[j + 1][k + a[i].p], dp[j][k] / 0.9 + a[i].a / 0.9);
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      if (i * 10 >= T) break;
      double p = T - i * 10;
      double up = (p * C - 1) / 2 / C;
      if (up < 0) up = 0;
      if (up > p) up = p;
      up = (p - up) * (C * up + 1);
      for (int j = 1; j <= tot; j++)
        if (dp[i][j] <= up) ans = std::max(ans, j);
    }
    printf("%d\n", ans);
  }
  return 0;
}
