There is a graph of $n$ rows and $10^6 + 2$ columns, where rows are numbered from $1$ to $n$ and columns from $0$ to $10^6 + 1$:

Let's denote the node in the row $i$ and column $j$ by $(i, j)$.

Initially for each $i$ the $i$-th row has exactly one obstacle — at node $(i, a_i)$. You want to move some obstacles so that you can reach node $(n, 10^6+1)$ from node $(1, 0)$ by moving through edges of this graph (you can't pass through obstacles). Moving one obstacle to an adjacent by edge free node costs $u$ or $v$ coins, as below:

If there is an obstacle in the node $(i, j)$, you can use $u$ coins to move it to $(i-1, j)$ or $(i+1, j)$, if such node exists and if there is no obstacle in that node currently.

If there is an obstacle in the node $(i, j)$, you can use $v$ coins to move it to $(i, j-1)$ or $(i, j+1)$, if such node exists and if there is no obstacle in that node currently.

Note that you can't move obstacles outside the grid. For example, you can't move an obstacle from $(1,1)$ to $(0,1)$.

Refer to the picture above for a better understanding.

Now you need to calculate the minimal number of coins you need to spend to be able to reach node $(n, 10^6+1)$ from node $(1, 0)$ by moving through edges of this graph without passing through obstacles.


-----Input-----

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

The first line of each test case contains three integers $n$, $u$ and $v$ ($2 \le n \le 100$, $1 \le u, v \le 10^9$) — the number of rows in the graph and the numbers of coins needed to move vertically and horizontally respectively.

The second line of each test case contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^6$) — where $a_i$ represents that the obstacle in the $i$-th row is in node $(i, a_i)$.

It's guaranteed that the sum of $n$ over all test cases doesn't exceed $2 \cdot 10^4$.


-----Output-----

For each test case, output a single integer — the minimal number of coins you need to spend to be able to reach node $(n, 10^6+1)$ from node $(1, 0)$ by moving through edges of this graph without passing through obstacles.

It can be shown that under the constraints of the problem there is always a way to make such a trip possible.


-----Examples-----

Input
3
2 3 4
2 2
2 3 4
3 2
2 4 3
3 2
Output
7
3
3


-----Note-----

In the first sample, two obstacles are at $(1, 2)$ and $(2,2)$. You can move the obstacle on $(2, 2)$ to $(2, 3)$, then to $(1, 3)$. The total cost is $u+v = 7$ coins.

In the second sample, two obstacles are at $(1, 3)$ and $(2,2)$. You can move the obstacle on $(1, 3)$ to $(2, 3)$. The cost is $u = 3$ coins.

Difficulty: EASY
Tags: Mathematics

Complete search
Skill types: Complete search

Starter code:

Solutions:
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	obstacle = list(map(int, input().split()))
	cost = 0
	diff = 0
	for i in range(n - 1):
		if abs(obstacle[i + 1] - obstacle[i]) > diff:
			diff = abs(obstacle[i + 1] - obstacle[i])
	if diff == 0:
		print(min(2 * v, u + v))
	elif diff == 1:
		print(min(u, v))
	else:
		print(0)


for _ in range(int(input())):
	(n, v, u) = map(int, input().split())
	a = [int(i) for i in input().split()]
	cost = min(u + v, u + u)
	prev = a[0]
	for i in range(1, n):
		if abs(a[i] - prev) > 1:
			cost = 0
			break
		if abs(a[i] - prev) == 1:
			cost = min(u, v)
		prev = a[i]
	print(cost)


import sys
input = sys.stdin.readline

def solve():
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	res = 4000000000.0
	for i in range(1, len(a)):
		if a[i] + 1 < a[i - 1] or a[i - 1] + 1 < a[i]:
			return 0
		if a[i - 1] < a[i] or a[i] < a[i - 1]:
			res = min(res, min(v, u))
		if a[i] == a[i - 1]:
			res = min(res, v + min(v, u))
	return res
t = int(input())
r = [0] * t
for z in range(t):
	r[z] = str(solve())
print('\n'.join(r))


for _ in range(int(input())):
	(n, u, v) = (int(x) for x in input().split())
	a = [int(x) for x in input().split()]
	count = v + min(u, v)
	for i in range(1, n):
		if abs(a[i - 1] - a[i]) > 1:
			count = 0
			break
		elif abs(a[i - 1] - a[i]) == 1:
			count = min(v, u)
	print(count)


import os
import sys
from io import BytesIO, IOBase
_print = print
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def inp():
	return sys.stdin.readline().rstrip()

def mpint():
	return map(int, inp().split(' '))

def itg():
	return int(inp())

def solve():
	(n, u, v) = mpint()
	index = tuple(mpint())
	max_dis = max([abs(index[i] - index[i + 1]) for i in range(n - 1)])
	if max_dis == 0:
		return min(v * 2, u + v)
	if max_dis == 1:
		return min(u, v)
	return 0

def main():
	for _ in range(itg()):
		print(solve())
DEBUG = 0
URL = 'https://codeforces.com/contest/1491/problem/B'
if DEBUG == 1:
	import requests
	from ACgenerator.Y_Test_Case_Runner import TestCaseRunner
	runner = TestCaseRunner(main, URL)
	inp = runner.input_stream
	print = runner.output_stream
	runner.checking()
