Petya has come to the math exam and wants to solve as many problems as possible. He prepared and carefully studied the rules by which the exam passes.

The exam consists of $n$ problems that can be solved in $T$ minutes. Thus, the exam begins at time $0$ and ends at time $T$. Petya can leave the exam at any integer time from $0$ to $T$, inclusive.

All problems are divided into two types:   easy problems — Petya takes exactly $a$ minutes to solve any easy problem;  hard problems — Petya takes exactly $b$ minutes ($b > a$) to solve any hard problem. 

Thus, if Petya starts solving an easy problem at time $x$, then it will be solved at time $x+a$. Similarly, if at a time $x$ Petya starts to solve a hard problem, then it will be solved at time $x+b$.

For every problem, Petya knows if it is easy or hard. Also, for each problem is determined time $t_i$ ($0 \le t_i \le T$) at which it will become mandatory (required). If Petya leaves the exam at time $s$ and there is such a problem $i$ that $t_i \le s$ and he didn't solve it, then he will receive $0$ points for the whole exam. Otherwise (i.e if he has solved all such problems for which $t_i \le s$) he will receive a number of points equal to the number of solved problems. Note that leaving at time $s$ Petya can have both "mandatory" and "non-mandatory" problems solved.

For example, if $n=2$, $T=5$, $a=2$, $b=3$, the first problem is hard and $t_1=3$ and the second problem is easy and $t_2=2$. Then:  if he leaves at time $s=0$, then he will receive $0$ points since he will not have time to solve any problems;  if he leaves at time $s=1$, he will receive $0$ points since he will not have time to solve any problems;  if he leaves at time $s=2$, then he can get a $1$ point by solving the problem with the number $2$ (it must be solved in the range from $0$ to $2$);  if he leaves at time $s=3$, then he will receive $0$ points since at this moment both problems will be mandatory, but he will not be able to solve both of them;  if he leaves at time $s=4$, then he will receive $0$ points since at this moment both problems will be mandatory, but he will not be able to solve both of them;  if he leaves at time $s=5$, then he can get $2$ points by solving all problems. 

Thus, the answer to this test is $2$.

Help Petya to determine the maximal number of points that he can receive, before leaving the exam.


-----Input-----

The first line contains the integer $m$ ($1 \le m \le 10^4$) — the number of test cases in the test.

The next lines contain a description of $m$ test cases. 

The first line of each test case contains four integers $n, T, a, b$ ($2 \le n \le 2\cdot10^5$, $1 \le T \le 10^9$, $1 \le a < b \le 10^9$) — the number of problems, minutes given for the exam and the time to solve an easy and hard problem, respectively.

The second line of each test case contains $n$ numbers $0$ or $1$, separated by single space: the $i$-th number means the type of the $i$-th problem. A value of $0$ means that the problem is easy, and a value of $1$ that the problem is hard.

The third line of each test case contains $n$ integers $t_i$ ($0 \le t_i \le T$), where the $i$-th number means the time at which the $i$-th problem will become mandatory.

It is guaranteed that the sum of $n$ for all test cases does not exceed $2\cdot10^5$.


-----Output-----

Print the answers to $m$ test cases. For each set, print a single integer — maximal number of points that he can receive, before leaving the exam.


-----Example-----
Input
10
3 5 1 3
0 0 1
2 1 4
2 5 2 3
1 0
3 2
1 20 2 4
0
16
6 20 2 5
1 1 0 1 0 0
0 8 2 9 11 6
4 16 3 6
1 0 1 1
8 3 5 6
6 20 3 6
0 1 0 0 1 0
20 11 3 20 16 17
7 17 1 6
1 1 0 1 0 0 0
1 7 0 11 10 15 10
6 17 2 6
0 0 1 0 0 1
7 6 3 7 10 12
5 17 2 5
1 1 1 1 0
17 11 10 6 4
1 1 1 2
0
1

Output
3
2
1
0
1
4
0
1
2
1

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import sys\nfrom operator import itemgetter\n\ndef count(a, b, num_a, num_b, cur_time):\n\tcurrent_result = 0\n\t#print(\'count time = \', cur_time, "num_a =", num_a, \'num_b = \', num_b)\n\tif num_a * a + num_b * b <= cur_time and cur_time >= 0:\n\t\tcur_time -= num_a * a + num_b * b\n\t\tcurrent_result = num_a + num_b\n\t\tif num_a < total_a:\n\t\t\tif (total_a - num_a) * a <= cur_time:\n\t\t\t\tcurrent_result += total_a - num_a\n\t\t\t\tcur_time -= (total_a - num_a) * a\n\t\t\t\t#print(1)\n\t\t\telse:\n\t\t\t\tcurrent_result += cur_time // a\n\t\t\t\tcur_time -= a *(cur_time // a)\n\t\t\t\t#print(2)\n\t\tif num_b < total_b:\n\t\t\tif (total_b - num_b) * b <= cur_time:\n\t\t\t\tcurrent_result += total_b - num_b\n\t\t\t\t#print(3)\n\t\t\telse:\n\t\t\t\t#print(4)\n\t\t\t\tcurrent_result += cur_time // b\n\t#print(\'current_result = \', current_result)\n\treturn current_result\n\n\ndef solve(n, T, a, b, tasks, total_a, total_b):\t\n\ttasks = sorted(tasks)\n\t#print(tasks)\n\tresult = 0\n\tnum_a = 0\n\tnum_b = 0\n\n\tfor i in range(len(tasks)):\n\t\ttime, t = tasks[i] \n\t\t#print(tasks[i])\n\t\tcur_time = time - 1\n\t\t#print(\'cur time = \', cur_time)\n\t\tcurrent_result = count(a, b, num_a, num_b, cur_time)\n\t\tresult = max(current_result, result)\n\n\t\tif t == 0:\n\t\t\tnum_a += 1\n\t\telse:\n\t\t\tnum_b += 1\n\n\t\tif i == len(tasks) - 1 or tasks[i + 1][1] != tasks[i][1]:\n\t\t\tresult = max(result, count(a, b, num_a, num_b, cur_time))\n\n\t\t#print("i =", i, "result = ", result)\n\n\tresult = max(result, count(a, b, total_a, total_b, T))\n\treturn result\n\n\nq = int(input())\n\nfor i in range(q):\n\tn, T, a, b = list(map(int, input().split()))\n\ttypes = list(map(int, input().split()))\n\ttotal_a, total_b = 0, 0\n\tfor t in types:\n\t\tif t == 0:\n\t\t\ttotal_a += 1\n\t\telse:\n\t\t\ttotal_b += 1\n\tt = list(map(int, input().split()))\n\t#print(t)\n\t#print(types)\n\ttasks = list(zip(t, types))\n\tprint(solve(n, T, a, b, tasks, total_a, total_b))\t\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13641