#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
int n, m, tc, i, j, ans, k;
double f[105][1005], st[1005];
double t, c;
struct str {
  int a, p;
} a[100005];
bool cmp(str a, str b) { return a.a > b.a; }
int main() {
  scanf("%d", &tc);
  st[0] = 1;
  for (i = 1; i <= 100; i++) st[i] = st[i - 1] * 10 / 9;
  while (tc--) {
    scanf("%d", &n);
    scanf("%lf %lf", &c, &t);
    for (i = 1; i <= n; i++) scanf("%d %d", &a[i].a, &a[i].p);
    sort(a + 1, a + 1 + n, cmp);
    for (i = 0; i <= n; i++)
      for (j = 1; j <= 1000; j++) f[i][j] = 100000000000.0;
    m = 0;
    for (i = 1; i <= n; i++) {
      m += a[i].p;
      for (j = i; j >= 1; j--)
        for (k = m; k >= a[i].p; k--)
          f[j][k] = min(f[j][k], f[j - 1][k - a[i].p] + a[i].a * st[j]);
    }
    ans = 0;
    for (i = 1; i <= n; i++)
      for (j = 1; j <= m; j++) {
        double derta =
            (1 / c + t - 10 * i) * (1 / c + t - 10 * i) - 4 * f[i][j] / c;
        if (derta >= 0 && t >= 10 * i &&
            ((1 / c + t - 10 * i) + sqrt(derta)) / 2 * c >= 1)
          ans = max(ans, j);
      }
    printf("%d\n", ans);
  }
}