else:
	if DEBUG != 2:
		(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
	if DEBUG:

		def print(*args, **kwargs):
			_print(*args, **kwargs)
			sys.stdout.flush()
	main()


import sys
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	A = list(map(int, input().split()))
	d = 0
	for i in range(n - 1):
		d = max(d, abs(A[i + 1] - A[i]))
	if d >= 2:
		print(0)
	elif d == 1:
		print(min(u, v))
	else:
		print(v + min(u, v))


import math
import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
for i in range(inp()):
	(n, u, v) = invr()
	l = inlt()
	k = []
	(flag, f) = (False, True)
	for i in range(1, n):
		if l[i] != l[i - 1]:
			f = False
		if abs(l[i] - l[i - 1]) > 1:
			flag = True
			break
	if f:
		print(min(u + v, 2 * v))
		continue
	elif flag:
		print(0)
		continue
	print(min(u, v))


for i in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	f = 0
	for i in range(n - 1):
		f = max([abs(abs(a[i] - a[i + 1])), f])
	if f == 0:
		print(min([u + v, 2 * v]))
	elif f == 1:
		print(min([v, u]))
	else:
		print(0)


import sys

def calculate(seq, u, v):
	prev = None
	num = []
	counter = 0
	for i in seq:
		if prev:
			if abs(prev - i) >= 2:
				return 0
			elif abs(prev - i) == 1:
				counter = 1
		prev = i
	if counter == 0:
		return min(u + v, 2 * v)
	else:
		return min(u, v)
t = int(sys.stdin.readline())
for _ in range(t):
	(n, u, v) = list(map(int, sys.stdin.readline().split()))
	obstacles = [int(i.strip()) for i in sys.stdin.readline().split()]
	print(calculate(obstacles, u, v))


import math
import sys
from sys import stdout

class IO:

	@staticmethod
	def string():
		return input()

	@staticmethod
	def int():
		return int(input())

	@staticmethod
	def list(sep=' '):
		return input().split(sep)

	@staticmethod
	def list_int(sep=' '):
		return list(map(int, input().split(sep)))

	@staticmethod
	def implode(sep, array):
		return sep.join((str(x) for x in array))

def solve():
	(n, u, v) = IO.list_int()
	a = IO.list_int()
	prev = a[0]
	m = 0
	for i in a:
		m = max(m, abs(i - prev))
		prev = i
		if m >= 2:
			break
	if m == 0:
		res = min(u + v, v + v)
	elif m == 1:
		res = min(u, v)
	else:
		res = 0
	print(res)
query_count = IO.int()
while query_count:
	query_count -= 1
	solve()


R = lambda : map(int, input().split())
(t,) = R()
exec(t * 'n,u,v=R();a=*R(),;d=max(abs(x-y)for x,y in zip(a,a[1:]));print(min(u,v)*(d<2)+v*(d<1));')


from sys import stdin, stdout
stdin.readline

def mp():
	return list(map(int, stdin.readline().strip().split()))

def it():
	return int(stdin.readline().strip())
from collections import deque
for _ in range(it()):
	(n, u, v) = mp()
	l = mp()
	k = 0
	for i in range(1, n):
		k = max(k, abs(l[i] - l[i - 1]))
	if k > 1:
		print(0)
	elif k == 1:
		print(min(u, v))
	else:
		print(min(2 * v, u + v))


def find_case(a):
	p = a[0]
	f = 2
	for x in a[1:]:
		if x > p + 1 or x < p - 1:
			return 0
		if not x == p:
			f = 1
		p = x
	return f
t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = [int(x) for x in input().split()]
	case = 0
	case = find_case(a)
	if case == 0:
		print(0)
	elif case == 1:
		print(min(u, v))
	else:
		print(min(u + v, v + v))


t = int(input())
while t > 0:
	ans = 0
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	for j in range(0, len(l) - 1):
		diff = abs(l[j + 1] - l[j])
		if diff > ans:
			ans = diff
	if ans > 1:
		print(0)
	if ans == 1:
		print(min(u, v))
	if ans == 0:
		print(min(v + v, u + v))
	t = t - 1


def f1(s):
	n = len(s)
	for i in range(n - 1):
		if abs(s[i] - s[i + 1]) > 1:
			return 0
		if s[i + 1] == 0:
			return 1
	return 0

def f2(s):
	n = len(s)
	for i in range(n - 1, 1, -1):
		if abs(s[i] - s[i - 1]) > 1:
			return 0
		if s[i - 1] == 10 ** 6 + 1:
			return 1
	return 0

def g(s):
	n = len(s)
	for i in range(n - 1):
		if abs(s[i] - s[i + 1]) > 1:
			return 0
	return 1
for i in range(int(input())):
	(n, a, b) = map(int, input().split())
	s = list(map(int, input().split()))
	m = 0
	if g(s) == 0:
		if f1(s) == 1:
			m += min(a, b)
		if f2(s) == 1:
			m += min(a, b)
	else:
		p = 1
		for elem in s:
			if elem != s[0]:
				p = 0
		m += min(a, b)
		if p == 1:
			m += b
	print(m)


from collections import defaultdict as df
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	ec = True
	all_cons = True
	for i in range(1, n):
		if not abs(l[i] - l[i - 1]) <= 1:
			ec = False
			break
	if len(set(l)) == 1:
		print(min(u + v, 2 * v))
	elif ec:
		print(min(u, v))
	else:
		print(0)


import sys
T = int(input())
while T > 0:
	T -= 1
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	ans = sys.maxsize
	if n == 2:
		if abs(arr[0] - arr[1]) == 0:
			ans = min(u + v, 2 * v)
		elif abs(arr[0] - arr[1]) == 1:
			ans = min(u, v)
		else:
			ans = 0
	else:
		isPossible = False
		isOne = False
		for i in range(1, n):
			if abs(arr[i] - arr[i - 1]) > 1:
				isPossible = True
				break
			if abs(arr[i] - arr[i - 1]) == 1:
				isOne = True
		if isPossible:
			ans = 0
		elif isOne:
			ans = min(u, v)
		else:
			ans = min(u + v, 2 * v)
	print(ans)


for _ in range(int(input())):
	(n, u, v) = input().split()
	(n, u, v) = (int(n), int(u), int(v))
	obs = list(map(int, input().split()))
	res = -1
	for i in range(n - 1):
		if abs(obs[i + 1] - obs[i]) >= 2:
			res = 0
			break
	if min(obs) == max(obs):
		print(min(u + v, 2 * v))
	elif res == 0:
		print(0)
	else:
		print(min(u, v))


for _ in range(int(input())):
	a = [int(x) for x in input().split()]
	n = a[0]
	u = a[1]
	v = a[2]
	coords = [int(x) for x in input().split()]
	answer = 0
	solved = False
	triangle = False
	for i in range(0, len(coords) - 1):
		if abs(coords[i] - coords[i + 1]) > 1:
			solved = True
			answer = 0
		elif abs(coords[i] - coords[i + 1]) == 1:
			triangle = True
	if solved:
		print(0)
	else:
		if triangle:
			answer = min(u, v)
		else:
			answer = min(u + v, 2 * v)
		print(answer)


itype = int

def inp():
	return int(input())

def tinput():
	return list(map(itype, input().split(' ')))
for tc in range(int(input())):
	(n, u, v) = tinput()
	a = tinput()
	m = min(u, v)
	ans = v + m
	for i in range(len(a) - 1):
		if a[i] != a[i + 1]:
			if abs(a[i] - a[i + 1]) > 1:
				ans = 0
				break
			else:
				ans = m
	print(ans)


t = int(input())
for test in range(t):
	y = [int(x) for x in input().split()]
	r = [int(x) for x in input().split()]
	allZero = True
	allOne = True
	for i in range(y[0] - 1):
		if r[i] - r[i + 1] != 0:
			allZero = False
			if r[i] - r[i + 1] != 1 and r[i] - r[i + 1] != -1:
				allOne = False
				break
	if allOne == False:
		print(0)
	elif allZero == False:
		print(min(y[1], y[2]))
	else:
		print(y[2] + min(y[1], y[2]))


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
from queue import PriorityQueue as pq
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	m = sys.maxsize
	p = pow(10, 6)
	for i in range(n):
		if i == 0:
			if (i - 1 >= 0 or i + 1 <= p) and l[i + 1] not in [l[i], l[i] + 1, l[i] - 1]:
				m = 0
			if l[i + 1] != l[i]:
				m = min(m, min(u, v))
			if l[i] != l[i + 1] and (i + 2 < n and l[i] != l[i + 2]):
				m = min(m, 2 * u)
			m = min(m, 2 * v)
			if l[i] + 1 <= p and l[i + 1] != l[i] + 1:
				m = min(m, u + v)
			if l[i] - 1 >= 0 and l[i + 1] != l[i] - 1:
				m = min(m, u + v)
		elif i == n - 1:
			if (i - 1 >= 0 or i + 1 <= p) and l[i - 1] not in [l[i], l[i] + 1, l[i] - 1]:
				m = 0
			if l[i - 1] != l[i]:
				m = min(m, min(v, u))
			if l[i] != l[i - 1] and (i - 2 >= 0 and l[i] != l[i - 2]):
				m = min(m, 2 * u)
			m = min(m, 2 * v)
			if l[i] + 1 <= p and l[i - 1] != l[i] + 1:
				m = min(m, u + v)
			if l[i] - 1 >= 0 and l[i - 1] != l[i] - 1:
				m = min(m, u + v)
		else:
			if (i - 1 >= 0 or i + 1 <= p) and l[i + 1] not in [l[i], l[i] + 1, l[i] - 1]:
				m = 0
			if (i - 1 >= 0 or i + 1 <= p) and l[i - 1] not in [l[i], l[i] + 1, l[i] - 1]:
				m = 0
			if l[i + 1] != l[i] or l[i - 1] != l[i]:
				m = min(m, min(v, u))
			if l[i] != l[i + 1] and (i + 2 < n and l[i] != l[i + 2]):
				m = min(m, 2 * u)
			if l[i] != l[i - 1] and (i - 2 >= 0 and l[i] != l[i - 2]):
				m = min(m, 2 * u)
			m = min(m, 2 * v)
			if l[i] + 1 <= p and l[i + 1] != l[i] + 1:
				m = min(m, u + v)
			if l[i] - 1 >= 0 and l[i + 1] != l[i] - 1:
				m = min(m, u + v)
			if l[i] + 1 <= p and l[i - 1] != l[i] + 1:
				m = min(m, u + v)
			if l[i] - 1 >= 0 and l[i - 1] != l[i] - 1:
				m = min(m, u + v)
	print(m)


def func(n, u, v, obstacles):
	for i in range(n - 1):
		if abs(obstacles[i + 1] - obstacles[i]) >= 2:
			return 0
	if obstacles.count(obstacles[0]) == n:
		return min([2 * v, u + v])
	return min([u, v])
t = int(input())
for _ in range(t):
	(n, u, v) = list(map(int, input().split()))
	obstacles = list(map(int, input().split()))
	res = func(n, u, v, obstacles)
	print(res)


for u in range(int(input())):
	(n, u, v) = map(int, input().split())
	x = [int(w) for w in input().split()]
	ans = 0
	t = 0
	if x[0] == 1 and x[1] == 0:
		ans += min(u, v)
	if x[n - 1] == 1000000 and x[n - 2] == 1000001:
		ans += min(u, v)
	if ans == 0:
		for i in range(1, n):
			if x[i - 1] == x[i]:
				continue
			if abs(x[i - 1] - x[i]) > 1:
				t = 1
				break
			elif abs(x[i - 1] - x[i]) == 1:
				t = 2
		if t == 0:
			ans += min(u + v, 2 * v)
		elif t == 2:
			ans += min(u, v)
	print(ans)


from sys import *
input = stdin.readline
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 10 ** 10
	for i in range(n - 1, 0, -1):
		if a[i] == a[i - 1]:
			ans = min(ans, u + v, 2 * v)
		elif abs(a[i] - a[i - 1]) == 1:
			ans = min(ans, v, u)
		else:
			ans = 0
	print(ans)


for t in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = [int(i) for i in input().split()]
	m = 0
	for i in range(n - 1):
		x = abs(a[i] - a[i + 1])
		if x > m:
			m = x
	if m == 0:
		ans = min(2 * v, u + v)
	elif m == 1:
		ans = min(u, v)
	else:
		ans = 0
	print(ans)


import sys, math, itertools
from collections import Counter, deque, defaultdict
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush, heapify, nlargest
from copy import deepcopy
mod = 10 ** 9 + 7
INF = float('inf')

def inp():
	return int(sys.stdin.readline())

def inpl():
	return list(map(int, sys.stdin.readline().split()))

def inpl_1():
	return list(map(lambda x: int(x) - 1, sys.stdin.readline().split()))

def inps():
	return sys.stdin.readline()

def inpsl(x):
	tmp = sys.stdin.readline()
	return list(tmp[:x])

def err(x):
	print(x)
	exit()
for _ in range(inp()):
	(n, u, v) = inpl()
	a = inpl()
	if len(set(a)) == 1:
		res = min(u + v, v + v)
	else:
		ok = False
		for i in range(n - 1):
			if abs(a[i] - a[i + 1]) >= 2:
				ok = True
		if ok:
			res = 0
		else:
			res = min(u, v)
	print(res)


import sys, io, os, time
from collections import defaultdict
from collections import Counter
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'

def ceil(num, denom):
	return (num + denom - 1) // denom
input = sys.stdin.readline
for ii in range(int(input())):
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	if len(set(arr)) == 1:
		print(v + min(u, v))
	else:
		flag = True
		for i in range(n - 1):
			if abs(arr[i] - arr[i + 1]) > 1:
				flag = False
		if flag:
			print(min(u, v))
		else:
			print(0)


import sys
input = sys.stdin.readline
mv = 10 ** 6 + 1
T = int(input())
for _ in range(T):
	(n, u, v) = map(int, input().split())
	A = list(map(int, input().split()))
	flag = float('inf')
	for i in range(1, n):
		if A[i] == A[i - 1]:
			flag = min(flag, u + v, 2 * v)
		elif A[i] == A[i - 1] + 1:
			flag = min(flag, u, v)
		elif A[i] == A[i - 1] - 1:
			flag = min(flag, u, v)
		else:
			flag = 0
	print(flag)


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	(n, u, v) = map(int, input().split())
	A = list(map(int, input().split()))
	if len(set(A)) == 1:
		print(min(u + v, 2 * v))
		continue
	for i in range(1, n):
		if abs(A[i] - A[i - 1]) >= 2:
			print(0)
			break
	else:
		print(min(u, v))


import sys
import math
import heapq
import bisect
from collections import Counter
from collections import defaultdict
from io import BytesIO, IOBase
import string

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None
		self.BUFSIZE = 8192

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def get_int():
	return int(input())

def get_ints():
	return list(map(int, input().split(' ')))

def get_int_grid(n):
	return [get_ints() for _ in range(n)]

def get_str():
	return input().strip()

def get_strs():
	return input().strip().split(' ')

def yes_no(b):
	if b:
		return 'YES'
	else:
		return 'NO'

def binary_search(good, left, right, delta=1, right_true=False):
	limits = [left, right]
	while limits[1] - limits[0] > delta:
		if delta == 1:
			mid = sum(limits) // 2
		else:
			mid = sum(limits) / 2
		if good(mid):
			limits[int(right_true)] = mid
		else:
			limits[int(~right_true)] = mid
	if good(limits[int(right_true)]):
		return limits[int(right_true)]
	else:
		return False

def prefix_sums(a, drop_zero=False):
	p = [0]
	for x in a:
		p.append(p[-1] + x)
	if drop_zero:
		return p[1:]
	else:
		return p

def prefix_mins(a, drop_zero=False):
	p = [float('inf')]
	for x in a:
		p.append(min(p[-1], x))
	if drop_zero:
		return p[1:]
	else:
		return p

def solve_a():
	(n, q) = get_ints()
	a = get_ints()
	s = sum(a)
	ans = []
	for query in range(q):
		(t, k) = get_ints()
		if t == 1:
			if a[k - 1] == 1:
				a[k - 1] = 0
				s -= 1
			else:
				a[k - 1] = 1
				s += 1
		else:
			ans.append(int(s >= k))
	return ans

def solve_b():
	(n, u, v) = get_ints()
	a = get_ints()
	if min(a) == max(a):
		return min(v * 2, u + v)
	else:
		for i in range(1, n):
			if abs(a[i] - a[i - 1]) >= 2:
				return 0
		return min(u, v)
t = get_int()
for _ in range(t):
	print(solve_b())


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	M = min(u, v)
	i = 1
	F = a[0]
	answer = u + u + v + v
	if True:
		while i < n:
			if a[i] == F:
				ans = v + M
				if ans < answer:
					answer = ans
			elif a[i] == F + 1 or a[i] == F - 1:
				ans = M
				F = a[i]
				if ans < answer:
					answer = ans
			else:
				answer = 0
			i += 1
	print(answer)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	for i in range(n - 1):
		if abs(a[i] - a[i + 1]) >= 2:
			break
	else:
		if len(set(a)) == 1:
			print(min(u, v) + v)
			continue
		print(min(u, v))
		continue
	print(0)


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 0
	diag = 0
	flag = 0
	for i in range(n - 1):
		if a[i] <= a[i + 1] - 2 or a[i] >= a[i + 1] + 2:
			flag = 1
			break
		elif a[i] == a[i + 1] + 1 or a[i] == a[i + 1] - 1:
			diag += 1
	if flag == 0:
		if u <= v:
			if diag > 0:
				ans += u
			else:
				ans += v + u
		elif u > v:
			if diag > 0:
				ans += v
			else:
				ans += v * 2
	print(ans)


def main():
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	if min(arr) == max(arr):
		print(v + min(v, u))
		return
	res = 0
	b = True
	for i in range(1, n):
		if abs(arr[i] - arr[i - 1]) > 1:
			b = False
			break
	if b:
		print(min(v, u))
		return
	print(res)
for i in range(int(input())):
	main()


def solve(A, n, u, v):
	maxDiff = 0
	for i in range(n - 1):
		maxDiff = max(abs(A[i + 1] - A[i]), maxDiff)
	if maxDiff >= 2:
		return 0
	if maxDiff == 1:
		return min(u, v)
	return min(u + v, 2 * v)
t = int(input())
for tc in range(t):
	(n, u, v) = map(int, input().split())
	A = list(map(int, input().split()))
	result = solve(A, n, u, v)
	print(result)


from math import sqrt
import operator
import sys
inf = sys.stdin
input = inf.readline

def read_one_int():
	return int(input().rstrip('\n'))

def read_list_of_ints():
	res = [int(val) for val in input().rstrip('\n').split(' ')]
	return res

def read_str():
	return input().rstrip()

def check_seq(n, v, h, a_seq):
	cur_a = a_seq[0]
	have_shift = False
	for i in range(1, len(a_seq)):
		val = abs(a_seq[i - 1] - a_seq[i])
		if val > 1:
			return 0
		if val == 1:
			have_shift = True
	if have_shift:
		return min(h, v)
	else:
		return min(h + h, h + v)

def main():
	cnt = read_one_int()
	for _ in range(cnt):
		(n, u, v) = read_list_of_ints()
		a_seq = read_list_of_ints()
		res = check_seq(n, u, v, a_seq)
		print(res)
main()


import math, sys
from collections import defaultdict, Counter, deque
from bisect import bisect_left, bisect_right
INF = float('inf')
MOD = int(1000000000.0) + 7
MAX = int(1000000.0) + 1

def solve():
	(n, v, u) = vars()
	arr = array()
	ans = INF
	for i in range(1, n):
		(s, t) = (arr[i - 1], arr[i])
		if s != t:
			if s > t:
				(s, t) = (t, s)
			if t - s > 1:
				print(0)
				return
			tmp = 0
			if t <= MAX - 1:
				tmp = min(u, v)
			else:
				tmp = 2 * u
		else:
			tmp = min(2 * u, u + v)
		ans = min(ans, tmp)
	print(ans)

def main():
	t = 1
	t = int(input())
	for _ in range(t):
		solve()

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def input():
	return sys.stdin.readline().rstrip('\n').strip()

def print(*args, sep=' ', end='\n'):
	first = True
	for arg in args:
		if not first:
			sys.stdout.write(sep)
		sys.stdout.write(str(arg))
		first = False
	sys.stdout.write(end)
primes = [1 for i in range(MAX)]

def sieve():
	global primes
	primes[0] = primes[1] = 0
	i = 2
	while i <= MAX ** 0.5:
		j = i * i
		while primes[i] and j < MAX:
			if j % i == 0:
				primes[j] = 0
			j += i
		i += 1

def vars():
	return map(int, input().split())

def array():
	return list(vars())
main()


import os, sys, time, collections, math, pprint, itertools as it, operator as op, bisect as bs, functools as fn
(maxx, localsys, mod) = (float('inf'), 0, int(1000000000.0 + 7))
nCr = lambda n, r: reduce(mul, range(n - r + 1, n + 1), 1) // factorial(r)
ceil = lambda n, x: (n + x - 1) // x
(osi, oso) = ('/home/priyanshu/Documents/cp/input.txt', '/home/priyanshu/Documents/cp/output.txt')
if os.path.exists(osi):
	sys.stdin = open(osi, 'r')
	sys.stdout = open(oso, 'w')
input = sys.stdin.readline

def maps():
	return map(int, input().split())
for _ in range(int(input())):
	(n, u, v) = maps()
	a = list(maps())
	b = sorted([abs(a[i] - a[i - 1]) for i in range(1, n)])
	print(0 if b[-1] > 1 else min(u, v) if 1 in b else v + min(u, v))


t = int(input())
for i in range(t):
	(n, u, v) = map(int, input().split())
	lst = list(map(int, input().split()))
	c = 0
	for j in range(1, n):
		if lst[j] - lst[j - 1] != 0:
			c += 1
			break
	if c == 0:
		print(min(u, v) + v)
	else:
		c = 0
		for j in range(1, n):
			if abs(lst[j] - lst[j - 1]) > 1:
				c += 1
				break
		if c > 0:
			print(0)
		else:
			print(min(u, v))


tcs = int(input())
for tc in range(tcs):
	(n, u, v) = [int(x) for x in input().split()]
	obstacles = [int(x) for x in input().split()]
	prevObs = obstacles[0]
	bestDiff = -1
	for (i, obs) in enumerate(obstacles[1:]):
		diff = abs(prevObs - obs)
		bestDiff = max(diff, bestDiff)
		if diff > 1:
			ans = 0
			break
		prevObs = obs
	if bestDiff == 1:
		ans = min(v, u)
	if bestDiff == 0:
		ans = min(v + u, v * 2)
	print(ans)


import math

def getint():
	return [int(i) for i in input().split()]

def getstr():
	return [str(i) for i in input().split()]

def solve():
	(n, u, v) = getint()
	a = getint()
	flag = 1
	ans = 0
	for i in range(n - 1):
		if abs(a[i + 1] - a[i]) >= 2:
			flag = 0
			break
		if a[i + 1] - a[i] == 0:
			ans += 1
	if flag == 0:
		print(0)
	elif ans == n - 1:
		print(min(u + v, 2 * v))
	else:
		print(min(u, v))
for _ in range(int(input())):
	solve()


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	d = 0
	for i in range(1, n):
		e = abs(l[i] - l[i - 1])
		d = max(e, d)
	if d > 1:
		sys.stdout.write('0\n')
	else:
		if d == 0:
			ans = min(u + v, v * 2)
		else:
			ans = min(u, v)
		sys.stdout.write(str(ans) + '\n')


for t in range(int(input())):
	(n, u, v) = [int(k) for k in input().split()]
	a = [int(k) for k in input().split()]
	if max(a) == min(a):
		print(min(u + v, 2 * v))
		continue
	re = a[0] - 1
	for i in range(1, n):
		if a[i] - re > 2:
			re = 10 ** 6 + 1
		if a[i] - re < 0:
			re = 10 ** 6 + 1
		if a[i] == re:
			re -= 1
		if a[i] - re == 2:
			re += 1
	if re == 10 ** 6 + 1:
		print(0)
	else:
		print(min(u, v))


import sys

def solve():
	(n, u, v) = list(map(int, sys.stdin.readline().rstrip().split(' ')))
	a = list(map(int, sys.stdin.readline().rstrip().split(' ')))
	res = min(u + v, v * 2)
	for (x, y) in zip(a, a[1:]):
		if x > y:
			(x, y) = (y, x)
		if x + 2 <= y:
			res = 0
			break
		elif x + 1 == y:
			res = min(u, v)
	print(res)
t = int(sys.stdin.readline().rstrip())
for _ in range(t):
	solve()


from sys import stdin, stdout
stdin.readline

def mp():
	return list(map(int, stdin.readline().strip().split()))

def it():
	return int(stdin.readline().strip())
from collections import defaultdict as dd, Counter as C, deque
from math import ceil, gcd, sqrt, factorial
from itertools import permutations
for _ in range(it()):
	(n, u, v) = mp()
	l = mp()
	(flag, vertical) = (0, 0)
	ind = -1
	for i in range(1, n):
		if abs(l[i] - l[i - 1]) >= 2:
			flag = 1
		elif abs(l[i] - l[i - 1]) == 1:
			vertical = 1
			ind = i
	if flag:
		print(0)
	elif vertical:
		print(min(u, v))
	else:
		print(min(2 * v, v + u))


import sys

def debug(*args):
	print(*args, file=sys.stderr)

def read_str():
	return sys.stdin.readline().strip()

def read_int():
	return int(sys.stdin.readline().strip())

def read_ints():
	return map(int, sys.stdin.readline().strip().split())

def read_str_split():
	return list(sys.stdin.readline().strip())

def read_int_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def Main():
	t = read_int()
	for _ in range(t):
		(n, u, v) = read_ints()
		a = read_int_list()
		flag = False
		for i in range(n - 1):
			if abs(a[i + 1] - a[i]) > 1:
				flag = True
		if min(a) == max(a):
			print(min(v + u, v * 2))
		elif flag:
			print(0)
		else:
			print(min(u, v))
Main()


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = min(2 * v, u + v)
	if len(set(a)) > 1:
		ans = min(ans, u, v)
	for i in range(1, n):
		if abs(a[i] - a[i - 1]) > 1:
			ans = 0
	print(ans)


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	flag = 0
	for i in range(n - 1):
		if abs(l[i] - l[i + 1]) > 1:
			flag = 2
			break
		if l[i] != l[n - 1]:
			flag = 1
	if flag == 2:
		print(0)
	elif flag == 1:
		print(min(u, v))
	else:
		print(min(u + v, 2 * v))


for _ in range(int(input())):
	(n, v, h) = map(int, input().split())
	a = list(map(int, input().split()))
	d = 0
	c = 1
	for i in range(n - 1):
		if abs(a[i] - a[i + 1]) >= 2:
			c = 0
			break
		elif abs(a[i] - a[i + 1]) == 1:
			d = 1
	if c == 0:
		print(0)
	elif d == 1:
		print(min([v, h]))
	elif n == 2 and v < h:
		print(v + h)
	elif h < v:
		print(2 * h)
	else:
		print(v + h)


t = int(input())
for z in range(t):
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	ok = 1
	for i in range(n - 1):
		if abs(arr[i + 1] - arr[i]) >= 2:
			ok = 0
			break
	if ok == 0:
		print('0')
	elif len(set(arr)) == 1:
		print(min(u + v, v * 2))
	else:
		print(min(u, v))


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	if len(set(a)) == 1:
		print(min(u + v, v + v))
	else:
		for i in range(n - 1):
			if abs(a[i] - a[i + 1]) > 1:
				print(0)
				break
		else:
			print(min(u, v))


def arrIn():
	return list(map(int, input().split()))

def mapIn():
	return map(int, input().split())
for ii in range(int(input())):
	(n, u, v) = mapIn()
	a = arrIn()
	flag = True
	x = [0] * n
	if a[0] == a[1]:
		x[0] = min(2 * v, u + v)
	else:
		x[0] = min(u, v)
	mod = 10 ** 6
	for i in range(1, n):
		if a[i] == a[i - 1] or a[i] == a[i - 1] - 1 or a[i] == a[i - 1] + 1:
			if i > 0 and i < n - 1:
				if a[i] != a[i - 1] or a[i] != a[i + 1]:
					x[i] = min(u, v)
				else:
					x[i] = min(2 * v, u + v)
			elif a[i] == a[i - 1]:
				x[i] = min(2 * v, u + v)
			else:
				x[i] = min(u, v)
		else:
			flag = False
			break
	if flag == False:
		print(0)
	else:
		print(min(x))


import bisect
import math

def solve(arr, u, v):
	all_same = all((a == arr[0] for a in arr))
	if all_same:
		return min(u + v, 2 * v)
	for i in range(1, len(arr)):
		if abs(arr[i - 1] - arr[i]) >= 2:
			return 0
	return min(u, v)
q = int(input())
for _ in range(q):
	(n, u, v) = (int(i) for i in input().split(' '))
	arr = [int(i) for i in input().split(' ')]
	print(solve(arr, u, v))


try:
	t = int(input())
	for i in range(0, t):
		(n, u, v) = list(map(int, input().split(' ')))
		a = list(map(int, input().split(' ')))
		flag = 0
		if len(set(a)) == 1:
			print(min(u + v, v + v))
		else:
			for i in range(0, len(a) - 1):
				if abs(a[i] - a[i + 1]) > 1:
					print(0)
					flag = 1
					break
			if flag == 0:
				print(min(u, v))
except:
	pass


import sys
n = int(sys.stdin.readline())
for _ in range(n):
	(n, u, v) = map(int, sys.stdin.readline().split())
	obstacles = list(map(int, sys.stdin.readline().split()))
	sub = -1
	for i in range(n - 1):
		k = abs(obstacles[i + 1] - obstacles[i])
		if k > 1:
			sub = 2
			break
		sub = max(sub, k)
	if sub == 1:
		print(min(v, u))
	elif sub == 0:
		print(min(2 * v, v + u))
	else:
		print(0)


I = lambda : map(int, input().split())
for _ in [0] * int(input()):
	(n, u, v) = I()
	bb = list(I())
	co = min(u, v)
	for i in range(1, n):
		if abs(bb[i] - bb[i - 1]) > 1:
			co = 0
			break
	if co != 0 and len(set(bb)) == 1:
		co = min(u + v, 2 * v)
	print(co)


import sys

def read_file(filename):
	with open(filename, 'r') as fp:
		content = fp.read()
	lines = content.split('\n')
	return lines
lines = sys.stdin.readlines()
tests_number = lines[0]
tests_number = int(tests_number)
for t in range(1, 2 * tests_number + 1, 2):
	skip = False
	(n, u, v) = lines[t].split()
	(n, u, v) = (int(n), int(u), int(v))
	a = [int(x) for x in lines[t + 1].split()]
	max_diff = 0
	for i in range(n - 1):
		diff = abs(a[i + 1] - a[i])
		if diff > 1:
			print(0)
			skip = True
			break
		max_diff = max(max_diff, diff)
	if skip:
		continue
	elif max_diff == 1:
		print(min(u, v))
	elif max_diff == 0:
		print(min(2 * v, u + v))


kk = 'abcdefghijklmnopqrstuvwxyz'
for i in range(int(input())):
	(n, u, w) = map(int, input().split())
	A = list(map(int, input().split()))
	if A.count(A[0]) == n:
		print(min(u + w, 2 * w))
	else:
		fl = 0
		for i in range(n - 1):
			if abs(A[i] - A[i + 1]) > 1:
				fl = 1
				break
		if fl == 1:
			print(0)
		else:
			print(min(u, w))


t = int(input())
for _ in range(t):
	(n, p, q) = map(int, input().split())
	ob = list(map(int, input().split()))
	c = 0
	if len(set(ob)) == 1:
		print(min(p + q, 2 * q))
	else:
		for i in range(len(ob) - 1):
			if abs(ob[i] - ob[i + 1]) > 1:
				c = 1
				break
		if c:
			if ob[n - 2] == 1000001 and ob[n - 1] == 1000000:
				print(min(p, q))
			else:
				print(0)
		else:
			print(min(p, q))


def fun(ls, u, v):
	if len(set(ls)) == 1:
		print(v + min(v, u))
		return
	prv = ls[0]
	ans = 0
	for i in ls[1:]:
		ans = max(ans, abs(i - prv))
		prv = i
	if ans >= 2:
		print(0)
	else:
		print(min(v, u))
T = int(input())
for i in range(T):
	(n, u, v) = list(map(int, input().split()))
	ls = list(map(int, input().split()))
	fun(ls, u, v)


for i in range(int(input())):
	(n, u, v) = map(int, input().split())
	arr = [*map(int, input().split())]
	maxDif = 0
	for j in range(len(arr) - 1):
		if abs(arr[j] - arr[j + 1]) > maxDif:
			maxDif = abs(arr[j] - arr[j + 1])
	if maxDif == 0:
		print(min(u + v, 2 * v))
	elif maxDif == 1:
		print(min(u, v))
	else:
		print(0)


def minimalCost(n, u, v, a):
	f = 0
	for x in range(n - 1):
		if abs(a[x] - a[x + 1]) >= 2:
			return 0
		elif abs(a[x] - a[x + 1]) == 0:
			f += 1
		else:
			continue
	if f == n - 1:
		return v + min(u, v)
	else:
		return min(u, v)
t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	print(minimalCost(n, u, v, a))


import math
from collections import defaultdict
from math import comb
from sys import stdout
NO = 'NO'
YES = 'YES'
MOD = 1000000007

def input_int():
	return int(input())

def input_list():
	return input().split(' ')

def input_list_int():
	return list(map(int, input_list()))

def z_func(s):
	n = len(s)
	z = [0] * n
	l = r = 0
	for i in range(1, n):
		if r >= i:
			z[i] = min(z[i - l], r - i + 1)
		while z[i] + i < n and s[z[i]] == s[z[i] + i]:
			z[i] += 1
		if i + z[i] - 1 > r:
			l = i
			r = i + z[i] - 1
	return z
global_ans = []

def p(a):
	global_ans.append(a)

def solve():
	(n, u, v) = input_list_int()
	a = input_list_int()
	ans = u + v
	for i in range(n - 1):
		t = abs(a[i] - a[i + 1])
		if t > 1:
			p(0)
			return
		elif t == 0:
			ans = min(ans, v + v, v + u)
		else:
			ans = min(ans, v, u)
	p(ans)
query_count = 1
query_count = input_int()
while query_count:
	query_count -= 1
	solve()
for global_ans_line in global_ans:
	print(global_ans_line)


test = int(input())
for t in range(test):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	l = 1
	e = 0
	c = a[0]
	for i in a:
		if i != c:
			l = 0
		if i < c - 1 or i > c + 1:
			e = 1
		c = i
	if e == 1:
		print(0)
	elif l == 0:
		print(min(u, v))
	else:
		print(v + min(u, v))


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz/'
M = 1000000007
EPS = 1e-06

def Ceil(a, b):
	return a // b + int(a % b > 0)

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(int(input())):
	(n, u, v) = map(int, input().split(' '))
	a = list(map(int, input().split(' ')))
	done = False
	for x in range(1, n):
		if abs(a[x] - a[x - 1]) > 1:
			done = True
	if done == True:
		print(0)
	elif len(set(a)) == 1:
		print(min(2 * v, u + v))
	else:
		print(min(u, v))


t = int(input())
for test in range(t):
	(n, u, v) = list(map(int, input().split()))
	op = list(map(int, input().split()))
	distance = [0] * n
	price = 0
	can_reach_row = True
	max_distance = 0
	found = False
	for i in range(1, n):
		if op[i] == 0:
			can_reach_row = False
		distance[i] = abs(op[i] - op[i - 1])
		if distance[i] >= max_distance:
			max_distance = distance[i]
		if distance[i] >= 2:
			if can_reach_row:
				print(price)
				found = True
				break
	if found:
		continue
	if max_distance == 1:
		print(min(u, v))
	else:
		print(min(2 * v, u + v))


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = [int(i) for i in input().split()]
	ans = int(2000000000.0 + 10)
	for i in range(n - 1):
		if a[i] != a[i + 1] - 1 and a[i] != a[i + 1] and (a[i] != a[i + 1] + 1):
			ans = 0
			break
		elif a[i] == a[i + 1]:
			ans = min(ans, 2 * v)
			ans = min(ans, u + v)
			if i < n - 2 and a[i + 2] != a[i + 1]:
				ans = min(ans, u)
			if i > 0 and a[i - 1] != a[i]:
				ans = min(ans, u)
		else:
			ans = min(ans, u)
			ans = min(ans, v)
	print(ans)


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	p = list(map(int, input().split()))
	dis = 0
	for i in range(1, len(p)):
		dis = max(dis, abs(p[i] - p[i - 1]))
	x = set(p)
	if dis >= 2:
		ans = 0
	elif len(x) == 1:
		ans = min(2 * v, u + v)
	else:
		ans = min(u, v)
	print(ans)


import sys
import math
from collections import defaultdict, Counter, deque
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
t = int(input())
for i in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	ma = 0
	for j in range(1, n):
		ma = max(ma, abs(a[j] - a[j - 1]))
	if ma >= 2:
		print(0)
	elif ma == 1:
		print(min(u, v))
	else:
		print(min(2 * v, u + v))


import os
import sys
from io import BytesIO, IOBase

def main():
	T = int(input())
	for _ in range(T):
		(n, u, v) = map(int, input().split())
		A = list(map(int, input().split()))
		ans = 10 ** 18
		for i in range(n - 1):
			if abs(A[i] - A[i + 1]) == 0:
				ans = min(ans, u + v, 2 * v)
			elif abs(A[i] - A[i + 1]) == 1:
				ans = min(ans, u, v)
			else:
				ans = min(ans, 0)
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from sys import stdin, stdout
t = int(input())
for _ in range(t):
	(n, u, v) = map(int, stdin.readline().split())
	arr = list(map(int, stdin.readline().split()))
	flag = False
	for i in range(1, n):
		if abs(arr[i] - arr[i - 1]) > 1:
			flag = True
			break
	if flag:
		stdout.write('0\n')
	else:
		flag2 = False
		for i in range(1, n):
			if abs(arr[i] - arr[i - 1]) > 0:
				flag2 = True
				break
		if flag2:
			ans = min(u, v)
			stdout.write(str(ans) + '\n')
		else:
			ans = min(u + v, v + v)
			stdout.write(str(ans) + '\n')


import sys
input = sys.stdin.readline
import math
import copy
t = int(input())
for f in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	s = set(a)
	if len(s) == 1:
		print(min(u + v, 2 * v))
	else:
		check = a[0]
		flg = 1
		for i in range(n - 1):
			if abs(a[i + 1] - check) <= 1:
				check = a[i + 1]
			else:
				flg = 0
				break
		if flg:
			print(min(u, v))
		else:
			print(0)


def answer(n, u, v, ary):
	min_price = max(2 * v, u + v)
	for i in range(len(ary) - 1):
		if abs(ary[i + 1] - ary[i]) >= 2:
			min_price = 0
			return min_price
		elif abs(ary[i + 1] - ary[i]) == 1:
			price = min(u, v)
			if price < min_price:
				min_price = price
		else:
			price = min(2 * v, u + v)
			if price < min_price:
				min_price = price
	return min_price

def main():
	t = int(input())
	n = [0] * t
	u = [0] * t
	v = [0] * t
	ary = [0] * t
	for j in range(t):
		(n[j], u[j], v[j]) = [int(i) for i in input().split()]
		ary[j] = [int(i) for i in input().split()]
	for j in range(t):
		print(answer(n[j], u[j], v[j], ary[j]))
main()


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = [int(x) for x in input().split()]
	x = 0
	for i in range(1, n):
		x = max(x, abs(a[i] - a[i - 1]))
	if x == 1:
		print(min(u, v))
	elif x == 0:
		print(min(2 * v, u + v))
	else:
		print(0)


for _ in range(int(input())):
	(n, v, u) = map(int, input().split())
	a = [int(x) for x in input().split()]
	if len(set(a)) == 1:
		print(min(2 * u, u + v))
	else:
		flag = False
		for i in range(1, n):
			if abs(a[i] - a[i - 1]) > 1:
				flag = True
				break
		if flag:
			print(0)
		else:
			print(min(u, v))


def main():
	num_cases = int(input())
	for case_num in range(1, num_cases + 1):
		solve(case_num)

def solve(case_num):
	(n, u, v) = [int(x) for x in input().split()]
	A = [int(x) for x in input().split()]
	if len(set(A)) == 1:
		print(min(v + v, v + u))
	elif any((abs(x - y) > 1 for (x, y) in zip(A[1:], A[:-1]))):
		print(0)
	else:
		print(min(v, u))
main()


p = lambda : map(int, input().split())
T = int(input())
for _ in range(T):
	(N, U, V) = p()
	a = list(p())
	d = [abs(a[i] - a[i - 1]) for i in range(1, N)]
	if max(d) > 1:
		print(0)
	elif max(d) == 1:
		print(min(U, V))
	else:
		print(min(U, V) + V)


t = int(input())
for i in range(t):
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	ans = float('inf')
	c = 1
	for i in range(1, n):
		if abs(l[i] - l[i - 1]) >= 2:
			ans = min(0, ans)
		if l[i] == l[0]:
			c = c + 1
	if c == n:
		ans = min(ans, min(2 * v, u + v))
	else:
		ans = min(ans, min(u, v))
	print(ans)


def help(n, j):
	count = 0
	for a in range(n):
		if A[a] == j:
			count += 1
		else:
			break
	return count

def solve(A, n, v, h):
	for i in range(n - 1):
		if A[i + 1] == A[i] or A[i + 1] == A[i] + 1 or A[i + 1] == A[i] - 1:
			continue
		else:
			return 0
	if help(n, A[0]) == n:
		return min(v + h, h + h)
	else:
		return min(v, h)
x = int(input())
for _ in range(x):
	X = list(map(int, input().split()))
	(n, v, h) = (X[0], X[1], X[2])
	A = list(map(int, input().split()))
	print(solve(A, n, v, h))


t = int(input())
for i in range(0, t):
	l1 = [int(x) for x in input().split()]
	l2 = [int(x) for x in input().split()]
	n = l1[0]
	u = l1[1]
	v = l1[2]
	last = l2[0]
	m = True
	for j in range(1, n):
		if l2[j] != last:
			m = False
			break
	if m == True:
		print(min(u + v, 2 * v))
	else:
		last = l2[0]
		m = False
		for j in range(1, n):
			if abs(l2[j] - last) > 1:
				m = True
			last = l2[j]
		if m == True:
			print(0)
		else:
			print(min(u, v))


t = int(input())
for k in range(t):
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	OK = 0
	for i in range(0, n - 1):
		if abs(arr[i] - arr[i + 1]) >= 2:
			OK = 2
			break
		elif abs(arr[i] - arr[i + 1]) == 1:
			OK = 1
	if OK == 2:
		print(0)
	elif OK == 1:
		print(min(u, v))
	else:
		print(min(u + v, v * 2))


import sys
input = sys.stdin.readline

def solution(n, u, v, a):
	if len(set(a)) == 1:
		print(min(u + v, 2 * v))
		return
	for r in range(n - 1):
		if abs(a[r] - a[r + 1]) >= 2:
			print(0)
			return
	print(min(u, v))
T = int(input())
for t in range(T):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	solution(n, u, v, a)


from math import *
from collections import *

def solve(n, u, v, a):
	ans = inf
	for i in range(1, n):
		if abs(a[i] - a[i - 1]) >= 2:
			ans = 0
		if abs(a[i] - a[i - 1]) == 1:
			ans = min(ans, min(u, v))
		if a[i] == a[i - 1]:
			ans = min(ans, v + min(u, v))
	return ans
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	print(solve(n, u, v, a))


def min_cost():
	(n, u, v) = [int(i) for i in input().split()]
	obstacles = input().split()
	obstacles = [int(i) for i in obstacles]
	if len(obstacles) == obstacles.count(obstacles[0]):
		if u < v:
			return v + u
		else:
			return 2 * v
	disp1 = False
	for i in range(len(obstacles)):
		if i == 0:
			if abs(obstacles[i] - obstacles[i + 1]) == 1:
				disp1 = True
			elif abs(obstacles[i] - obstacles[i + 1]) > 1:
				return 0
		elif i == n - 1:
			if abs(obstacles[i] - obstacles[i - 1]) == 1:
				disp1 = True
			elif abs(obstacles[i] - obstacles[i - 1]) > 1:
				return 0
		else:
			if abs(obstacles[i] - obstacles[i - 1]) == 1 or abs(obstacles[i] - obstacles[i + 1]) == 1:
				disp1 = True
			if abs(obstacles[i] - obstacles[i - 1]) > 1 or abs(obstacles[i] - obstacles[i + 1]) > 1:
				return 0
	return min(u, v)
num = int(input())
for _ in range(num):
	print(min_cost())


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	arr = [int(j) for j in input().split()]
	if arr.count(arr[0]) == n:
		ans = min(2 * v, u + v)
	else:
		ans = min(u, v)
	for i in range(1, n):
		if abs(arr[i] - arr[i - 1]) >= 2:
			ans = 0
	print(ans)


def diff(a, b):
	if a > b:
		return a - b
	else:
		return b - a
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = []
	for i in range(0, n - 1):
		if diff(a[i], a[i + 1]) > 1:
			ans.append(0)
		elif diff(a[i], a[i + 1]) == 1:
			ans.append(min(u, v))
		elif diff(a[i], a[i + 1]) == 0:
			ans.append(min(v + v, u + v))
	ans.sort()
	print(ans[0])


t = int(input())
for t in range(t):
	(n, u, v) = map(int, input().split())
	a = [int(i) for i in input().split()]
	prev = a[0]
	max_diff = -1
	for i in range(1, len(a)):
		max_diff = max(max_diff, abs(a[i] - prev))
		prev = a[i]
	if max_diff == 0:
		print(min(u + v, 2 * v))
	elif max_diff == 1:
		print(min(u, v))
	else:
		print(0)


from collections import Counter
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	f = False
	e = True
	for i in range(1, n):
		if abs(l[i] - l[i - 1]) >= 2:
			f = True
		if l[i] != l[i - 1]:
			e = False
	if e == False and f == False:
		print(min(u, v))
	elif e == True and f == False:
		print(min(v + v, u + v))
	elif f:
		print(0)


for t in range(int(input())):
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	p = 0
	q = 1
	for i in range(1, n):
		if arr[i] != arr[i - 1]:
			q = 0
		if abs(arr[i] - arr[i - 1]) >= 2:
			p = 1
	if q == 0 and p == 0:
		print(min(u, v))
	elif q == 1 and p == 0:
		print(min(v + v, u + v))
	else:
		print(0)


for _ in range(int(input())):
	(n, u, v) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	max_diff = 0
	for i in range(1, n):
		max_diff = max(max_diff, abs(a[i] - a[i - 1]))
	if max_diff == 0:
		print(min(v + u, v + v))
	elif max_diff == 1:
		print(min(u, v))
	else:
		print(0)


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = [int(i) for i in input().split()]
	c = 0
	for i in range(n - 1):
		if abs(a[i] - a[i + 1]) >= 2:
			c = 2
			break
		if a[i] != a[i + 1]:
			c = 1
	if c == 0:
		print(v + min(u, v))
	elif c == 1:
		print(min(u, v))
	else:
		print(0)


from sys import stdin, stdout

def read_ints():
	return map(int, stdin.readline().split())

def max_diff(a_seq):
	return max((abs(a2 - a1) for (a1, a2) in zip(a_seq[0:], a_seq[1:])))
(t_n,) = read_ints()
for i_t in range(t_n):
	(a_n, u_cost, v_cost) = read_ints()
	a_seq = tuple(read_ints())
	a_seq_max_diff = max_diff(a_seq)
	if a_seq_max_diff >= 2:
		result = 0
	elif a_seq_max_diff == 1:
		result = min(u_cost, v_cost)
	else:
		assert a_seq_max_diff == 0
		result = v_cost + min(u_cost, v_cost)
	stdout.write('%d\n' % result)


t = int(input())
for i in range(t):
	(n, u, v) = map(int, input().split())
	a = []
	a = input().split()
	mx = 0
	a[0] = int(a[0])
	for i in range(1, n):
		a[i] = int(a[i])
		if abs(a[i] - a[i - 1]) > mx:
			mx = abs(a[i] - a[i - 1])
	if mx < 2:
		if mx == 0:
			print(v + min(u, v))
		else:
			print(min(u, v))
	else:
		print('0')


out = []
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	hi = 0
	for i in range(n - 1):
		if abs(arr[i] - arr[i + 1]) >= 2:
			hi = -1
			break
		hi = max(hi, abs(arr[i] - arr[i + 1]))
	if hi == -1:
		out.append('0')
	elif hi == 0:
		out.append(str(min(u + v, v + v)))
	else:
		out.append(str(min(u, v)))
print('\n'.join(out))


import sys
input = sys.stdin.readline

def read_number():
	return int(input())

def read_list():
	return list(map(int, input().split()))

def read_string():
	s = input()
	return list(s[:len(s) - 1])

def read_separated_numbers():
	return map(int, input().split())
t = read_number()
col = 10 ** 6 + 1
for i in range(t):
	input_line = read_list()
	(n, u, v) = (input_line[0], input_line[1], input_line[2])
	a = read_list()
	cost = 0
	new_a = [abs(a[j + 1] - a[j]) for j in range(len(a) - 1)]
	max_diff = max(new_a)
	if max_diff > 1:
		print(cost)
		continue
	if max_diff == 1:
		cost = min(u, v)
		print(cost)
		continue
	if max_diff == 0:
		cost = min(u + v, 2 * v)
		print(cost)
		continue


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = [int(item) for item in input().split()]
	seq = True
	closed = True
	for (a1, a2) in zip(a, a[1:]):
		if abs(a1 - a2) > 1:
			seq = False
		if a2 == 0:
			break
	if not seq:
		ans = 0
	elif a.count(a[0]) == n:
		ans = min(u + v, v + v)
	else:
		ans = min(u, v)
	print(ans)


def solve(obs, n, u, v):
	dist = max((abs(obs[i - 1] - obs[i]) for i in range(1, n)))
	if dist > 1:
		return 0
	if dist == 1:
		return min(u, v)
	return v + min(u, v)
t = int(input())
res = []
for _ in range(t):
	(n, u, v) = map(int, input().split())
	obs = list(map(int, input().split()))
	res.append(solve(obs, n, u, v))
print('\n'.join(map(str, res)))


from sys import stdin, stdout, setrecursionlimit
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm, accumulate
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
setrecursionlimit(10 ** 9)
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return input()

def num():
	return int(input())

def L():
	return list(sp())

def LF():
	return list(spf())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def spf():
	return map(int, input.readline().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]

def pmat(A):
	for ele in A:
		print(*ele, end='\n')

def pmat2(A):
	for ele in A:
		for j in ele:
			print(j, end='')
		print()

def iseven(n):
	return n % 2 == 0

def seive(r):
	prime = [1 for i in range(r + 1)]
	prime[0] = 0
	prime[1] = 0
	for i in range(r + 1):
		if prime[i]:
			for j in range(2 * i, r + 1, i):
				prime[j] = 0
	return prime
for _ in range(int(input())):
	(n, u, v) = sp()
	a = L()
	if len(set(a)) == 1:
		print(min(v + v, v + u))
	elif any((abs(x - y) > 1 for (x, y) in zip(a[1:], a[:-1]))):
		print(0)
	else:
		print(min(v, u))
endtime = time.time()


import math
from sys import stdin
from heapq import *
from itertools import permutations
from collections import Counter, OrderedDict, deque
inp = lambda : stdin.readline().strip()
ii = lambda : int(inp())
si = lambda : map(int, inp().split())
sf = lambda : map(float, inp().split())
li = lambda : list(si())
lf = lambda : list(sf())
lin = lambda : list(inp())
liin = lambda : [int(c) for c in inp()]
infy = float('inf')
mod = int(1000000000.0) + 7
t = ii()
for _ in range(t):
	(n, u, v) = si()
	arr = li()
	ans = 0
	if arr.count(arr[0]) == n:
		ans = min(2 * v, u + v)
	else:
		mDiff = 0
		for i in range(1, n):
			mDiff = max(mDiff, abs(arr[i] - arr[i - 1]))
		if mDiff <= 1:
			ans = min(u, v)
	print(ans)


import sys
input = lambda : sys.stdin.readline().rstrip()
T = int(input())
for _ in range(T):
	(n, u, v) = map(int, input().split())
	A = [int(a) for a in input().split()]
	for (a, b) in zip(A, A[1:]):
		if abs(a - b) > 1:
			print(0)
			break
	else:
		print(min(u, v) + (v if max(A) == min(A) else 0))


def solve(a, u, v):
	if all((x == a[0] for x in a)):
		return v + min(u, v)
	p = a[0]
	for i in a:
		if abs(i - p) > 1:
			return 0
		p = i
	return min(u, v)
t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	print(solve(a, u, v))


import sys
import math
import bisect
import functools
from functools import lru_cache
from sys import stdin, stdout
from math import gcd, floor, sqrt, log, ceil
from heapq import heappush, heappop, heapify
from collections import defaultdict as dd
from collections import Counter as cc
from bisect import bisect_left as bl
from bisect import bisect_right as br

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)
sys.setrecursionlimit(100000000)
intinp = lambda : int(input().strip())
stripinp = lambda : input().strip()
fltarr = lambda : list(map(float, input().strip().split()))
intarr = lambda : list(map(int, input().strip().split()))
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
MOD = 1000000007
num_cases = intinp()
for _ in range(num_cases):
	(n, u, v) = intarr()
	arr = intarr()
	c = set(arr)
	flag = False
	p = -1
	for i in arr:
		if p == -1:
			p = i
		else:
			if abs(i - p) > 1:
				flag = True
				break
			p = i
	if len(c) > 1 and (not flag):
		print(min(u, v))
	elif flag:
		print(0)
	else:
		print(min(u + v, v + v))


