#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      string s;cin>>s;
      ll sum=0,flag=1,ans=0,yes=0,oc=0,mini=LONG_MAX,maxi=0;
      ans = a*n + b*(n+1);
      i=1;
      while(i<n)
         {
           if(s[i]=='1')
           {
             yes=1;
             oc++;
             i++;
           }
           else
           {
             if(yes) ans += b*(oc+1);
             oc=0;
             while(s[i]=='0')i++;
           }
         }

        i=1;
        while(i<n-1)
         {
           if(s[i]=='0')
               sum++;
           else
           {
             if(flag==1)
             {
               flag=0;
               ans += min(sum*b+a,a);
             }
             else
               ans += max(0LL,min((sum-1)*b,2*a));

             sum=0;
           }
             i++;
         }
           if(yes==1)
             ans+=min(a,(sum+1)*b);

        cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      string s;cin>>s;
      ll sum=0,flag=1,ans=0,yes=0,oc=0,mini=LONG_MAX,maxi=0;
      ans = a*n + b*(n+1);
      i=1;
      while(i<n)
         {
           if(s[i]=='1')
           {
             yes=1;
             oc++;
             i++;
           }
           else
           {
             if(yes) ans += b*(oc+1);
             oc=0;
             while(s[i]=='0')i++;
           }
         }

        i=1;
        while(i<n-1)
         {
           if(s[i]=='0')
               sum++;
           else
           {
             if(flag==1)
             {
               flag=0;
               ans += min((sum+1)*b+a,a);
             }
             else
               ans += max(0LL,min((sum-1)*b,2*a));

             sum=0;
           }
             i++;
         }
           if(yes==1)
             ans+=a;

        cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      string s;cin>>s;
      ll sum=0,flag=1,ans=0,yes=0,oc=0,mini=LONG_MAX,maxi=0;
      ans = a*n + b*(n+1);
      i=0;
      while(i<n)
         {
           if(s[i]=='1')
           {
             yes=1;
             oc++;
             i++;
           }
           else
           {
             if(yes) ans += b*(oc+1);
             oc=0;
             while(s[i]=='0')i++;
           }
         }
        i=0;
        while(i<n)
         {
           if(s[i]=='0')
               sum++;
           else
           {
             if(flag==1)
             { yes=1;
               flag=0;
               ans += min(sum*b,a);
             }
             else
               ans += max(0LL,min((sum-1)*b,2*a));

             sum=0;
           }
             i++;
         }
           if(yes==1)
             ans+=min(a,(sum+1)*b);
        cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      string s;cin>>s;
      ll sum=0,flag=1,ans=0,yes=0,oc=0,mini=LONG_MAX,maxi=0;
      ans = a*n + b*(n+1);
      i=0;
      while(i<n-1)
         {
           if(s[i]=='1')
           {
             yes=1;
             oc++;
             i++;
           }
           else
           {
             if(yes) ans += b*(oc+1);
             oc=0;
             while(s[i]=='0')i++;
           }
         }
        i=0;
        while(i<n)
         {
           if(s[i]=='0')
               {
                 while(s[i]=='0'){i++;sum++;}
               }
           else
           { yes=1;
             if(flag==1)
             {
               flag=0;
               ans += min(sum*b,a);
             }
             else
               ans += max(0LL,min((sum-1)*b,2*a));

             sum=0;
              i++;
           }
         }
           if(yes==1)
             ans+=min(a,(sum)*b);
        cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      string s;cin>>s;
      ll sum=0,flag=1,ans=0,yes=0,oc=0,mini=LONG_MAX,maxi=0;
      ans = a*n + b*(n+1);
      i=0;
      while(i<n)
         {
           if(s[i]=='1')
           {
             yes=1;
             oc++;
             i++;
           }
           else
           {
             if(yes) ans += b*(oc+1);
             oc=0;
             while(s[i]=='0')i++;
           }
         }
        i=0;
        while(i<n)
         {
           if(s[i]=='0')
               {
                 while(s[i]=='0'){i++;sum++;}
               }
           else
           { yes=1;
             if(flag==1)
             {
               flag=0;
               ans += min(sum*b,a);
             }
             else
               ans += max(0LL,min((sum-1)*b,2*a));

             sum=0;
              i++;
           }
         }
           if(yes==1)
             ans+=min(a,(sum)*b);
        cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      string s;cin>>s;
      ll sum=0,flag=1,ans=0,yes=0,oc=0,mini=LONG_MAX,maxi=0;
      ans = a*n + b*(n+1);
      i=0;
      while(i<n)
         {
           if(s[i]=='1')
           {
             yes=1;
             oc++;
             i++;
           }
           else
           {
             if(yes) ans += b*(oc+1);
             oc=0;
             while(s[i]=='0')i++;
           }
         }
      // if(a<b)
      // {
      //  fo(i,n-1)
      //   {
      //     if(s[i]!=s[i+1])
      //        ans += a;
      //     else
      //      {
      //        if(s[i] == '1' && s[i+1] =='1')
      //         ans += 0;
      //      }
      //   }
      // }
      // else
      { i=0;
        while(i<n-1)
         {
           if(s[i]=='0')
               sum++;
           else
           {
             if(flag==1)
             {
               flag=0;
               ans += min(sum*b,a);
             }
             else
               ans += max(0LL,min((sum-1)*b,2*a));

             sum=0;
           }
             i++;
         }
           if(yes==1)
             ans+=min(a,(sum+1)*b);
         }
        cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      string s;cin>>s;
      ll sum=0,flag=1,ans=0,yes=0,oc=0,mini=LONG_MAX,maxi=0;
      ans = a*n + b*(n+1);
      i=1;
      while(i<n)
         {
           if(s[i]=='1')
           {
             yes=1;
             oc++;
             i++;
           }
           else
           {
             if(yes) ans += b*(oc+1);
             oc=0;
             while(s[i]=='0')i++;
           }
         }
        i=0;
        while(i<n)
         {
           if(s[i]=='0')
               sum++;
           else
           {
             if(flag==1)
             { yes=1;
               flag=0;
               ans += min(sum*b,a);
             }
             else
               ans += max(0LL,min((sum-1)*b,2*a));

             sum=0;
           }
             i++;
         }
           if(yes==1)
             ans+=min(a,(sum+1)*b);
        cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      ll dp[n+2][2] ;
      string s;cin>>s;
      ll ans = a*n + b*(n+1);

        dp[0][0] = 0;
        dp[0][1] = INF;// bcoz we dont want it to choose h=2 for first position ( given in qn.)
      fo(i,n)     // so if dp[0][1] = INF , at i=1(1st pos) ,dp[1][1] wont be optimal
      {          // we want dp[1][0] to always be optimal and that will happen now since dp[0][1] = INF
        if (s[i] == '1')
        {
          dp[i+1][0] = INF;
          dp[i+1][1] = dp[i][1] + b;
        }
        else
        {
          dp[i+1][0] = min(dp[i][0], dp[i][1] + a);
          dp[i+1][1] = min(dp[i][1], dp[i][0] + a) + b;
        }
      }
      ans+=dp[n][0]; // pipe has to end at h=1 at the end
      cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include <bits/stdc++.h>
