//BISMILLAHIR RAHMANIR RAHIM
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mem(a, b) (memset(a, b, sizeof(a)))
#define pb push_back
#define mk make_pair
#define ff first
#define ss second
#define PI acos(-1)
#define INF 2147483647
#define MOD 1000000007
#define MAX 200005
using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> pii;
typedef vector<ii> vii;
typedef priority_queue<int,vector<int>,greater<int> > PQ;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int setBit(int mask, int pos){return mask = mask | (1<<pos);}
bool checkBit(int mask, int pos){return (bool)(mask & (1<<pos));}

ll arr[45];

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);

    int n;

    ll t;

    cin>>n>>t;

    for(int i = 0; i < n; i++)
        cin>>arr[i];

    int k = n / 2;
    set<ll> s1;
    ordered_set s2;

    for(int i = 0; i < (1<<k); i++) {
        ll sum = 0;
        for(int j = 0; j < k; j++) {
            if(checkBit(i, j))
                sum += arr[j];
        }

        s1.insert(sum);
    }
    s1.insert(0);

    int rem = n - k;
    for(int i = 0; i < (1<<rem); i++) {
        ll sum = 0;
        for(int j = 0; j < rem; j++) {
            if(checkBit(i, j))
                sum += arr[k+j];
        }
        s2.insert(sum);
    }
    s2.insert(0);

    ll ans = 0;
    for(set<ll> :: iterator it = s1.begin(); it != s1.end(); it++) {
        ll tx = *it;
        if(tx <= t) {
            ll rm = t - tx;
            int pos = s2.order_of_key(rm);
            if(s2.find_by_order(pos) != s2.end()) {
                if(*s2.find_by_order(pos) == rm) {
                    ans = max(ans, tx + rm);
                }
            }
            if(pos > 0) {
                pos--;
                ans = max(ans, tx + *s2.find_by_order(pos));
            }
        }
        else {
            break;
        }
    }

    cout<<ans<<endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define ll long long

ll fact(int a, int b){
    ll res = 1;
    rep(i, b) res *= a;
    return res;
}


int main(){
    double k; cin >> k;
    string s, t;
    cin >> s;
    cin >> t;
    
    //二人のスコア
    ll tscore = 0;
    ll ascore = 0;

    //枚数の情報
    vector<ll> ta(10, 0);
    vector<ll> ao(10, 0);
    vector<ll> used(10, 0);//二人の情報の合計
    rep(i, 4){
        ta[s[i] - '0']++;
        used[s[i] - '0']++;
        ao[t[i] - '0']++;
        used[t[i] - '0']++;
    }
    
    //現在の得点
    rep(i, 10){
        tscore += i * fact(10, ta[i]);
        ascore += i * fact(10, ao[i]);
    }

    double win = 0.0;
    double sum = 9.0*k - 8.0;//残りカード枚数

    for(int i = 1; i <= 9; i++){
        ll tak = tscore;
        if(used[i] == k) continue;//1枚も残っていない
        
        int x = k - used[i];//iの残り枚数
        used[i]++;
        tak -= i * fact(10, ta[i]);
        tak += i * fact(10, ta[i] + 1);
        for(int j = 1; j <= 9; j++){
            if(used[j] == k) continue;
            
            int y = k - used[j];
            used[j]++;
            ll aok = ascore;
            aok -= j * fact(10, ao[j]);
            aok += j * fact(10, ao[j] + 1);
            
            if(tak > aok) {
                win += (double)(x) / (double) sum * (double)(y);
                //cout << tak << ", " << aok << " (i, j) = " << i << " " << j << endl;
            }
            //sum++;
            used[j]--;
            
        }
        used[i]--;
    }
    //cout << win << endl;
    //cout << sum << endl;
    cout << fixed << setprecision(15) << (double)(win) / (double)(sum-1.0) << endl;
    return 0;
}