#include<bits/stdc++.h>
#define ll long long
#define pi acos(-1.0)
#define pb push_back
#define vi vector<int>
#define mapii map<int , int>
#define mapci map<char, int>
#define mapsi map<string,int>
#define FOR(i,n) for(int i = 0;i<n;i++)
#define CP(n) cout<<"Case "<<n<<": "
#define mod 1000000007
#define all(x)(x.begin(),x.end())
#define debug(x,c) cout<<x<<": "<<c<<" ";
#define fast_io ios_base::sync_with_stdio(false);cin.tie(0)
using namespace std;
void test_case()
{
	ll n , a ,b;
	cin>>n>>a>>b;
	string s;
	cin>>s;
	ll ans = 0;
	if(b>=0)
	{
		ans = ((n*a) + (n*b));
	}
	else if(b<0)
	{
		char x = s[0];
		ll cnt = 0,c = 0;
		for(int i = 0;i<n;i++)
		{
			if(s[i]==x)
			{
				if(c==0)
					cnt++;
				c++;
			}
			else
			{
				c = 0;
			}
		}
		if(s[n-1]!=x)
			cnt++;
		ans = (n * a) + (cnt * b);
	}
	cout<<ans<<endl;
	return;
}
int main()
{ 
	#ifndef ONLINE_JUDGE
	  freopen("/IO/input.txt","r",stdin);
	  freopen("/IO/output.txt","w",stdout);
	  cout<<"Code Started For Checking....."<<endl;
 	#endif
	int t = 1;
	cin>>t;
	while(t--)
	{
		test_case();
	}
	return 0;
}