using namespace std;                                                                                // MACROS
typedef long long int                    ll;
typedef unsigned long long int           ull;
typedef vector<int>                      vi;
typedef vector<ll>                       vll;
typedef pair<int,int>	                   pi;
typedef pair<ll,ll>	                     pll;
typedef map<int,int>                     mi;
typedef map<ll,ll>                       mll;
typedef set<int>                         si;
typedef set<ll>                          sll;
typedef multiset<int>                    msi;
typedef multiset<ll>                     msll;
typedef priority_queue<int ,vector<int>, greater<int>> minHeapInt ;
typedef priority_queue<pi  ,vector<pi> , greater<pi>>  minHeapPair ;
#define MEM(a, b)                        memset(a, (b), sizeof(a))
#define INF                              1e18L+1
#define pb                               push_back
#define mp                               make_pair
#define ff                               first
#define ss                               second
#define all(v)                           v.begin(),v.end()
#define f(i,a,b,c)                       for( i=a; i<b;i+=c)
#define rf(i,a,b,c)                      for( i=b-1;i>=a;i-=c)
#define fo(i,n)                          for( i=0; i < n ; i++)
#define debug1(x)                        cout<<#x<<"="<<x<<endl;
#define rfo(i,n)                         for( i=n-1; i >=0 ; i-- )
#define modsum(a,b)                      (a+b>=MODA)?(a+b-MODA):(a+b) ;
#define moddiff(a,b)                     (a-b < 0 ) ? (a-b+MODA) : (a-b);
#define alldec(v)                        v.begin(),v.end(),greater<int>()
#define PI                               3.141592653589793238462643383279500
#define debug2(x,y)                      cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<endl;
#define printarrayline(arr,n)            for(int i=0;i<n;i++) {cout<<arr[i]<<"\n";}
#define fobe(it,v)                       for(auto it = (v).begin(); it!=(v).end(); ++it )
#define printarrayspace(arr,n)           for(int i=0;i<n;i++) {cout<<arr[i]<<" ";} cout<<"\n";
#define debug3(x,y,z)                    cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<endl;
#define debugarray(arr,n)                for(int i=0;i<n;i++) {cout<<"i="<<i<<" arr[i]="<<arr[i]<<"\n";}
#define debug4(x,y,z,w)                  cout<<#x<<"="<<x<<" "<<#y<<"="<<y<<" "<<#z<<"="<<z<<" "<<#w <<"="<<w<<endl;
#define debugmatrix( arr,n,m )           cout<<setw(5*m+8)<<"MATRIX\n\n"; for(int i=0;i<n;i++) { for(int j=0;j<m;j++){cout<<setw(10)<<arr[i][j];} cout<<"\n"; }
const  ll MODA =                         1000000007;
// const  int MODA =                     998244353 ;
vector<ll> primefactors    ;            // used by generatePrimeFactors()                                                                                // ARRAYS/VECTORS
vector<ll> factors         ;            // used by generateFactors()
ll   fact[1025]={}         ;            // used by generateFactorial() & ncr()
bool isPowerTwo(ll x)                   { return (x && !(x & (x - 1))); }                                                                                // FUNCTIONS
bool isSubstring(string s1, string s2)  { if (s1.find(s2) != string::npos) return true; else return false; }
void generateFactorial(ll n)            { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) ; }
void generateFactorialMOD(ll n)         { fact[0] = 1; for(ll i = 1; i <= n; i++)	fact[i] = (i* 1ll * fact[i - 1]) % MODA; }
bool isPrime(ll n)                      { if(n<2) return false; for(ll i=2;i*i<=n;i++) if(n%i==0) return false; return true; } //O(sqrt(n))
ll   power(ll a, ll b)                  {	ll res=1; while(b) {	if(b&1) res=(res*a); a=(a*a); 	b>>=1;	}	return res; }
ll   powerMOD(ll a, ll b)               {	ll res=1; while(b) {	if(b&1) res=(res*a)%MODA; a=(a*a)%MODA; 	b>>=1;	}	return res; }
ll   modi (ll a)                        { ll m=MODA,s=1,p=0;  while(a>1)  {  ll q=a/m,t=m;  m=a%m; a=t; t=p; p=s-q*p; s=t;  } return s>=0 ? s :s+MODA; }
void generatePrimeFactors(ll n)         { primefactors.clear(); for(ll i=2;i*i<=n;i++) { if(n%i==0) { primefactors.pb(i); while(n%i==0)  n=n/i; } } if(n!=1)   primefactors.pb(n); }
ll   ncr(ll n, ll r)                    { if(r==0)return 1;  fact[0]=1; for(int i=1 ; i<=n; i++) fact[i] = fact[i-1]*i%MODA;   return (fact[n]* modi(fact[r]) % MODA *  modi(fact[n-r]) % MODA) % MODA; }
void generateFactors(ll n)              { factors.clear(); for(ll i=2;i*i<=n;i++){ if(n%i==0) { factors.pb(i); if(n/i!=i)factors.pb(n/i); }} factors.pb(1); factors.pb(n); sort(factors.begin(),factors.end()); }
ll   modmul(ll a,ll b)                  { return((a%MODA)*(b%MODA))%MODA;     }
ll   modadd(ll a,ll b)                  { return((a%MODA)+(b%MODA)+MODA)%MODA;}
ll   modsub(ll a,ll b)                  { return((a%MODA)-(b%MODA)+MODA)%MODA;}
//****************************************************************************************************************************

