#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1e9 + 7;
const double PI = 3.14159265358979323846;

ll r(ll n) {
    ll x = sqrt(n);
    while (x * x > n) x--;
    while (x * x < n) x++;
    return x;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t = 1, n, m, k, a, b, c, d, e, f, w, h, x1, x2, y2, l, x, y, z, q;
    string s;
    //char x, y;
    cin >> t;
    while (t--) {
        ll arr[501][501] = {}, r;
        cin >> n >> x >> y;
        vector<ll> v(n + 1);
        for (ll i = 1; i <= n; i++) cin >> v[i];
        for (ll i = 2; i <= n + 1; i++) {
            for (ll l = 0; l + i - 1 <= n; l++) {
                r = l + i - 1;
                if (v[r] < v[l]) arr[l][r] = arr[l][r - 1];
                else {
                    arr[l][r] = LLONG_MAX;
                    for (int j = l + 1; j < r; j++) if (v[j] <= v[r]) arr[l][r] = min(arr[l][r], arr[l][j - 1] + arr[j][r - 1] + y);
                    arr[l][r] = min(arr[l][r], arr[l][r - 1] + x);
                }
            }
        }
        cout << arr[0][n] << '\n';
    }

    return 0;
}