T =int(input())for _ inrange(T):
n, x, y, a, b =map(int,input().split())
cnt = n // y; cnt1 = a // x; cnt2 = b // x
if cnt ==0or cnt2 ==0:print(-1)elif cnt <= cnt2:print(cnt)else:print(cnt2 +min(cnt2 -1, cnt1, cnt - cnt2))
x =list(input())print("".join(sorted(x, reverse=True)), end=" ")
num ='9'; idx =-1for i, data inenumerate(x):if data !='0'and data <= num:
num = data; idx = i
new = x[: idx]+ x[idx +1:]
new.sort()print(num +"".join(new))
n, K =map(int,input().split())
a =[0]+list(map(int,input().split()))
dic ={}; ans = n
for i inrange(1, n +1):if a[i]*2!= K and K - a[i]in dic:
times =max(dic.get(K - a[i]),min(i, n - i +1))
ans =min(ans, times)
dic[a[i]]=min(dic.get(a[i], n),min(i, n - i +1))print(ans if ans != n else-1)
T =int(input())for _ inrange(T):
n, x, y, a, b =map(int,input().split())
cnt = n // y; cnt1 = a // x; cnt2 = b // x
if cnt ==0or cnt2 ==0:print(-1)elif cnt <= cnt2:print(cnt)else:print(cnt2 +min(cnt2 -1, cnt1, cnt - cnt2))
x =list(input())print("".join(sorted(x, reverse=True)), end=" ")
num ='9'; idx =-1for i, data inenumerate(x):if data !='0'and data <= num:
num = data; idx = i
new = x[: idx]+ x[idx +1:]
new.sort()print(num +"".join(new))
n, K =map(int,input().split())
a =[0]+list(map(int,input().split()))
dic ={}; ans = n
for i inrange(1, n +1):if a[i]*2!= K and K - a[i]in dic:
times =max(dic.get(K - a[i]),min(i, n - i +1))
ans =min(ans, times)
dic[a[i]]=min(dic.get(a[i], n),min(i, n - i +1))print(ans if ans != n else-1)
N =1000005; prime =[True]* N
prime[0]= prime[1]=False
lst1 =list()for i inrange(2, N):if prime[i]:
lst1.append(i)for j inrange(i *2, N, i):
prime[j]=False
dic2 ={}for i inrange(1,1001):
dic2[i * i]=1defcheck(num):
dic ={}; i =0; cnt =0while num !=1:while num % lst1[i]==0:
num //= lst1[i]
dic[lst1[i]]= dic.get(lst1[i],0)+1
cnt += dic.get(lst1[i],0)%2
i +=1return cnt
N =int(input()); ans =0
h =list(map(int,input().split()))for i inrange(N):if h[i]in dic2:continueif prime[h[i]]:
ans +=1;continue
ans += check(h[i])print(ans)