#include<bits/stdc++.h>
using namespace std;
#define ll long long
int n,a,b;
string s;//字符
void init()
{

}
int del(string&s,char ch)
{
    int sum=0;
    for(int i=0;i<s.size();i++)
    {
        if(ch==s[i])
        {
            sum++;
            int j=i;
            while(j+1<s.size()&&s[j+1]==ch)j++;
            i=j;
        }
    }
    return sum+1;
}
void solve()
{
    init();
    cin>>n>>a>>b>>s;
    if(b>=0)
    {
        ll res=(ll)n*(ll)(a+b);
        cout<<res<<endl;
    }else
    {
        int k;
        if(s[0]==s.back())k=del(s,s[0]^1);
        else k=del(s,s[0]);
        //cout<<"k="<<k<<endl;
        ll res=(ll)n*a+(ll)k*b;
        cout<<res<<endl;
    }
}
int main()
{
    int t;cin>>t;
    while(t--)solve();
    return 0;
}
