#include using namespace std; int t, n, a, b, len; string s; class fastio { public: fastio() { ios_base::sync_with_stdio(false); cout.tie(nullptr); cin.tie(nullptr); } } __fastio; int f(int p, int i) { //Base Case if(p == 1 && i == len-1) return (a+b); else if(p == 2 && i == len-1) return ((2*a)+b); /* when there is crossroad (i.e 1) then x should be h = 2 and x + 1 could be h = 1 or 2 it depends on the value infront, for no crossroad (i.e 0) 'x' height could be either 1 or 2 depends on the optimal answer */ if(s[i] == '0' && p == 1) { /* if the infront value is 0 and past value of pillar (here p in f(p)) is 1, then there are two cases either front pillar could be h = 1 or 2, if 1 then cost would be cost of pillar + gasline that is --> a + b if h = 2 then cost would be 2 * unit pillar + 2 * unit gasline that is --> 2(a+b) */ return min(f(2,i+1)+2*(a+b), f(1,i+1)+a+b); } else if(s[i] == '1' && p == 1) { /* if infront value is 1, and past pillar is h = 1 then cost is 2 * pillar cost + gasline */ return f(1,i+1)+2*(a+b); } else if(s[i] == '0' && p == 2) { /* if the past pillar height is 2 and the infront value is 0, then h = 1 or 2, if 1 then cost would be 2a + b else 2b + a */ return min(f(1,i+1)+(2*a)+b, f(2,i+1)+(2*b)+a); } else if(s[i] == 1 && p == 2) { /* if the past pillar height is 2 and the infront value is 1 then h will be 2 and cost will be 2b + a */ return f(2,i+1)+(2*b)+a; } } void solve() { cin >> n >> a >> b; cin >> s; len = s.length(); cout << b + f(1,1) << endl; } int main() { __fastio; cin >> t; while(t--) { solve(); } return 0; }