#include<iostream> using namespace std; int main() { int t; cin >> t; while(t --) { string s1, s2; int n; cin >> s1 >> s2 >> n; int k = 0; for(int i = 0;i < s1.size();i ++) { if(s1[i] != s2[i]) k ++; } if(k % 2 == 0 && k/2 < n) { cout << "YES" << endl; } else cout << "NO" << endl; } return 0; } |
Double click to view unformatted code.