for _ in range(int(input())):
	(n, u, v) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	type1 = False
	type2 = False
	for i in range(n - 1):
		dis = abs(a[i] - a[i + 1])
		if dis == 1:
			type1 = True
		elif dis > 1:
			type2 = True
	if type2:
		print(0)
	elif type1:
		print(v if v < u else u)
	else:
		print(2 * v if v < u else v + u)


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	v1 = list(map(int, input().split()))
	mini = 0
	for i in range(n - 1):
		mini = max(mini, abs(v1[i] - v1[i + 1]))
	if mini == 0:
		print(min(2 * v, u + v))
	elif mini > 1:
		print(0)
	else:
		print(min(u, v))


T = int(input())
for _ in range(T):
	(n, u, v) = map(int, input().split())
	lst = [int(x) for x in input().split()]
	pre = lst[0]
	(same, cave) = (0, 0)
	for i in range(1, n):
		c = lst[i]
		if c == pre:
			same += 1
		elif abs(c - pre) > 1:
			cave += 1
		pre = c
	if cave:
		print(0)
	elif same == n - 1:
		print(v + min(u, v))
	else:
		print(min(u, v))


def solve(arr, u, v, ans):
	max_diff = 0
	for i in range(len(arr) - 1):
		max_diff = max(max_diff, abs(arr[i] - arr[i + 1]))
	n = len(arr)
	if max_diff == 0:
		if v <= u:
			total = 2 * v
		else:
			total = u + v
	elif max_diff == 1:
		total = min(u, v)
	else:
		total = 0
	ans.append(str(total))

