// Arup Guha
// 4/27/2025
// Solution to COP 4516 Final Team Contest Problem: Osmosis

import java.util.*;

public class osmosis {
	
	public static int n;
	public static int a;
	public static int b;
	public static long[] vals;
	public static long[][][] dp;
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		
		// Process cases.
		for (int loop=0; loop<nC; loop++) {
		
			// Get input.
			n = stdin.nextInt();
			a = stdin.nextInt();
			b = stdin.nextInt();
			
			vals = new long[n];
			for (int i=0; i<n; i++)
				vals[i] = stdin.nextLong();
			
			// Init DP array.
			dp = new long[n][n][3];
			for (int i=0; i<n; i++)
				for (int j=0; j<n; j++)
					Arrays.fill(dp[i][j], -1);
			
			// Solve it.
			System.out.println(go(0,n-1,2));
		}
	}
	
	// Returns the best solution for the game on interval [s, e] where the previous move was prev.
	// prev = 2 is beginning, prev=0 from left, prev=1 from right.
	public static long go(int s, int e, int prev) {
		
		// Base cases.
		if (s == e) return 0;
		if (dp[s][e][prev] != -1) return dp[s][e][prev];
		
		// Get best left answer.
		long res = 0;
		if (prev != 0)
			res = go(s+1, e, 0) + b*vals[s+1]*vals[e];
		else
			res = go(s+1, e, 0) + a*vals[s+1]*vals[e];
		
		// Incorporate going right.
		if (prev != 1)
			res = Math.max(res, go(s, e-1, 1) + b*vals[s]*vals[e-1]);
		else
			res = Math.max(res, go(s, e-1, 1) + a*vals[s]*vals[e-1]);
			
		// Store and return.
		return dp[s][e][prev] = res;
	}
}