#include<bits/stdc++.h>
using namespace std;
int main()
{
    int test,n,a,b,count;
    string s;
    cin>>test;
    while(test--)
    {
        cin>>n>>a>>b;
        cin>>s;
        if(b>=0)
        cout<<n*(a+b)<<'\n';
        else
        {
            count=1;
            for(int i=1;i<n;i++)
            {
                if(s[i]!=s[i-1])count++;
            }
            cout<<(n*a+b*(count/2+1))<<'\n';
        }
       
    }
}