def main():
	t = int(input())
	ans = []
	for i in range(t):
		(n, u, v) = map(int, input().split())
		arr = list(map(int, input().split()))
		solve(arr, u, v, ans)
	print('\n'.join(ans))
main()


import collections

def solveTestCase():
	(n, u, v) = [int(i) for i in input().split()]
	a = [int(i) for i in input().split()]
	mx = 0
	for i in range(n - 1):
		mx = max(mx, abs(a[i] - a[i + 1]))
	if mx >= 2:
		print(0)
	elif mx == 1:
		print(min(u, v))
	else:
		print(v + min(u, v))
t = int(input())
while t > 0:
	t -= 1
	solveTestCase()


from collections import Counter, defaultdict, OrderedDict, deque
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from typing import List
import itertools
import math
import heapq
import string
import random
(MIN, MAX, MOD) = (-1061109567, 1061109567, 1000000007)
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())
for _ in range(N()):
	(n, u, v) = RL()
	a = RLL()
	f = False
	for i in range(n - 1):
		if abs(a[i] - a[i + 1]) > 1:
			f = True
			print(0)
			break
	else:
		if len(set(a)) == 1:
			print(min(v + v, u + v))
		else:
			print(min(u, v))


def main():
	t = int(input())
	for _ in range(t):
		(n, u, v) = list(map(int, input().split()))
		a = list(map(int, input().split()))
		cost = -1
		prev = a[0]
		for a_i in a:
			if a_i != prev:
				if a_i - prev > 1 or a_i - prev < -1:
					cost = 0
					break
				else:
					cost = min(u, v)
			prev = a_i
		if cost == -1:
			cost = min(u + v, 2 * v)
		print(cost)