int main()
{ ios_base::sync_with_stdio(false); cin.tie(0);
     ll tc=1;
     cin>>tc;
     while(tc--)
     {
      ll i,j,n,m,a,b; cin>>n>>a>>b;
      string s;cin>>s;
      ll sum=0,flag=1,ans=0,yes=0,oc=0,mini=LONG_MAX,maxi=0;
      ans = a*n + b*(n+1);
      i=0;
      while(i<n)
         {
           if(s[i]=='1')
           {
             yes=1;
             oc++;
             i++;
           }
           else
           {
             if(yes) ans += b*(oc+1);
             oc=0;
             while(s[i]=='0')i++;
           }
         }
      if(a<b)
      {
       fo(i,n-1)
        {
          if(s[i]!=s[i+1])
             ans += a;
          else
           {
             if(s[i] == '1' && s[i+1] =='1')
              ans += 0;
           }
        }
      }
      else
      { i=0;
        while(i<n-1)
         {
           if(s[i]=='0')
               sum++;
           else
           {
             if(flag==1)
             {
               flag=0;
               ans += min(sum*b,a);
             }
             else
               ans += max(0LL,min((sum-1)*b,2*a));

             sum=0;
           }
             i++;
         }
           if(yes==1)
             ans+=min(a,(sum+1)*b);
         }
        cout<<ans<<"\n";
     }
return 0;
}

//****************************************************************************************************************************
// sort(all(a))      ;
// debugarray(a,n)   ;
// printarrays(a,n)  ;
// printarrayn(a,n)  ;


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define setbits(x) __builtin_popcount(x)
#define zrobits(x) __builtin_ctz(x)
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define M 1000000007
#define endl "\n"

const int N=110;

ll power_mod(ll x, ll y)
{
    x%=M;
    ll res=1;

    while(y){
        if(y&1){
            res = (res*x)%M;
        }
        y/=2;
        x=(x*x)%M;
    }
    return res;
}
void solve()
{
    ll n,a,b;
    string s;
    cin >> n >> a >> b >> s;

    int c=0;
    vector<int>v;

    for(int i=0; i<n; i++){
        if(s[i]=='1' && c^1){
            c=1;
            if((int)v.size() && v[(int)v.size()-1] == i){
                v.erase(--v.end());
                continue;
            }
            v.pb(i);
        }
        else if(s[i]=='1' && c^0){
            c=0;
            if((int)v.size() && v[(int)v.size()-1] == i+2){
                v.erase(--v.end());
                continue;
            }
            v.pb(i+2);
        }
    }
    if((int)v.size()%2){
        for(int i=n-1; i>=0; i--){
            if(s[i]=='1'){
                v.pb(i+2);
            }
        }
    }

    ll ans = n*a + (n+1)*b + (ll)v.size()*a;
    ll h=0;

    for(int i=0; i<(int)v.size(); i++){
        cout << v[i] << " ";
    }
    cout << endl;
    for(int i=0; i<(int)v.size()-1; i+=2){
        h += (v[i+1] - v[i]) * b;
    }
    ans += h;
    //cout << ans << endl;

    for(int i=1; i<(int)v.size()-1; i+=2){
        int len = v[i+1]-v[i];

        if(-2ll*a + len*b < 0){
            //cout << ans << " ";
            ans += (-2ll*a + len * b);
        }
    }
    cout << ans << endl;
}

