Naruto has an array A of N Integers and there is an array B of Ni Integers that Sakura loves. Sakura will be impressed by Naruto he can give her all the elements of her array B in the same order as in the array B. Fortunately, Naruto has all the elements of array B in his array A but they are not in the same order.
Naruto can do either of the two operations to take out the elements from the array A and give it to Sakura in the correct order
Keep taking out the first element of the array A until the first a element is the element that Sakura wants at present. If the element that Naruto took out is not wanted by Sakura at present, he will create a sadow clone of himself to hold that element und So kura wants It otherwise he will take out the first element and give it to Sakura. It takes him X amount of chakra to create a shadow clone.
If the element that Sakura wants is at the P-th position in the array then Naruto can create P-1 shadow clones at once which will take him Y amount of chakra Those shadow clones will take out the first P-1 elements and hold one element each until Sakura wants it. The P-th element will now become the first element of the array that Naruto can take out and give to Sakura
If any shadow clone is holding the element thar Sakura wants then Naruto will take that element from the shadow clone and give it to Sakura after which the shadow clone will disappear
Find the minimum amount of chakra that Naruto has to spend to impress Sakura.
Input Format :-
First line is the number of test cases.
Second line has three integers, N,X,Y
N- size of the array
X- cost of 1st operation
Y- cost of 2nd operation
Third Line has N elements of array A
Forth line has N elements of array B
Example Test Cases Input :-
2
6 3 4
5 6 1 3 4 2
1 5 2 4 6 3
6 4 3
4 3 2 1 5 6
2 4 1 3 5 6
Test Cases Output :-
8
3