main()


import math

def solve():
	t = int(input())
	for _ in range(t):
		(n, u, v) = map(int, input().split())
		a = list(map(int, input().split()))
		answer = math.inf
		for i in range(0, n - 1):
			difference = abs(a[i] - a[i + 1])
			if difference >= 2:
				answer = min(answer, 0)
			elif difference >= 1:
				answer = min(answer, min(u, v))
			else:
				answer = min(answer, v + min(u, v))
		print(answer)
solve()


import sys
import math
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2, floor, log
from bisect import bisect_right, bisect_left, bisect
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)
T = 1
N = 10000
T = int(stdin.readline())
for _ in range(T):
	(n, u, v) = list(map(int, stdin.readline().rstrip().split()))
	a = list(map(int, stdin.readline().rstrip().split()))
	ans = 0
	isOk = False
	if a.count(a[0]) == n:
		ans += min(u + v, 2 * v)
	else:
		ans += min(u, v)
	for i in range(n - 1):
		if abs(a[i + 1] - a[i]) >= 2:
			isOk = True
			break
	if isOk:
		print(0)
	else:
		print(ans)


test_case = int(input())
for _ in range(test_case):
	(n, y, x) = map(int, input().split())
	obstacles = list(map(int, input().split()))
	diagonal_vertical = False
	vertical = False
	go_ahead = True
	for i in range(1, n):
		if abs(obstacles[i] - obstacles[i - 1]) > 1:
			print(0)
			go_ahead = False
			break
		elif diagonal_vertical == False:
			if abs(obstacles[i] - obstacles[i - 1]) == 1:
				diagonal_vertical = True
		elif vertical == False:
			if abs(obstacles[i] - obstacles[i - 1]) == 0:
				vertical = True
	if go_ahead:
		if diagonal_vertical:
			print(min(x, y))
		else:
			print(x + min(x, y))


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	r = list(map(int, input().split()))
	ans = 0
	val = -1
	for i in range(1, n):
		d = abs(r[i] - r[i - 1])
		val = max(val, d)
	if val == 0:
		print(min(u + v, v + v))
	elif val == 1:
		print(min(u, v))
	else:
		print(0)


