#include <bits/stdc++.h>
#include <string.h>
using namespace std;
#define ll long long
void solve(){
ll n,x,y;cin>>n>>x>>y;
string a,b;cin>>a>>b;map<char,int>mp;
for(auto p:a){mp[p]++;}
ll ans=0;
for(ll i=0;i<n;i++){int p=0;
if(a[i]==b[i]){p=1;}
if(a[i]!=b[i]){
if(mp[b[i]]==0 || x>=2*y){ans+=y;mp[a[i]]--;p=1;}
else{for(int j=i+1;j<n;j++){if((a[j]==b[i]) && (a[i]==b[j])){ans+=x;mp[a[j]]--;mp[a[i]]--;a[j]=b[j];p=1;break;}}}
if(p==0){ans+=y;}
}
}cout<<ans<<endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t;cin>>t;
while(t--)
solve();
return 0;
}
CiAKI2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBsbCBsb25nIGxvbmcKIAp2b2lkIHNvbHZlKCl7CiBsbCBuLHgseTtjaW4+Pm4+Png+Pnk7CiBzdHJpbmcgYSxiO2Npbj4+YT4+YjttYXA8Y2hhcixpbnQ+bXA7CiBmb3IoYXV0byBwOmEpe21wW3BdKys7fQogbGwgYW5zPTA7CiBmb3IobGwgaT0wO2k8bjtpKyspe2ludCBwPTA7CiAgICAgaWYoYVtpXT09YltpXSl7cD0xO30KICAgICBpZihhW2ldIT1iW2ldKXsKICAgICAgICAgaWYobXBbYltpXV09PTAgfHwgeD49Mip5KXthbnMrPXk7bXBbYVtpXV0tLTtwPTE7fQogICAgICAgICBlbHNle2ZvcihpbnQgaj1pKzE7ajxuO2orKyl7aWYoKGFbal09PWJbaV0pICYmIChhW2ldPT1iW2pdKSl7YW5zKz14O21wW2Fbal1dLS07bXBbYVtpXV0tLTthW2pdPWJbal07cD0xO2JyZWFrO319fQogICAgICAgICBpZihwPT0wKXthbnMrPXk7fQogICAgIH0KIH1jb3V0PDxhbnM8PGVuZGw7Cn0KIAppbnQgbWFpbigpIHsKICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7CiAgIGNpbi50aWUoTlVMTCk7CiAgIGNvdXQudGllKE5VTEwpOwogICBpbnQgdDtjaW4+PnQ7CiAgIHdoaWxlKHQtLSkKICAgc29sdmUoKTsKCXJldHVybiAwOwp9