#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    int n, a, b, t, i, num0, num1;
    cin >> t;
    while (t--)
    {
        num1 = 0;
        num0 = 0;
        cin >> n >> a >> b >> s;
        if (b >= 0)
            cout << (a + b) * n << "\n";
        else if (b < 0)
        {
            if (s[0] == s[n - 1] && s[0] == '0')
            {
                for (i = 0; i < s.length() - 1; i++)
                {
                    if (s[i] == '1' && s[i + 1] == '0')
                    {
                        num0++;
                    }
                }
                cout << a * n + (num0 + 1) * b << "\n";
            }
            if (s[0] == s[n - 1] && s[0] == '1')
            {
                for (i = 0; i < s.length() - 1; i++)
                {
                    if (s[i] == '0' && s[i + 1] == '1')
                    {
                        num1++;
                    }
                }
                cout << a * n + (num1 + 1) * b << "\n";
            }
            if (s[0] == '0' && s[n - 1] == '1')
            {
                for (i = 0; i < s.length() - 1; i++)
                {
                    if (s[i] == '0' && s[i + 1] == '1')
                    {
                        num1++;
                    }
                }
                cout << a * n + (num1 + 1) * b << "\n";
            }
            if (s[0] == '1' && s[n - 1] == '0')
            {
                for (i = 0; i < s.length() - 1; i++)
                {
                    if (s[i] == '1' && s[i + 1] == '0')
                    {
                        num1++;
                    }
                }
                cout << a * n + (num1 + 1) * b << "\n";
            }
        }
    }
    return 0;
}