from collections import defaultdict, deque
from sys import stdin, stdout
from bisect import bisect_left
from math import gcd
printt = stdout.write
t = int(stdin.readline().strip())
for _ in range(t):
	(n, u, v) = map(int, stdin.readline().split())
	l = list(map(int, stdin.readline().split()))
	(a, b, c) = (0, 0, 0)
	ans = 0
	for i in range(1, n):
		z = l[i] - l[i - 1]
		if z < 0:
			z = 0 - z
		if z >= 2:
			a += 1
		elif z == 1:
			b += 1
		else:
			c += 1
	if l[0] == 1 and l[1] == 0:
		b -= 1
		ans += min(u, v)
	if l[n - 1] == 1000000 and l[n - 2] == 1000001:
		b -= 1
		ans += min(u, v)
	if a > 0:
		ans += 0
	elif b > 0:
		ans += min(u, v)
	elif c > 0:
		ans += min(v + v, u + v)
	printt(str(ans) + '\n')


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	coins = float('inf')
	for i in range(1, n):
		if abs(a[i] - a[i - 1]) == 0:
			coins = min(coins, v + min(u, v))
		elif abs(a[i] - a[i - 1]) == 1:
			coins = min(coins, min(u, v))
		elif abs(a[i] - a[i - 1]) > 1:
			coins = 0
	print(coins)


