func_code_string: #include <bits/stdc++.h>   using namespace std;   inline void pisz(int n) { printf( %d n , n); }   const int MAX_N = 200010;   int n;   char a[MAX_N];   char b[MAX_N];   double s1[26][MAX_N];   double s2[26][MAX_N];   void precompute() {     s1[b[1] -  A ][1] = 1UL;     for (int(i) = (2); (i) <= (n); ++i) {       for (int(j) = 0; (j) < (26); ++(j)) {         s1[j][i] = s1[j][i - 1];         if (j == b[i] -  A ) {           s1[j][i] = (double)(s1[j][i] + i);         }       }     }     s2[b[n] -  A ][n - 1] = 1UL;     for (int(i) = (n - 2); (i) >= (1); --i) {       for (int(j) = 0; (j) < (26); ++(j)) {         s2[j][i] = s2[j][i + 1];         if (j == b[i + 1] -  A ) {           s2[j][i] = (double)(s2[j][i] + (double)(n - (i + 1UL) + 1UL));         }       }     }   }   int main() {     char c;     scanf( %d , &n);     scanf( %s , a + 1);     scanf( %s , b + 1);     precompute();     double num_of_substrings = 0UL;     for (int(l) = (1); (l) <= (n); ++l) {       num_of_substrings += (double)((double)((double)(n - l) + 1UL) *                                     (double)((double)(n - l) + 1UL));     }     double count = 0UL;     for (int(i) = (1); (i) <= (n); ++i) {       c = a[i];       count = (double)(count + (double)((double)(n - i + 1UL) * s1[c -  A ][i]));       count = (double)(count + (double)(i * s2[c -  A ][i]));     }     double res = (count * 1.0) / (num_of_substrings);     printf( %.9f n , res);     return 0;   }   