#include <bits/stdc++.h>

#define f first
#define s second
#define forn(i, n) for(ll i = 0; (i) < (n); (i)++)
#define all(x) x.begin(), x.end()
typedef long long ll;
using namespace std;

void solve() {
    ll n, a, b;
    cin >> n >> a >> b;
    string str;
    cin >> str;
    int cnt = 0;
    forn(i, n){
        if(i == 0 || str[i-1] != str[i])
            cnt++;
    }
    if(b >= 0)
        cout << a*n + b*n << "\n";
    else
        cout << a*n + b* (cnt/2+1) << "\n";
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int t;
    cin >> t;
    while (t--)
        solve();


    return 0;
}