import sys
import math

class DictList(dict):

	def __setitem__(self, key, value):
		try:
			self[key].append(value)
		except KeyError:
			super(DictList, self).__setitem__(key, value)
		except AttributeError:
			super(DictList, self).__setitem__(key, [self[key], value])

def fn(n, u, v, a):
	d = 0
	for i in range(n - 1):
		diff = abs(a[i + 1] - a[i])
		if diff > d:
			d = diff
	if d >= 2:
		return 0
	if d == 1:
		return min(u, v)
	if d == 0:
		return min(u + v, 2 * v)
input = sys.stdin.read()
data = list(map(int, input.split()))
t = data[0]
l = 0
for i in range(t):
	n = data[l + 1]
	u = data[l + 2]
	v = data[l + 3]
	a = data[l + 4:l + 4 + n]
	l = l + 3 + n
	print(fn(n, u, v, a))


t = int(input())
for i in range(t):
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	new = []
	for i in range(n - 1):
		new.append(abs(l[i] - l[i + 1]))
	ans = max(new)
	ind = new.index(ans)
	sol = max(l[ind], l[ind + 1])
	if ans > 1:
		print(0)
	elif ans == 1 and sol != 10 ** 6 + 1:
		print(min(u, v))
	else:
		print(min(u + v, v + v))


import sys
pin = sys.stdin.readline
for T in range(int(pin())):
	(N, U, V) = map(int, pin().split())
	A = [*map(int, pin().split())]
	mx = 0
	for n in range(1, N):
		mx = max(abs(A[n] - A[n - 1]), mx)
	if mx > 1:
		print(0)
	elif mx == 1:
		print(min(U, V))
	elif mx == 0:
		print([2 * V, U + V][U < V])


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	ans = 10 ** 20
	for i in range(n - 1):
		if arr[i] == arr[i + 1]:
			ans = min(ans, v + min(u, v))
		if abs(arr[i + 1] - arr[i]) > 1:
			ans = 0
		if abs(arr[i] - arr[i + 1]) == 1:
			ans = min(ans, u, v)
	print(ans)


t = int(input())
for _ in range(t):
	ans = 0
	ok = False
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	for i in range(len(a) - 1):
		if abs(a[i] - a[i + 1]) > 1:
			ok = True
			break
	if ok:
		print(0)
	else:
		ok1 = True
		for i in range(len(a) - 1):
			ok1 &= a[i] == a[i + 1]
		if ok1:
			print(min(u + v, 2 * v))
		else:
			print(min(u, v))


q = int(input())
while q:
	(n, u, v) = input().split()
	n = int(n)
	u = int(u)
	v = int(v)
	a = input().split()
	a = [int(x) for x in a]
	check = False
	for i in range(1, n):
		if abs(a[i] - a[i - 1]) > 1:
			check = True
			break
	if check:
		print(0)
	else:
		check2 = False
		for i in range(1, n):
			if a[i] != a[i - 1]:
				check2 = True
				break
		if not check2:
			print(min(u + v, 2 * v))
		elif u < v:
			print(u)
		else:
			print(v)
	q -= 1


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	res = min(v + u, 2 * v)
	for i in range(1, n):
		if abs(a[i] - a[i - 1]) >= 2:
			res = 0
		elif abs(a[i] - a[i - 1]) == 1:
			res = min(res, min(u, v))
	print(res)


x = int(input())
while x > 0:
	x -= 1
	final_cost = 0
	(n, u, v) = map(int, input().split())
	if u < v:
		minimum = u
	else:
		minimum = v
	obstacles = list(map(int, input().split()))
	countExactly0 = 0
	countMore1 = 0
	for q in range(1, n):
		dist = abs(obstacles[q] - obstacles[q - 1])
		if dist > 1:
			countMore1 += 1
		elif dist == 0:
			countExactly0 += 1
	if countExactly0 == n - 1:
		final_cost = v + minimum
	elif countMore1 > 0:
		final_cost = 0
	else:
		final_cost = minimum
	print(final_cost)


for _ in range(int(input())):
	nuv = list(map(int, input().split()))
	n = nuv[0]
	u = nuv[1]
	v = nuv[2]
	ai = list(map(int, input().split()))
	arr = [abs(ai[i + 1] - ai[i]) for i in range(n - 1)]
	fltr_arr = list(filter(lambda x: x < 2, arr))
	fltr_arr1 = list(filter(lambda x: x < 1, arr))
	if len(arr) == len(fltr_arr):
		if v <= u and len(fltr_arr1) == len(arr):
			print(2 * v)
		if v > u and len(fltr_arr1) == len(arr):
			print(u + v)
		if len(fltr_arr1) != len(arr):
			print(min(u, v))
	else:
		print(0)


t = int(input())
while t:
	(n, v, h) = map(int, input().split())
	a = list(map(int, input().split()))
	diff = 0
	for i in range(1, n):
		diff = max(abs(a[i] - a[i - 1]), diff)
	if diff >= 2:
		print(0)
	elif diff == 1:
		print(min(v, h))
	elif diff == 0:
		print(min(h + h, v + h))
	t = t - 1


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import defaultdict as dd
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
stdmap = lambda : map(int, stdstr().split())
stdarr = lambda : list(map(int, stdstr().split()))
mod = 1000000007
for _ in range(stdint()):
	(n, u, v) = stdmap()
	arr = stdarr()
	if len(set(arr)) == 1:
		print(min(2 * v, u + v))
	else:
		req = True
		for i in range(n - 1):
			if abs(arr[i] - arr[i + 1]) > 1:
				req = False
				break
		if not req:
			print(0)
		else:
			print(min(u, v))


t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	nums = list(map(int, input().split()))
	if all((nums[i] == nums[0] for i in range(n))):
		print(v + min(u, v))
	elif all((abs(nums[i] - nums[i - 1]) <= 1 for i in range(1, n))):
		print(min(u, v))
	else:
		print(0)


def main():
	t = int(input())
	allans = []
	for _ in range(t):
		(n, u, v) = readIntArr()
		a = readIntArr()
		isBlocked = True
		for i in range(1, n):
			if abs(a[i] - a[i - 1]) > 1:
				isBlocked = False
		if isBlocked == False:
			allans.append(0)
			continue
		else:
			if len(set(a)) == 1:
				ans = min(2 * v, u + v)
			else:
				ans = min(u, v)
			allans.append(ans)
	multiLineArrayPrint(allans)
	return
import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')

def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))

def multiLineArrayPrint(arr):
	print('\n'.join([str(x) for x in arr]))

def multiLineArrayOfArraysPrint(arr):
	print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
	return [int(x) for x in input().split()]
inf = float('inf')
MOD = 10 ** 9 + 7
for _ in range(1):
	main()


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		(n, u, v) = map(int, input().split())
		a = list(map(int, input().split()))
		th = 0
		for i in range(1, n):
			if abs(a[i] - a[i - 1]) > 1:
				th = 2
				break
			elif abs(a[i] - a[i - 1]) == 1:
				th = 1
		if th == 2:
			print(0)
		elif th == 1:
			print(min(u, v))
		else:
			print(min(v + v, u + v))
main()


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = -1
	c = 0
	for i in range(n - 1):
		c += abs(a[i] - a[i + 1])
		if abs(a[i] - a[i + 1]) >= 2:
			ans = 0
			break
	if not ans == 0:
		if c:
			ans = min(u, v)
		else:
			ans = min(u + v, 2 * v)
	print(ans)


t = int(input())
for i in range(t):
	(n, u, v) = input().split()
	n = int(n)
	u = int(u)
	v = int(v)
	a = list(map(int, input().split()))
	val = a[0]
	c = 0
	for i in range(1, n):
		if a[i] != val:
			c = 1
	if c == 0:
		print(v + min(v, u))
	else:
		b = 0
		for i in range(n - 1):
			if abs(a[i + 1] - a[i]) > 1:
				b = 1
				print(0)
				break
		if b == 0:
			if u > v:
				print(v)
			else:
				print(u)


def main():
	t = int(input())
	for i in range(t):
		print(solve())

def solve():
	(n, u, v) = map(int, input().split())
	a_array = list(map(int, input().split()))
	ans = min(u + v, 2 * v)
	for i in range(1, n):
		diff = abs(a_array[i] - a_array[i - 1])
		if diff == 1:
			ans = min(u, v, ans)
		elif diff > 1:
			ans = 0
	return ans
main()


import sys
import math
MOD = 1000000007

def solve():
	(n, u, v) = list(map(int, input().split()))
	a = list(map(int, input().split()))
	ans = math.inf
	for i in range(1, n):
		if abs(a[i] - a[i - 1]) >= 2:
			ans = 0
		if abs(a[i] - a[i - 1]) == 1:
			ans = min(ans, min(u, v))
		if a[i] == a[i - 1]:
			ans = min(ans, v + min(u, v))
	print(ans)
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	obs = []
	for i in range(n):
		obs.append(a[i])
	ans = float('inf')
	for i in range(n - 1, -1, -1):
		if i == n - 1:
			if obs[i - 1] == obs[i]:
				if i - 2 < 0:
					i = i - 1
					if obs[i - 1] == obs[i]:
						s = min(ans, u + v)
					elif abs(obs[i] - obs[i - 1]) <= 1:
						s = min(ans, min(u, v))
					else:
						s = 0
						break
				else:
					s = float('inf')
				ans = min(ans, u + v, 2 * v, s)
			elif abs(obs[i] - obs[i - 1]) <= 1:
				ans = min(ans, min(u, v))
			else:
				ans = 0
				break
		elif obs[i + 1] == obs[i]:
			if i + 2 < n:
				i = i + 1
				if obs[i - 1] == obs[i]:
					s = min(ans, u + v)
				elif abs(obs[i] - obs[i - 1]) <= 1:
					s = min(ans, min(u, v))
				else:
					s = 0
					break
			else:
				s = float('inf')
			ans = min(ans, u + v, s)
		elif abs(obs[i] - obs[i + 1]) <= 1:
			ans = min(ans, min(u, v))
		else:
			ans = 0
			break
	print(ans)


