You are given two strings A and B of length N and M respectively consisting of lowercase English letters. You can make several strings using characters from A. If you use any character of A to make the string, that character will be removed from A.
That means if you select an integer i from 1 to the length of the string A and use Ai, then the character Ai will be removed and the string length gets reduced by 1, the indices of characters to the right of the deleted one also get reduced by 1.
Find the maximum number of strings you can make the same as that of B.
Input format
Output format
For each test case, print the maximum number of strings you can make the same as that of B.
Constraints
1≤T≤101≤N,M≤105A and B contains lowercase English letters
For test case 1: The first string uses characters at indexes 1, 3, and 4 (1-based indexing). Hence, the answer is 1.
For test case 2: The first string uses characters at indexes 1, 2, and 4 (1-based indexing). The second string uses characters at indexes 5, 6, and 7 (1-based indexing). Hence, the answer is 2.