#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ll t;
    cin>>t;
    while(t--)
    {
        ll n,a,b;
        cin>>n>>a>>b;
        string s;
        cin>>s;
        if(b>=0)
        {
            cout << a*n + b*n <<endl;
        }
        else{
            ll countz=0,counto=0;
            for(ll i=0;i<n;i++)
            {
                if(s[i]=='0')countz++;
                else counto++;
            }
            vector<ll> ze,on;
            for(ll i=0;i<n;i++)
            {   
                if(s[i]=='0'){
                ll len=1;
                while(i+1<n && i<n && s[i]=='0' && s[i]==s[i+1])i++,len++;
                ze.push_back(len);
                }
            }
            for(ll i=0;i<n;i++)
            {
                
                if(s[i]=='1'){
                ll len=1;
                while(i+1<n && i<n && s[i]=='1' && s[i]==s[i+1])i++,len++;
                on.push_back(len);
                }
            }
            // for(auto x: ze)cout<<x<<" ";
            // cout <<endl;
            // for(auto x: on)cout<<x<<" ";
            // cout <<endl;
            ll ans = INT_MIN;
            // iteratively
            ll cn = 0;
            for(ll i=0;i<n;i++)
            {
                ll len=1;
                while(i+1<n && i<n && s[i]==s[i+1])i++,len++;
                cn += a*len + b;
            }
            ans = max(ans,cn);
            cn=0;
            for(ll i=n-1;i>=0;i--)
            {
                ll len=1;
                while(i>=0 && i-1>=0 && s[i]==s[i-1])i--,len++;
                cn += a*len + b;
            }
            ans = max(ans,cn);
            // 1's ko ek and 0's ka sum
            cn=0;
            cn += counto*a + b;
            for(ll i=0;i<ze.size();i++)
            {
                cn += (a*ze[i] + b);
            }
            ans  = max(ans,cn);
            // 0's ko ek and 1's ka sum
            cn = 0;
            cn += countz*a + b;
            for(ll i=0;i<on.size();i++)
            {
                cn += (a*on[i] + b);
            }
            ans  = max(ans,cn);
            // every one singly
            ans = max(ans,(a+b)*n);

            cout <<ans<<endl;
        }
    }
}