t = int(input())
for tc in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	last = a[0]
	ans = min(v + v, v + u)
	for i in range(n):
		if abs(last - a[i]) > 1:
			ans = 0
			break
		elif last != a[i]:
			ans = min(u, v)
		last = a[i]
	print(ans)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def lsi():
	return list(msi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, factorial, cos, tan, sin, radians, floor, sqrt, log2
import bisect
import random
import string
from decimal import *
getcontext().prec = 50
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def gcd1(a):
	if len(a) == 1:
		return a[0]
	ans = a[0]
	for i in range(1, len(a)):
		ans = gcd(ans, a[i])
	return ans

def mykey(x):
	return (x[1], -x[0])

def main():
	for _ in range(ii()):
		(n, u, v) = mi()
		a = li()
		ans = 0
		c = -1
		for i in range(n - 1):
			c = max(c, abs(a[i] - a[i + 1]))
		if c:
			if c > 1:
				ans = 0
			else:
				ans = min(u, v)
		else:
			ans = min(u + v, 2 * v)
		print(ans)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for i in range(t):
	(n, u, v) = [int(x) for x in input().split()]
	arr = [int(x) for x in input().split()]
	difs = {abs(arr[i + 1] - arr[i]) for i in range(n - 1)}
	if difs == {0}:
		print(min(u, v) + v)
	elif difs == {1} or difs == {0, 1}:
		print(min(u, v))
	else:
		print(0)


from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from heapq import heappush, heappop
import math
import io
import os
import math
import bisect

def isPrime(x):
	for i in range(2, x):
		if i * i > x:
			break
		if x % i == 0:
			return False
	return True

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(n)
	return list(set(l))

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def digits(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def ceil(n, x):
	if n % x == 0:
		return n // x
	return n // x + 1

def mapin():
	return map(int, input().split())

def sol(l):
	for i in range(1, len(l)):
		if abs(l[i] - l[i - 1]) > 1:
			return 1
	return 0
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for _ in range(t):
	(n, u, v) = map(int, input().split())
	l = [int(x) for x in input().split()]
	d = set(l)
	if len(d) == 1:
		print(min(2 * v, v + u))
	elif sol(l) == 0:
		print(min(u, v))
	else:
		print(0)


import math, sys
from collections import defaultdict, deque
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')

def I():
	return int(sys.stdin.readline())

def In():
	return map(int, sys.stdin.readline().split())

def Sn():
	return sys.stdin.readline().strip()

def Pr(x):
	sys.stdout.write(str(x) + '\n')

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gte(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		(n, u, v) = In()
		l = list(In())
		ok = False
		for i in range(n - 1):
			if abs(l[i + 1] - l[i]) >= 2:
				ok = True
		if ok:
			print(0)
			return
		else:
			ans = v
			z = list(set(l))
			if len(z) != 1:
				if n == 2:
					if l[1] == 1 and l[0] == 2:
						ans = min(u, v)
					else:
						ans = min(u, v)
				else:
					ans = min(ans, u)
			else:
				ans = min(2 * v, u + v)
			print(ans)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


from sys import *
from math import floor, ceil, sqrt
ws = lambda : map(int, stdin.readline().strip().split())
li = lambda : list(map(int, stdin.readline().strip().split()))
mod = 1000000007

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def prod(l):
	ans = 1
	for i in range(len(l)):
		ans = ans * l[i]
	return ans

def sortindex(l, a):
	c = []
	if a == -1:
		rev = True
	else:
		rev = False
	for i in range(len(l)):
		c.append([l[i], i])
	x = sorted(c, reverse=rev)
	print(x)
	c = []
	for i in range(len(l)):
		c.append(x[i][1])
	return c
for _ in range(int(input())):
	(n, u, v) = ws()
	obs = li()
	ans = 0
	flag = 0
	flagger = 0
	for i in range(n - 1):
		t = abs(obs[i] - obs[i + 1])
		if t >= 2:
			flag = 1
			break
		if t == 1:
			flagger = 1
	if flag:
		print(ans)
	else:
		if flagger == 1:
			ans = min(u, v)
		else:
			ans = min(2 * v, u + v)
		print(ans)


from sys import stdin
t = int(stdin.readline())
for _ in range(t):
	(n, u, v) = [int(x) for x in stdin.readline().split()]
	a = [int(x) for x in stdin.readline().split()]
	if min(a) == max(a):
		res = min(v + u, v + v)
	else:
		res = min(u, v)
		for (ai, ai_plus_1) in zip(a[:-1], a[1:]):
			if abs(ai - ai_plus_1) > 1:
				res = 0
	print(res)


import os
import sys
import math
from io import BytesIO, IOBase
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def dijkstra(start, distance, path, n):
	visited = [False for _ in range(n)]
	distance[start] = 0
	for i in range(n):
		v = -1
		for j in range(n):
			if not visited[v] and (v == -1 or distance[j] < distance[v]):
				v = j
		if distance[v] == math.inf:
			break
		visited[v] = True
		for edge in adj[v]:
			destination = edge[0]
			weight = edge[1]
			if distance[v] + weight < distance[destination]:
				distance[destination] = distance[v] + weight
				path[destination] = v

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def lcm(a, b):
	return a * b // gcd(a, b)

def ncr(n, r):
	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def npr(n, r):
	return math.factorial(n) // math.factorial(n - r)

def seive(n):
	primes = [True] * (n + 1)
	ans = []
	for i in range(2, n):
		if not primes[i]:
			continue
		j = 2 * i
		while j <= n:
			primes[j] = False
			j += i
	for p in range(2, n + 1):
		if primes[p]:
			ans += [p]
	return ans

def factors(n):
	factors = []
	x = 1
	while x * x <= n:
		if n % x == 0:
			if n // x == x:
				factors.append(x)
			else:
				factors.append(x)
				factors.append(n // x)
		x += 1
	return factors

def main():
	try:
		for _ in range(inp()):
			(n, u, v) = invr()
			a = inlt()
			if len(set(a)) == 1:
				print(min(2 * v, u + v))
			else:
				for i in range(1, n):
					if abs(a[i] - a[i - 1]) > 1:
						print('0')
						break
				else:
					print(min(u, v))
	except Exception as e:
		print(e)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


list1 = []
for i in range(int(input())):
	(n, u, v) = input().split()
	p = []
	for x in input().split():
		p.append(int(x))
	t = 0
	for j in range(0, int(n) - 1):
		k = abs(p[j] - p[j + 1])
		if k > 1:
			t = 2
			break
		elif k == 1 and t < 1:
			t = 1
	if t == 2:
		list1.append(0)
	elif t == 1:
		list1.append(min(int(v), int(u)))
	else:
		list1.append(min(int(v), int(u)) + int(v))
print(*list1, sep='\n')


def ass(a, b):
	print(f'Assertion error: {a} != {b}' if a != b else 'OK')

def nr():
	return nrs()[0]

def nrs():
	return [int(item) for item in input().split()]

def f(n, u, v, a):
	ds = [abs(a[i] - a[i + 1]) for i in range(n - 1)]
	m = max(ds)
	if m >= 2:
		return 0
	return min(u, v) + [v, 0][m]
for i in range(nr()):
	(n, u, v) = nrs()
	a = nrs()
	print(f(n, u, v, a))


t = int(input())
for i in range(0, t):
	(n, u, v) = map(int, input().split())
	l = list(map(int, input().split()))
	p = []
	for i in range(1, len(l)):
		p.append(abs(l[i] - l[i - 1]))
	m = max(p)
	p = []
	if m == 0:
		print(v + min([u, v]))
	elif m == 1:
		print(min([u, v]))
	else:
		print(0)


t = int(input())
for j in range(t):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	ans = 10 ** 18
	for k in range(n - 1):
		if abs(a[k + 1] - a[k]) > 1:
			ans = 0
		elif abs(a[k + 1] - a[k]) == 0:
			ans = min(ans, v + min(u, v))
		else:
			ans = min(ans, min(u, v))
	print(ans)


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	arr = list(map(int, input().split()))
	price = 0
	if len(set(arr)) == 1:
		price += v
		price += min(u, v)
	else:
		zero = False
		pre = arr[0]
		for i in arr:
			if abs(i - pre) > 1:
				zero = True
				break
			pre = i
		if not zero:
			price += min(u, v)
	print(price)


for i in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	f = True
	f2 = True
	for j in range(1, n):
		if abs(a[j] - a[j - 1]) < 2:
			if abs(a[j] - a[j - 1]) == 1:
				f2 = False
		else:
			f = False
	if f:
		if f2:
			print(v + min(u, v))
		else:
			print(min(u, v))
	else:
		print(0)


I = lambda : [*map(int, input().split())]
for _ in range(I()[0]):
	(n, u, v) = I()
	a = I()
	c = v + min(u, v)
	for i in range(1, n):
		if abs(a[i - 1] - a[i]) > 1:
			c = 0
			break
		elif abs(a[i - 1] - a[i]) == 1:
			c = min(v, u)
	print(c)


for _ in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	cond = 0
	flag0 = 0
	flag1 = 0
	for i in range(0, n - 1):
		if abs(a[i] - a[i + 1]) > 1:
			cond = 1
			break
		elif abs(a[i] - a[i + 1]) == 0:
			flag0 = 1
		else:
			flag1 = 1
	if flag1 == 1:
		ans = min(u, v)
	else:
		ans = min(2 * v, u + v)
	if cond:
		print(0)
	else:
		print(ans)


for i in range(int(input())):
	(n, u, v) = map(int, input().split())
	a = list(map(int, input().split()))
	c = 0
	if min(a) == max(a):
		print(min(2 * v, v + u))
	else:
		c = 0
		for j in range(n - 1):
			if abs(a[j + 1] - a[j]) > 1:
				c = c + 1
				break
		if c > 0:
			print('0')
		else:
			print(min(u, v))


for _ in range(int(input())):
	(N, u, v) = [int(i) for i in input().split(' ')]
	A = [int(i) for i in input().split(' ')]
	Hai = False
	mex = 0
	for i in range(1, N):
		if abs(A[i] - A[i - 1]) >= 2:
			Hai = True
			break
		else:
			mex = max(mex, abs(A[i] - A[i - 1]))
	if Hai:
		print(0)
	elif mex == 0:
		print(min(2 * v, u + v))
	else:
		print(min(u, v))


T = int(input())
for _ in range(T):
	(n, u, v) = [int(x) for x in input().split()]
	a = [int(x) for x in input().split()]
	can_pass_through = False
	all_in_one_col = True
	last = a[0]
	for i in range(1, n):
		cur = a[i]
		if last != cur:
			all_in_one_col = False
		if abs(last - cur) > 1:
			can_pass_through = True
		last = cur
	if can_pass_through:
		print(0)
	elif all_in_one_col:
		print(min(2 * v, u + v))
	else:
		print(min(u, v))