#include <iostream>
#include <stack>
#include <set>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <map>
#include <bits/stdc++.h>
using namespace std;
#define mk(x,y) make_pair(x,y)
#define ls rt<<1
#define rs rt<<1|1
#define lowbit(x) ((x)& - (x))
#define sp <<" "
#define el <<"\n"
#define R(a,b) a+rand()%((b)-(a)+1)
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(i,a,b)  for( int i=a; i <= b; i++)
#define yes cout<<"YES" el
#define no cout<<"NO" el
#define use_fast ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define maxn 200010
#define mod 1000000007
#define db double
#define F first
#define S second
#define INF 0x3f3f3f3f3f3f3f3f
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef struct{int x,y;} node;
struct edge{
    int from,to,w;
    edge(int a,int b,int c){from=a;to=b;w=c;}
};
struct s_node{
    int id,dis;
    s_node(int a,int b){id=a;dis=b;}
    bool operator <(const s_node&a)const{
        return dis>a.dis;
    }
};
inline ll read(){
   ll s=0,w=1;
   char ch=getchar();
   while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
   return s*w;
}
inline void write(int X)
{
    if(X<0) {X=~(X-1); putchar('-');}
    if(X>9) write(X/10);
    putchar(X%10+'0');
}
ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll arr[maxn];
void solve(){
    ll n,a,b;
    cin>>n>>a>>b;
    string str;
    cin>>str;
    ll sum=n*a;
    if(b==0){cout<<sum<<endl;return;}
    else if(b>0){cout<<sum+b*n<<endl;return;}
    else{
        vector<int>v;
        v.clear();
        str+='a';
        int cnt=1;
        for(int i=1;i<str.size();i++){
            if(str[i]!=str[i-1]){v.push_back(cnt);cnt=1;}
            else cnt++;
        }
        int len=v.size();
        if(len%2==0){cout<<(len/2+1)*b+sum<<endl;}
        else {cout<<((len/2)+1)*b+sum<<endl;}
    }
}
int main(int argc, const char * argv[]){
    use_fast;
	int tt;
	cin>>tt;
	while(tt--){
		solve();
	}
	return 0;
}
