#include #define rep(i, l, n) for (int i = (l); i < (n); i++) using namespace std; int main(void) { int n; cin >> n; double p; cin >> p; if (n >= 200) { cout << 1 << endl; return 0; } double ans = 0.0; double t = 1.0; rep(i, 0, n) { ans += t * p; t *= 1 - p; } cout << ans << endl; return 0; }