#include<bits/stdc++.h> #define MAX_N 100 #define INF 0x3f3f3f3f usingnamespace std; typedefdouble dnt; template <classT> inlinevoidread(T &x){ x = 0; int c = getchar(), f = 1; for (; !isdigit(c); c = getchar()) if (c == 45) f = -1; for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0'); } int n, m, s, u[1005], v[1005]; dnt p, w[105], pw[105], ans; dnt f[105][105][105], g[105]; intmain(){ read(n), read(m); for (int i = 1; i <= n; i++) scanf("%lf", w+i); read(s), scanf("%lf", &p), pw[0] = 1.0; for (int i = 1; i <= n; i++) pw[i] = pw[i-1]*p; for (int i = 1; i <= m; i++) read(u[i]), read(v[i]); for (int i = 1; i <= n; i++) for (int j = 1; j <= n; j++) for (int k = 0; k <= n; k++) f[i][j][k] = -INF; for (int i = 1; i <= n; i++) f[i][i][0] = g[i] = w[i]; for (int stp = 1; stp <= n; stp++) for (int i = 1; i <= n; i++) for (int j = 1; j <= m; j++) f[i][v[j]][stp] = max(f[i][v[j]][stp], f[i][u[j]][stp-1]+w[v[j]]*pw[stp]); for (int i = 1; i <= n; i++) for (int stp = 1; stp <= n; stp++) g[i] = max(g[i], (f[i][i][stp]-w[i]*pw[stp])/(1-pw[stp])); for (int i = 1; i <= n; i++) for (int stp = 1; stp <= n; stp++) ans = max(ans, f[s][i][stp]-w[i]*pw[stp]+g[i]*pw[stp]); returnprintf("%.1lf\n", ans), 0; }