#include #include #include using namespace std; int main() { int n, x; string temp; while ((cin >> n) && (n != 0)) { vector prob(1001, 0); prob[0] = 1; for (int i = 0; i < n; i++) { cin >> temp; int m = atoi(temp.substr(1).c_str()); vector new_prob(1001, 0); for (int j = 0; j <= 1000; j++) for (int k = 1; k <= m; k++) if (j >= k) new_prob[j] += prob[j-k] * 1.0 / m; prob = new_prob; } cin >> x; cout.precision(5); cout << fixed << prob[x] << endl; } return 0; }