After setting up the area. Chandu wanted all his toys to be stacked there in that area. So that all of them are accessible easily. Currently, He is having N stacks of toys each with height H_1,H_2...H_n (assuming all toys are of same height).Chandu did not like the configuration much and want to change the height of each stack. To increase the height of a particular stack he can add some toys to it and to decrease the height he can take out some toys from that stack. 
Chandu, knows that he requires X units of effort for putting up an item onto the stack and Y units of effort for removing it.
Help, chandu in setting up his toys.

Input:

First Line of input contains an integer t, which is the number of test cases. then, t lines follow where first line of each test case contains three integers N, X and Y then N lines follow containing two integers each a[i] and b[i] (Initial height of i\;th stack and final height of i\;th stack.)

Output:

Output an integer which is the minimum effort required.

NOTE:  he just need to make stacks of given height. Not necessarily each stack should be made from its corresponding stack. 

Constraints:

1 ≤ t ≤ 100,  
1 ≤ N ≤ 10^5,  
1 ≤ a[i],b[i] ≤ 10^6

SAMPLE INPUT
1
3 6 4
3 1
1 2
1 2

SAMPLE OUTPUT
10

Explanation

Here, He is having 3 stacks initially of height 3,1 and 1
He can take out one toy from first stack to get a stack with two toys with 4 units of effort.
He can put toy on second stack to get a stack with two toys with 6 units of effort.
Total effort = 10 units.
After the two operations he will have three stacks with required heights.
T = input()

def brokenInput():
	A = map(int, raw_input().strip().split())
	while len(A) < 3:
		A += map(int, raw_input().strip().split())
	return A

for _ in xrange(T):
	N, X, Y = brokenInput()
	effortRequired = 0
	initList = []
	finalList = []
	stacks = {}
	for __ in xrange(N):
		initH, finalH = map(int, raw_input().strip().split())
		
		if initH not in stacks: stacks[initH] = 1
		else: 
			stacks[initH] += 1
			if stacks[initH] == 0: del stacks[initH]
			
		if finalH not in stacks: stacks[finalH] = -1
		else:
			stacks[finalH] += -1
			if stacks[finalH] == 0: del stacks[finalH]
	for size, num in stacks.iteritems():
		if num < 0:
			while num < 0:
				finalList.append(size)
				num += 1
		else:
			while num > 0:
				initList.append(size)
				num -= 1
				
	initList.sort()
	finalList.sort()
	for i in xrange(len(initList)):
		diff = finalList.pop() - initList.pop()
		if diff > 0: effortRequired += diff * X
		else: effortRequired += diff * -1 * Y
	print effortRequired