int main()
{
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tc=1;
    cin >> tc;
    while(tc--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define setbits(x) __builtin_popcount(x)
#define zrobits(x) __builtin_ctz(x)
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define M 1000000007
#define endl "\n"

const int N=200010;
int cnt[N];

ll power_mod(ll x, ll y)
{
    x%=M;
    ll res=1;

    while(y){
        if(y&1){
            res = (res*x)%M;
        }
        y/=2;
        x=(x*x)%M;
    }
    return res;
}
void solve()
{
    ll n,a,b;
    string s;
    cin >> n >> a >> b >> s;

    int c=0;
    vector<ll>v;
    vector<pair<ll,ll>>p;

    for(int i=0; i<n; i++){
        if(s[i]=='1'){
            p.pb({i,i+2});
        }
        cnt[i]=0;
    }
    int sz = p.size(),i=0;

    for( ; i<sz; ){
        cnt[i] = 1;
        int j=i+1;

        for(; j<sz; j++){
            if(p[j].F > p[i].S){
                break;
            }
            else{
                p[i].S = p[j].S;
            }
        }
        i = j;
    }
    for(int i=0; i<sz; i++){
        if(cnt[i]){
            v.pb(p[i].F);
            v.pb(p[i].S);
        }
    }

    ll ans = n*a + (n+1)*b + (ll)v.size()*a;
    ll h=0;

    /*for(int i=0; i<(int)v.size(); i++){
        cout << v[i] << " ";
    }
    cout << endl;*/

    for(int i=0; i<(int)v.size()-1; i+=2){
        h += (v[i+1] - v[i]) * b;
    }
    ans += h;
    //cout << ans << endl;

    for(int i=1; i<(int)v.size()-1; i+=2){
        int len = v[i+1]-v[i];

        if(-2ll*a + len*b < 0){
            //cout << ans << " ";
            ans += (-2ll*a + len * b);
        }
    }
    cout << ans << endl;
}

int main()
{
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tc=1;
    cin >> tc;
    while(tc--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define setbits(x) __builtin_popcount(x)
#define zrobits(x) __builtin_ctz(x)
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define M 1000000007
#define endl "\n"

const int N=110;
vector<pair<ll,ll>>v;

ll power_mod(ll x, ll y)
{
    x%=M;
    ll res=1;

    while(y){
        if(y&1){
            res = (res*x)%M;
        }
        y/=2;
        x=(x*x)%M;
    }
    return res;
}
void solve()
{
    ll n,a,b;
    string s;
    cin >> n >> a >> b >> s;

    int c=0;
    vector<int>v;

    for(int i=0; i<n; i++){
        if(s[i]=='1' && c^1){
            c=1;
            if((int)v.size() && v[(int)v.size()-1] == i){
                v.erase(--v.end());
                continue;
            }
            v.pb(i);
        }
        else if(s[i]=='1' && c^0){
            c=0;
            if((int)v.size() && v[(int)v.size()-1] == i+2){
                v.erase(--v.end());
                continue;
            }
            v.pb(i+2);
        }
    }
    if((int)v.size()){
        if(v[v.size()-1] != n){
            v.pb(n);
        }
    }

    ll ans = n*a + (n+1)*b + (ll)v.size()*a;
    ll h=0;

    /*for(int i=0; i<(int)v.size(); i++){
        cout << v[i] << " ";
    }
    cout << endl;*/
    for(int i=0; i<(int)v.size()-1; i+=2){
        h += (v[i+1] - v[i]) * b;
    }
    ans += h;
    //cout << ans << endl;

    for(int i=1; i<(int)v.size()-1; i+=2){
        int len = v[i+1]-v[i];

        if(-2ll*a + len * b < 0){
            //cout << ans << " ";
            ans += (-2ll*a + len * b);
        }
    }
    cout << ans << endl;
}

int main()
{
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tc=1;
    cin >> tc;
    while(tc--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define setbits(x) __builtin_popcount(x)
#define zrobits(x) __builtin_ctz(x)
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define M 1000000007
#define endl "\n"

const int N=110;

ll power_mod(ll x, ll y)
{
    x%=M;
    ll res=1;

    while(y){
        if(y&1){
            res = (res*x)%M;
        }
        y/=2;
        x=(x*x)%M;
    }
    return res;
}
void solve()
{
    ll n,a,b;
    string s;
    cin >> n >> a >> b >> s;

    int c=0;
    vector<int>v;

    for(int i=0; i<n; i++){
        if(s[i]=='1' && c^1){
            c=1;
            if((int)v.size() && v[(int)v.size()-1] == i){
                v.erase(--v.end());
                continue;
            }
            v.pb(i);
        }
        else if(s[i]=='1' && c^0){
            c=0;
            if((int)v.size() && v[(int)v.size()-1] == i+2){
                v.erase(--v.end());
                continue;
            }
            v.pb(i+2);
        }
    }
    if((int)v.size()%2){
        v.pb(n);
    }

    ll ans = n*a + (n+1)*b + (ll)v.size()*a;
    ll h=0;

    /*for(int i=0; i<(int)v.size(); i++){
        cout << v[i] << " ";
    }
    cout << endl;*/
    for(int i=0; i<(int)v.size()-1; i+=2){
        h += (v[i+1] - v[i]) * b;
    }
    ans += h;
    //cout << ans << endl;

    for(int i=1; i<(int)v.size()-1; i+=2){
        int len = v[i+1]-v[i];

        if(-2ll*a + len*b < 0){
            //cout << ans << " ";
            ans += (-2ll*a + len * b);
        }
    }
    cout << ans << endl;
}

int main()
{
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tc=1;
    cin >> tc;
    while(tc--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define setbits(x) __builtin_popcount(x)
#define zrobits(x) __builtin_ctz(x)
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define M 1000000007
#define endl "\n"

const int N=110;

ll power_mod(ll x, ll y)
{
    x%=M;
    ll res=1;

    while(y){
        if(y&1){
            res = (res*x)%M;
        }
        y/=2;
        x=(x*x)%M;
    }
    return res;
}
void solve()
{
    ll n,a,b;
    string s;
    cin >> n >> a >> b >> s;

    int c=0;
    vector<int>v;

    for(int i=0; i<n; i++){
        if(s[i]=='1' && c^1){
            c=1;
            if((int)v.size() && v[(int)v.size()-1] == i){
                v.erase(--v.end());
                continue;
            }
            v.pb(i);
        }
        else if(s[i]=='1' && c^0){
            c=0;
            if((int)v.size() && v[(int)v.size()-1] == i+2){
                v.erase(--v.end());
                continue;
            }
            v.pb(i+2);
        }
    }
    if((int)v.size()%2){
        for(int i=n-1; i>=0; i--){
            if(s[i]=='1'){
                v.pb(i+2);
            }
        }
    }

    ll ans = n*a + (n+1)*b + (ll)v.size()*a;
    ll h=0;

    /*
    for(int i=0; i<(int)v.size(); i++){
        cout << v[i] << " ";
    }
    cout << endl;*/
    for(int i=0; i<(int)v.size()-1; i+=2){
        h += (v[i+1] - v[i]) * b;
    }
    ans += h;
    //cout << ans << endl;

    for(int i=1; i<(int)v.size()-1; i+=2){
        int len = v[i+1]-v[i];

        if(-2ll*a + len*b < 0){
            //cout << ans << " ";
            ans += (-2ll*a + len * b);
        }
    }
    cout << ans << endl;
}

int main()
{
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tc=1;
    cin >> tc;
    while(tc--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define setbits(x) __builtin_popcount(x)
#define zrobits(x) __builtin_ctz(x)
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define M 1000000007
#define endl "\n"

const int N=100010;
int cnt[N];

ll power_mod(ll x, ll y)
{
    x%=M;
    ll res=1;

    while(y){
        if(y&1){
            res = (res*x)%M;
        }
        y/=2;
        x=(x*x)%M;
    }
    return res;
}
void solve()
{
    ll n,a,b;
    string s;
    cin >> n >> a >> b >> s;

    int c=0;
    vector<ll>v;
    vector<pair<ll,ll>>p;

    for(int i=0; i<n; i++){
        if(s[i]=='1'){
            p.pb({i,i+2});
        }
        cnt[i]=0;
    }
    int sz = p.size(),i=0;

    for( ; i<sz; ){
        cnt[i] = 1;
        int j=i+1;

        for(; j<sz; j++){
            if(p[j].F > p[i].S){
                break;
            }
            else{
                p[i].S = p[j].S;
            }
        }
        i = j;
    }
    for(int i=0; i<sz; i++){
        if(cnt[i]){
            v.pb(p[i].F);
            v.pb(p[i].S);
        }
    }

    ll ans = n*a + (n+1)*b + (ll)v.size()*a;
    ll h=0;

    for(int i=0; i<(int)v.size(); i++){
        cout << v[i] << " ";
    }
    cout << endl;

    for(int i=0; i<(int)v.size()-1; i+=2){
        h += (v[i+1] - v[i]) * b;
    }
    ans += h;
    //cout << ans << endl;

    for(int i=1; i<(int)v.size()-1; i+=2){
        int len = v[i+1]-v[i];

        if(-2ll*a + len*b < 0){
            //cout << ans << " ";
            ans += (-2ll*a + len * b);
        }
    }
    cout << ans << endl;
}

int main()
{
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tc=1;
    cin >> tc;
    while(tc--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define setbits(x) __builtin_popcount(x)
#define zrobits(x) __builtin_ctz(x)
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define M 1000000007
#define endl "\n"

const int N=100010;
int cnt[N];

ll power_mod(ll x, ll y)
{
    x%=M;
    ll res=1;

    while(y){
        if(y&1){
            res = (res*x)%M;
        }
        y/=2;
        x=(x*x)%M;
    }
    return res;
}
void solve()
{
    ll n,a,b;
    string s;
    cin >> n >> a >> b >> s;

    int c=0;
    vector<ll>v;
    vector<pair<ll,ll>>p;

    for(int i=0; i<n; i++){
        if(s[i]=='1'){
            p.pb({i,i+2});
        }
        cnt[i]=0;
    }
    int sz = p.size(),i=0;

    for( ; i<sz; ){
        cnt[i] = 1;
        int j=i+1;

        for(; j<sz; j++){
            if(p[j].F > p[i].S){
                break;
            }
            else{
                p[i].S = p[j].S;
            }
        }
        i = j;
    }
    for(int i=0; i<sz; i++){
        if(cnt[i]){
            v.pb(p[i].F);
            v.pb(p[i].S);
        }
    }

    ll ans = n*a + (n+1)*b + (ll)v.size()*a;
    ll h=0;

    /*for(int i=0; i<(int)v.size(); i++){
        cout << v[i] << " ";
    }
    cout << endl;*/

    for(int i=0; i<(int)v.size()-1; i+=2){
        h += (v[i+1] - v[i]) * b;
    }
    ans += h;
    //cout << ans << endl;

    for(int i=1; i<(int)v.size()-1; i+=2){
        int len = v[i+1]-v[i];

        if(-2ll*a + len*b < 0){
            //cout << ans << " ";
            ans += (-2ll*a + len * b);
        }
    }
    cout << ans << endl;
}

int main()
{
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tc=1;
    cin >> tc;
    while(tc--){
        solve();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define F first
#define S second
#define pb push_back
#define setbits(x) __builtin_popcount(x)
#define zrobits(x) __builtin_ctz(x)
#define all(x) x.begin(),x.end()
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define M 1000000007
#define endl "\n"

const int N=110;

ll power_mod(ll x, ll y)
{
    x%=M;
    ll res=1;

    while(y){
        if(y&1){
            res = (res*x)%M;
        }
        y/=2;
        x=(x*x)%M;
    }
    return res;
}
void solve()
{
    ll n,a,b;
    string s;
    cin >> n >> a >> b >> s;

    int c=0;
    vector<int>v;

    for(int i=0; i<n; i++){
        if(s[i]=='1' && c^1){
            c=1;
            if((int)v.size() && v[(int)v.size()-1] == i){
                v.erase(--v.end());
                continue;
            }
            v.pb(i);
        }
        else if(s[i]=='1' && c^0){
            c=0;
            if((int)v.size() && v[(int)v.size()-1] == i+2){
                v.erase(--v.end());
                continue;
            }
            v.pb(i+2);
        }
    }
    if((int)v.size()%2){
        for(int i=n-1; i>=0; i--){
            if(s[i]=='1'){
                v.pb(i+2);
                break;
            }
        }
    }

    ll ans = n*a + (n+1)*b + (ll)v.size()*a;
    ll h=0;

    /*
    for(int i=0; i<(int)v.size(); i++){
        cout << v[i] << " ";
    }
    cout << endl;*/
    for(int i=0; i<(int)v.size()-1; i+=2){
        h += (v[i+1] - v[i]) * b;
    }
    ans += h;
    //cout << ans << endl;

    for(int i=1; i<(int)v.size()-1; i+=2){
        int len = v[i+1]-v[i];

        if(-2ll*a + len*b < 0){
            //cout << ans << " ";
            ans += (-2ll*a + len * b);
        }
    }
    cout << ans << endl;
}

int main()
{
    FAST;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int tc=1;
    cin >> tc;
    while(tc--){
        solve();
    }
    return 0;
}


n = int(input())

stripe = list(map(int, input().split()))

count = 0

left = 0
right = sum(stripe)

for s in stripe[:-1]:
    left += s
    right -= s

    if left == right:
        count += 1

print(count)


n = int(input())

stripe = list(map(int, input().split()))

count = 0

for i in range(1, n):
    if sum(stripe[:i]) == sum(stripe[i:]):
        count += 1

print(count)


n = int(input())
num = list(map(int, input().split()))
o = 0

a = 0
b = sum(num)

for i in range(n - 1):
    a += num[i]
    b -= num[i]

    if a == b:
        o += 1

print(o)


n = int(input())
num = list(map(int, input().split()))
o = 0

for i in range(1, n):
    if sum(num[:i]) == sum(num[i:]):
        o += 1

print(o)


n = int(input())
num = list(map(int, input().split()))
o = 0

for i in range(1, n - 1):
    if sum(num[:i]) == sum(num[i:]):
        o += 1

print(o)


num_squares=int(input())
squares=input()
squares=squares.split()
squares=map(int,squares)
left_sum=0
right_sum=sum(squares)
count=0
if right_sum==0:
    count+=1
for i in range(num_squares):
    left_sum+=squares[i]
    right_sum-=squares[i]
    if left_sum==right_sum:
        count+=1
print(count)


num_squares=int(input())
squares=input()
squares=squares.split()
squares=map(int,squares)
left_sum=0
right_sum=sum(squares)
count=0
if left_sum==right_sum:
    count+=1
for i in range(num_squares):
    left_sum+=i
    right_sum-=i
    if left_sum==right_sum:
        count+=1
print(count)


num_squares=int(input())
squares=input()
squares=squares.split()
squares=map(int,squares)
squares=list(squares)
count=0
left_sum=0
right_sum=sum(squares)

for i in range(num_squares-1):
  left_sum+=squares[i]
  #if squares[i]>=0:
  right_sum-=squares[i]
  #else:
    #right_sum+=squares[i]
  if left_sum==right_sum:
    count+=1
print(count)


num_squares=int(input())
squares=input()
squares=squares.split()
squares=map(int,squares)
squares=list(squares)
left_sum=0
right_sum=sum(squares)
count=0
if right_sum==0:
    count+=1
for i in range(num_squares):
    left_sum+=squares[i]
    right_sum-=squares[i]
    if left_sum==right_sum:
        count+=1
print(count)


import math

pre = []
suff = []

n = int(input())
arr = [int(x) for x in input().split()]

s = 0
for i in range(0,n):
	s = s + arr[i]

d = 0
ans = 0
for i in range(0,n):
	d = d + arr[i]
	if d==(s-d) and i!=n-1:
		ans = ans + 1

print (ans)


n = int(input())
line = input()

line = list(map(int, line.split()))

m = 0
suml = 0
sumr = sum(line)
for el in list[:-1]:
    suml += el
    sumr -= el
    if suml == sumr:
        m += 1
print(m)


n = int(input())
#line_raw = '9 1 5 -6 7 9 -16 0 -2 2'
line = input()

line = list(map(int, line.split()))

m = 0
for i in range(1, n):
    if sum(line[:i]) == sum(line[i:]):
        m += 1
print(m)


n = int(input())
line = input()

line = list(map(int, line.split()))

m = 0
suml = 0
sumr = sum(line)
for i in range(n - 1):
    el = line[i]
    suml += el
    sumr -= el
    if suml == sumr:
        m += 1
print(m)


n = int(input())
line = input()

line = list(map(int, line.split()))

m = 0
suml = 0
sumr = sum(line)
for el in list:
    suml += el
    sumr -= el
    if suml == sumr:
        m += 1
print(m)


n = int(input())
#n = 9
#line = '1 5 -6 7 9 -16 0 -2 2'
line = input()

line = list(map(int, line.split()))

m = 0
suml = 0
sumr = sum(line)
for i in range(n - 1):
    el = line[i]
    suml += el
    sumr -= el
    print(el, suml, sumr)
    if suml == sumr:
        m += 1
print(m)


n = int(input())
line = input()

line = list(map(int, line.split()))

m = 0
for i in range(1, n):
    suml = sum(line[:i])
    sumr = sum(line[i:])
    if abs(suml - sumr) > 10000:
        continue
    if suml == sumr:
        m += 1
print(m)


n = int(input())
#n = 9
#line = '1 5 -6 7 9 -16 0 -2 2'
line = input()

line = list(map(int, line.split()))

m = 0
suml = 0
sumr = sum(line)
for i in range(n - 1):
    el = line[i]
    suml += el
    sumr -= el
    if suml == sumr:
        m += 1
print(m)


n = int(input())
a = list(map(int,input().split()))
c = [a[0]]
for i in range(1,len(a)):
    c.append(c[-1]+a[i])
l = 0
for i in range(len(c)-1):
    if(c[i]==c[-1]-c[i]):
        l+=1
print(l)


from itertools import accumulate, islice
n = int(input())
a = list(map(int, input().split()))
S = sum(a)
print(sum(S == 2*x for x in islice(accumulate(a), n-1)))


n=int(input())
l1=list(map(int,input().split()))
s=sum(l1)
if s%2!=0:
    print(0)
else:
    ans=0
    s1=s//2
    s2=0
    for i in range(n-1):
        s2+=l1[i]
        if s1==s2:
            ans+=1
    print(ans)


n = int(input())
t = list(map(int, input().split()))
s = sum(t)
if s & 1: print(0)
else:
    k = s // 2
    t = [i - k for i in t]
    for i in range(n - 1):
        t[i + 1] += t[i]
    print(t.count(0))


n = int(input())
t = list(map(int, input().split()))
s = sum(t)
if s & 1: print(0)
else:
    k = s // 2
    t = [i - k for i in t]
    for i in range(n - 1):
        t[i + 1] += t[i]
    print(t[: -1].count(0))


n = int(input())
t = list(map(int, input().split()))
s = sum(t)
if s & 1: print(0)
else:
    k = s // 2
    for i in range(n - 1):
        t[i + 1] += t[i]
    print(t[: -1].count(k))


n = int(input())
t = list(map(int, input().split()))
s = sum(t)
if s & 1: print(0)
else:
    k = s // 2
    for i in range(n - 1):
        t[i + 1] += t[i]
    print(t.count(k))


n = int(input())
squares = [ int(x) for x in input().split() ]

result = 0
soma = sum(squares)

if soma % 2 == 0:
    parcial = 0
    soma //= 2
    for i in squares:
        parcial += i
        if parcial == soma:
            result += 1
    if parcial == soma:
        result -= 1

print(result)


n = int(input())
squares = [ int(x) for x in input().split() ]

result = 0
soma = sum(squares)
if soma % 2 == 0:
    parcial = 0
    for i in squares:
        parcial += i
        if parcial == soma:
            result += 1
            parcial = 0
    if parcial == soma:
        result -= 1

print(result)


n = int(input())
squares = [ int(x) for x in input().split() ]

result = 0
soma = sum(squares)
if soma % 2 == 0:
    parcial = 0
    for i in squares:
        parcial += i
        if parcial == soma and i != 0:
            result += 1
            parcial = 0

print(result)


n = int(input())
entrada = input().split()
lista = []
total = 0

for i in entrada:
    num = int(i)
    lista.append(num)
    total += num

possibilidades = 0
temp = 0

for i in range(n-1):
    temp += lista[i]
    total -= lista[i]

    if temp == total:
        possibilidades += 1

print(possibilidades)


n, a = int(input()), list(map(int, input().split()))

for i in range(1, n):

    a[i] += a[i - 1]

print(sum(2 * a[i] == a[n - 1] for i in range(n - 1)))

# Made By Mostafa_Khaled


n = int(input())
line = input()

line = list(map(int, line.split()))

m = 0
suml = 0
sumr = sum(line)
for i in range(n - 1):
    el = line[i]
    suml += el
    sumr -= el
    if suml == sumr:
        m += 1
print(m)


n = int(input())
s = list(map(int, input().split()))
r = sum(s)
res = 0
tmp = s[0]
for i in range(1,n):
    if tmp*2 == r: res += 1
    tmp += s[i]
print(res)


n, stripes = int(input()), list(map(int, input().strip().split()))
cumsum = 0

for i in range(n):
    cumsum += stripes[i]
    stripes[i] = cumsum

res = 0
for j in range(n-1):
    res += (stripes[j] == (cumsum - stripes[j]))

print(res)


n = int(input())
arr = list(map(int, input().split()))

prefix = [arr[0]]
for i in range(1, n):
    prefix.append(prefix[i - 1] + arr[i])

ans = 0
for i in range(n - 1):
    if prefix[i] == prefix[n - 1] - prefix[i]:
        ans += 1

print(ans)


n = int(input())
arr = list(map(int, input().split()))

prefix = [0] * n
prefix[0] = arr[0]
for i in range(1, n):
    prefix[i] = arr[i] + prefix[i - 1]

print(max(len([x for x in prefix if x == 0]) - 1, 0))


n = int(input())
arr = list(map(int, input().split()))

prefix_arr = [arr[0]]
for i in range(1, n):
    prefix_arr.append(arr[i] + prefix_arr[i - 1])

out = 0
for i in range(n - 1):
    if prefix_arr[i] == (prefix_arr[n - 1] - prefix_arr[i]):
        out += 1

print(out)


n = int(input())
arr = list(map(int, input().split()))

inc = [0] * n
inc[0] = arr[0]
for i in range(1, n):
    inc[i] = arr[i] + inc[i - 1]

dec = [0] * n
dec[n - 1] = arr[n - 1]
for i in range(n - 2, -1, -1):
    dec[i] = arr[i] + dec[i + 1]

ans = 0
for i in range(n - 1):
    if inc[i] == dec[i + 1]:
        ans += 1

print(ans)


# -*- coding: utf-8 -*-
"""
Created on Thu Sep 26 07:39:29 2019

@author: avina
"""

n = int(input())
l = list(map(int, input().split()))

pre_fix  = [l[0]]
for i in range(1,n):
    pre_fix.append(pre_fix[i-1] + l[i])

ans = 0
for i in range(n-1):
    if pre_fix[i] == pre_fix[n-1] - pre_fix[i]:
        ans+=1
print(ans)


##
n = int(input())
squares = [int(x) for x in input().split(" ")]

ladoA = 0
ladoB = sum(squares)
c = 0

for i in range(n-1):
    ladoA += squares[i]
    ladoB -= squares[i]
    if ladoA == ladoB:
        c +=1
print(c)


n = int(input())
squares = [int(x) for x in input().split(" ")]

ladoA = 0
ladoB = sum(squares)
c = 0

for i in range(n-1):
    ladoA += squares[i]
    ladoB -= squares[i]
    if ladoA == ladoB:
        c +=1
print(c)


n = int(input())
squares = [int(x) for x in input().split(" ")]
def soma(lista):
    w = 0
    for v in lista:
        w += v
    return (w)

def partition(sideA,sideB):
    t = 0
    p=0
    if len(sideB) > 0:
        if soma(sideA) == soma(sideB):
            p = 1
    for i in sideB:
        ix = sideB.index(i)
        sideA.append(sideB[ix])
        sideB.remove(i)
        t += partition(sideA,sideB)

    return (p + t)

tt = 0
for element in squares:
    x = element
    sa = [element]
    sb = squares
    sb.remove(x)
    tt += partition(sa,sb)
    sb.append(x)
print(tt)


import sys

sys.setrecursionlimit(100009)

n = int(input())
squares = [int(x) for x in input().split(" ")]
def soma(lista):
    w = 0
    for v in lista:
        w += v
    return (w)

def partition(sideA,sideB):
    t = 0
    p=0
    if len(sideB) > 0:
        if soma(sideA) == soma(sideB):
            p = 1
    for i in sideB:
        ix = sideB.index(i)
        sideA.append(sideB[ix])
        sideB.remove(i)
        t += partition(sideA,sideB)

    return (p + t)

tt = 0
for element in squares:
    x = element
    sa = [element]
    sb = squares
    sb.remove(x)
    tt += partition(sa,sb)
    sb.append(x)
print(tt)


n = int(input())
numbers = list(map(int, input().split()))

count = 0

for i in range(1, n, 1):
  if(sum(numbers[0:i]) == sum(numbers[i:n])):
    count += 1

print(count)


n = int(input())
numbers = list(map(int, input().split()))

count = 0
sumP1 = sum(numbers[0:1])
sumP2 = sum(numbers[1:n])

if(sumP1 == sumP2):
  count += 1

if(n > 2):
  for i in range(1, n - 1, 1):
    sumP1 += numbers[i]
    sumP2 -= numbers[i]

    if(sumP1 == sumP2):
      count += 1

print(count)


n = int(input())
numbers = list(map(int, input().split()))

count = 0
sumP1 = sum(numbers[0:1])
sumP2 = sum(numbers[1:n])

if(n > 1 and sumP1 == sumP2):
  count += 1

if(n > 2):
  for i in range(1, n - 1, 1):
    sumP1 += numbers[i]
    sumP2 -= numbers[i]

    if(sumP1 == sumP2):
      count += 1

print(count)


input()
x = list(map(int, input().split()))
y = [[0, 0] for _ in range(len(x))]
#y[0][0] = x[0]
for i in range(len(x)):
    y[i][0] = y[i-1][0] + x[i]
for i in reversed(range(len(x)-1)):
    y[i][1] = x[i+1]+y[i+1][1]
c = 0
for i in y[:-1]:
    if i[0] == i[1]: c+=1
print(c)


n = int(input())
x = list(map(int,input().split()))
c = 0
c1 = x[0]
c2 = sum(x[1:])
for i in range(1,n):
    if c1 == c2:
        c+=1
    c1 += x[i]
    c2 -= x[i]
print(c)


n = int(input())
x = list(map(int,input().split()))
c = 0
for i in range(n-1):
    if sum(x[:i+1]) == sum(x[i+1:]):
        c+=1
print(c)


n = int(input())
a = list(map(int, input().split()))

count = 0
sum1 = 0
sum2 = 0

for x in a:
    sum2 += x

for x in a[0:-1]:
    sum1 += x
    sum2 -= x
    if sum1 == sum2:
        count += 1

print(count)


##c
def main():
    n=int(input())
    ans=0
    A=list(map(int,input().split()))
    l=0
    r=sum(A)
    for s in range(n-1):
        l+=A[s]
        r-=A[s]
        if ( r==l ):
           ans+=1
    print(ans)
main()


##c
def main():
    n=int(input())
    ans=0
    A=list(map(int,input().split()))
    for s in range (1,n):
       if sum(A[:s])==sum(A[s:]):
           ans+=1
    print(ans)
main()


# Getting Problem-Data from Codeforces.
squareCount = int(input())
squareList = list(map(int,input().split(' ')))
# Creating Prefix-Sum Array for squareList.
prefixSquareList,sum = [],0
for i in range(squareCount):
    sum+=squareList[i];prefixSquareList.append(sum)
# Testing.
equalCount = 0
for i in range(squareCount-1):
    if prefixSquareList[i] ==  sum - prefixSquareList[i]:
        equalCount = equalCount+1
print(equalCount)


# Getting Problem-Data from Codeforces.
squareCount = int(input())
squareList = list(map(int,input().split(' ')))
# Creating Prefix-Sum Array for squareList.
prefixSquareList,sum = [],0
for i in range(squareCount):
    sum+=squareList[i];prefixSquareList.append(sum)
# Testing.
equalCount = 0
for i in range(squareCount-1):
    print(prefixSquareList[i],sum-prefixSquareList[i])
    if prefixSquareList[i] ==  sum - prefixSquareList[i]:
        equalCount = equalCount+1
print(equalCount)


#################
# July 14th 2019.
#################

#########################################################
# Getting Problem-Data from Codeforces.
squareCount = int(input())
squareList = list(map(int,input().split(' ')))
# Creating Prefix-Sum Array for squareList.
prefixSquareList,sum = [],0
for i in range(squareCount):
    sum+=squareList[i];prefixSquareList.append(sum)
# Counting Plausible stripes.
equalCount = 0
for i in range(squareCount-1):
    if prefixSquareList[i] ==  sum - prefixSquareList[i]:
        equalCount = equalCount+1
print(equalCount)
#########################################################

                 ########################################
                 # Programming-Credits atifcppprogrammer.
                 ########################################


# 18C
# θ(n) time
# θ(n) space

__author__ = 'artyom'

# SOLUTION

def main():
    n = read()
    a = read(3)
    s = 0
    t = sum(a)
    count = 0
    for i in range(n - 1):
        s += a[i]
        t -= a[i]
        if s == t:
            count += 1
    return count

# HELPERS

def read(mode=1, size=None):
    # 0: String
    # 1: Integer
    # 2: List of strings
    # 3: List of integers
    # 4: Matrix of integers
    if mode == 0: return input().strip()
    if mode == 1: return int(input().strip())
    if mode == 2: return input().strip().split()
    if mode == 3: return list(map(int, input().strip().split()))
    a = []
    for _ in range(size):
        a.append(read(3))
    return a

def write(s="\n"):
    if s is None: s = ''
    if isinstance(s, tuple) or isinstance(s, list): s = ' '.join(map(str, s))
    s = str(s)
    print(s, end="\n")

write(main())


n=int(input())
c=0
l=[int(i) for i in input().split()]
pre=[0]*(n+1)
for i in range(1,n+1):
    pre[i]=pre[i-1]+l[i-1]
for i in range(1,n):
    if pre[i]==(pre[n]-pre[i]):
        c+=1
print(c)


n = int(input())
S = list(map(int,input().split()))
total = sum(S)

sSum = [0] * n
sSum[0] = S[0]
for i in range(1, n):
    sSum[i] += sSum[i-1] + S[i]

count = 0
for i in range(n-1):
    value = sSum[i]
    if value == (total-value) :
        count += 1
print(count)


#########			##	##     ##    	  ####  #####  ##     #  ##     #		##
	#			   # #	# #   # #		 #	  #	#	#  # #    #  # #    #	   # #
	#			  #  #	#  ###  #	    #		#	#  #  #   #  #  #   #	  #  #
	#			 #####	#	#	#	   #    ###	#	#  #   #  #  #   #  #    #####
	#			#    #	#		#	   #    # #	#	#  #	# #  #	  # #   #    #
######### 	   #     # 	#		#		##### #	#####  #	 ##  #	   ##  #     #

"""

PPPPPPP       RRRRRRR		    OOOO	  VV        VV    EEEEEEEEEE
PPPPPPPP      RRRRRRRR         OOOOOO     VV       VV	  EE
PPPPPPPPP     RRRRRRRRR       OOOOOOOO    VV      VV	  EE
PPPPPPPP      RRRRRRRR        OOOOOOOO    VV     VV    	  EEEEEE
PPPPPPP       RRRRRRR         OOOOOOOO    VV    VV        EEEEEEE
PP  		  RRRR			  OOOOOOOO    VV   VV         EEEEEE
PP			  RR  RR          OOOOOOOO    VV  VV          EE
PP			  RR    RR         OOOOOO     VV VV           EE
PP			  RR      RR        OOOO      VVVV            EEEEEEEEEE

"""

"""
 Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
"""
import sys
input = sys.stdin.readline
# from bisect import bisect_left as lower_bound;
# from bisect import bisect_right as upper_bound;
# from math import ceil, factorial;

def ceil(x):
    if x != int(x):
        x = int(x) + 1
    return x

def factorial(x, m):
	val = 1
	while x>0:
		val = (val * x) % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;

## gcd function
def gcd(a,b):
    if b == 0:
        return a;
    return gcd(b, a % b);

## lcm function
def lcm(a, b):
	return (a * b) // gcd(a, b)

## nCr function efficient using Binomial Cofficient
def nCr(n, k):
	if k > n:
		return 0
	if(k > n - k):
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

## upper bound function code -- such that e in a[:i] e < x;
def upper_bound(a, x, lo=0, hi = None):
    if hi == None:
        hi = len(a);
    while lo < hi:
        mid = (lo+hi)//2;
        if a[mid] < x:
            lo = mid+1;
        else:
            hi = mid;
    return lo;

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    primes = {}
    while(n%2 == 0 and n > 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0 and n > 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
def power(x, y, p):
    res = 1
    x = x % p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) :
            res = (res * x) % p
        y = y >> 1
        x = (x * x) % p
    return res

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];

    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;

# the union function which makes union(x,y)
# of two nodes x and y
def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
def sieve(n):
    prime = [True for i in range(n+1)]
    prime[0], prime[1] = False, False
    p = 2
    while (p * p <= n):
        if (prime[p] == True):
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime

# Euler's Toitent Function phi
def phi(n) :

    result = n
    p = 2
    while(p * p<= n) :
        if (n % p == 0) :
            while (n % p == 0) :
                n = n // p
            result = result * (1.0 - (1.0 / (float) (p)))
        p = p + 1
    if (n > 1) :
        result = result * (1.0 - (1.0 / (float)(n)))

    return (int)(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False

	return True

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e5 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)]
# spf_sieve();
def factoriazation(x):
    res = []
    for i in range(2, int(x ** 0.5) + 1):
    	while x % i == 0:
    		res.append(i)
    		x //= i
    if x != 1:
   		res.append(x)
    return res
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

def factors(n):
	res = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			res.append(i)
			res.append(n // i)
	return list(set(res))

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()));

def float_array():
    return list(map(float, input().strip().split()));

## taking string array input
def str_array():
    return input().strip().split();

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

from itertools import permutations
import math

from bisect import bisect_left

def solve():
	n = int(input())
	stripe = list(map(int, input().split()))
	for i in range(1, n):
		stripe[i] += stripe[i - 1]
	c = 0
	for x in stripe[:-1]:
		if x == stripe[-1] // 2:
			c += 1
	print(c)

if __name__ == '__main__':
	for _ in range(1):
		solve()
	# fin_time = datetime.now()
# 	print("Execution time (for loop): ", (fin_time-init_time))