#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--)
{
int n, a, b,c=0,d=0;
cin >>n>>a>>b;
string e;
cin>>e;
for (int i=0;i<n;i++)
{
if(e[i]=='0')
c++;
else
d++;
}
int sol=0;
sol=((c*a)+(d*b));
cout<<sol<<endl;
}
return 0;
}


0 Comments