#include <iostream> #include <vector> #include <algorithm> #include <iomanip> using namespace std; #define RREP(i,s,e) for (i = s; i >= e; i--) #define rrep(i,n) RREP(i,(int)(n)-1,0) #define REP(i,s,e) for (i = s; i <= e; i++) #define rep(i,n) REP(i,0,(int)(n)-1) #define INF 100000000 typedef long long ll; int n; double pb; double dp[1<<20], dp2[1<<20], p[20][20], e[20][20]; int a[20], b[20]; int main() { int i, j; double pa; cin >> n >> pa >> pb; rep (i,n) cin >> a[i]; rep (i,n) cin >> b[i]; dp[0] = dp2[0] = 1; rep (i,1<<n) { bool first = true; int cnt = __builtin_popcount(i); rep (j,n) { if (!(1<<j&i)) { if (cnt == n-1) { dp[i|1<<j] += dp[i]; dp2[i|1<<j] += dp2[i]; p[cnt][j] += dp[i]; } else if (first) { dp[i|1<<j] += dp[i] * pa; dp2[i|1<<j] += dp2[i] * pb; first = false; p[cnt][j] += dp[i] * pa; } else { dp[i|1<<j] += dp[i] * (1-pa) / (n-cnt-1); dp2[i|1<<j] += dp2[i] * (1-pb) / (n-cnt-1); p[cnt][j] += dp[i] * (1-pa) / (n-cnt-1); } } } } sort(a,a+n); sort(b,b+n); rep (i,n) rep (j,n) e[i][j] = p[i][j] * a[j]; rep (i,n) rrep (j,n-1) { p[i][j] += p[i][j+1]; e[i][j] += e[i][j+1]; } double ans = 0; rep (i,1<<n) { int cnt = __builtin_popcount(i); bool first = true; rep (j,n) { if (!(i&1<<j)) { int index = lower_bound(a,a+n,b[j]) - a; if (cnt == n-1) ans += index < n ? dp2[i]*(e[cnt][index]+p[cnt][index]*b[j]) : 0; else if (first) { ans += index < n ? dp2[i]*(pb*e[cnt][index]+p[cnt][index]*pb*b[j]) : 0; first = false; } else ans += index < n ? dp2[i]*((1-pb)/(n-cnt-1)*e[cnt][index]+p[cnt][index]*(1-pb)/(n-cnt-1)*b[j]) : 0; } } } cout << setprecision(10) << ans << endl; return 0; }