func_code_string: #include <bits/stdc++.h>   template <typename T, typename S>   inline bool upmin(T& a, const S& b) {     return a > b ? a = b, 1 : 0;   }   template <typename T, typename S>   inline bool upmax(T& a, const S& b) {     return a < b ? a = b, 1 : 0;   }   using namespace std;   const int dx[4] = {-1, 0, 1, 0};   const int dy[4] = {0, 1, 0, -1};   const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};   const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};   inline bool is_down(char x) { return ( a  <= x && x <=  z ); }   inline bool is_upper(char x) { return ( A  <= x && x <=  Z ); }   inline bool is_digit(char x) { return ( 0  <= x && x <=  9 ); }   inline int read() {     int x = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = 10 * x + ch -  0 ;       ch = getchar();     }     return x * f;   }   inline long long readll() {     long long x = 0, f = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) f = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 ) {       x = 10 * x + ch -  0 ;       ch = getchar();     }     return x * f;   }   long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }   long long power(long long x, long long y) {     long long t = 1;     for (; y; y >>= 1, x = x * x % (1000000007))       if (y & 1) t = t * x % (1000000007);     return t;   }   long long n, k;   int main() {     n = read();     k = read();     string s, t;     cin >> s;     cin >> t;     long long cnt = 1, ans = 0;     for (int i = 0; i <= n - 1; i++) {       cnt = (cnt - 1) * 2 + (t[i] -  a ) - (s[i] -  a ) + 1;       if (cnt >= k) {         ans += (n - i) * k;         break;       } else {         ans += cnt;       }     }     cout << ans << endl;     return 0;   }   