#include #include #include using namespace atcoder; using mint = modint; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 2000000000 unsigned long xor128() { static unsigned long x=123456789, y=362436069, z=521288629, w=88675123; unsigned long t=(x^(x<<11)); x=y; y=z; z=w; return (w=(w^(w>>19))^(t^(t>>8))); } int main(){ int N; cin>>N; int Pa,Pb; { double t; cin>>t; t *= 1000; Pa = round(t); } { double t; cin>>t; t *= 1000; Pb = round(t); } vector a(N),b(N); rep(i,N){ cin>>a[i]; } rep(i,N){ cin>>b[i]; } sort(a.begin(),a.end()); sort(b.begin(),b.end()); double ans = 0.0; rep(i,1000000){ auto aa = a,bb = b; int Sa = 0,Sb = 0; rep(j,N){ int x,y; if(j==N-1||xor128()%1000bb[y]){ Sa += aa[x]+bb[y]; } else{ Sb += aa[x]+bb[y]; } aa.erase(aa.begin()+x); bb.erase(bb.begin()+y); } if(Sa>Sb){ ans += 1.0 / 1000000.0; } } cout<