#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <unordered_map>
#include <unordered_set>

#define ll long long
#define mod 1000000007

using namespace std;

int main() {
    int N; ll X;
    cin >> N >> X;
    vector<int> a(N);
    ll ans=X;
    for (auto &e : a) {
        cin >> e;
    }
    // try all sizes of 1, 2, 3, ... N materials
    for (int k=1; k<=N; ++k) {
        // given two sums of size k with the same remainder (mod k)
        // we only care about the larger on since that will get to X faster
        //
        // Let dp[i][j] be the maximum sum of size i that has remainder j
        // dp[i][j] = -1 if it is impossible to have remainder j for size i
        //
        vector<vector<ll>> dp(k+1, vector<ll>(k,-1));
        dp[0][0]=0;
        for (auto e : a) {
            // look at previous elements
            for (int c=k-1; c>=0; --c) {
                // look at all possible remainders
                for (int r=0; r<k; ++r) {
                    if (dp[c][r]==-1) continue;
                    ll nxt = dp[c][r] + e;
                    dp[c+1][nxt%k] = max(dp[c+1][nxt%k], nxt);
                }
            }
        }
        if (dp[k][X%k]==-1) {
            continue;
        } else {
            ans = min(ans, (X-dp[k][X%k])/k);
        }
    }
    cout << ans << endl;
    return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

int score(map<LL, LL> m) {
  int ret = 0;
  for (int i = 1; i <= 9; ++i) {
    ret += i * pow(10, m[i]);
  }
  return ret;
}

int main() {
  LL K; cin >> K;
  std::map<LL, LL> m, m_S, m_T;
  for (int i = 1; i <= 9; ++i) m[i] = K;
  string S, T; cin >> S >> T;

  for (char c : S) {
    int v = c - '0';
    m_S[v]++;
    m[v]--;
  }
  for (char c : T) {
    int v = c - '0';
    m_T[v]++;
    m[v]--;
  }

  long double prob = 0;
  for (int i = 1; i <= 9; ++i) {
    for (int j = 1; j <= 9; ++j) {
      auto m1 = m;
      m1[i]--;
      auto m2 = m1;
      m2[j]--;
      if (m1[i] < 0 || m2[j] < 0) continue;

      auto tmp_S = m_S, tmp_T = m_T;
      tmp_S[i]++; tmp_T[j]++;
      if (score(tmp_S) > score(tmp_T)) {
        long double p1 = (long double)m[i] / (9LL * K - 8LL);
        long double p2 = (long double)m1[j] / (9LL * K - 9LL);
        prob += p1 * p2;
      }
    }
  }
  printf("%.12Lf\n", prob);
}
