#include <iostream>
#include <string>
using namespace std;
#define int long long
int32_t main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int test_case;
	cin >> test_case;
	while (test_case--) {
		int n, a, b;
		cin >> n >> a >> b;
		string str;
		cin >> str;
		if (b >= 0) {
			// 每次只刪除1個 讓b能夠增加最多次
			cout << (a + b) * n << endl;
			continue;
		}
		// b < 0 使操作次數最少 即增加 b 最少次
		int Interval = 1;
		for (int i = 0; i < n - 1; i++) {
			if (str[i] != str[i + 1])
				Interval++;
		}
		cout << (a * n) + (Interval / 2 + 1) * b << endl;
	}
}
/*
3
3 2 0
000
5 -2 5
11001
6 1 -4
100111
*/

/*
6
15
-2
*/