#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector VI; typedef vector VVI; #define REP(i, n) for(int(i)=0;(i)<(n);++(i)) #define FOR(i, f, t) for(int(i)=(f);(i)<(t);(++i)) #define RREP(i, n) for(int(i)=(n)-1;(i)>=0;--(i)) const int MOD = int(1e9+7); int N; double Pa,Pb; int a[22],b[22]; int res = 0; unsigned int xor128(void) { static unsigned int x=123456789,y=362436069,z=521288629,w=88675123; unsigned int t=(x^(x<<11));x=y;y=z;z=w; return( w=(w^(w>>19))^(t^(t>>8)) ); } int main(){ do { cin.tie(0); ios_base::sync_with_stdio(false); } while(0); cin >> N >> Pa >> Pb; REP(i,N) cin >> a[i]; REP(i,N) cin >> b[i]; sort(a,a+N); sort(b,b+N); int win = 0, total = 0; clock_t t = clock() + CLOCKS_PER_SEC * 2.5; while(t >= clock()){ ll sa = 0, sb = 0; VI aa(a,a+N), bb(b,b+N); REP(i,N){ int ka,kb; double x = xor128()%1000/1000.; if(aa.size() == 1 || x kb) sa += ka+kb; else sb += ka+kb; } if(sa > sb) win++; total++; } cout << fixed << setprecision(15) << 1. * win / total << endl; return 0; }