#include #define f first #define s second using namespace std; typedef long long int ll; void routine(){ ll n; double p; cout << fixed << setprecision(7); cin >> n >> p; if(n >= 200){ cout << 1; return; } double ans = 0; double start = 1.0; for(ll i = 0;i <= n;i++){ ans += start*p; start *= (1-p); } cout << fixed << setprecision(7) << ans; return; } int main(){ ios::sync_with_stdio(0); cin.tie(0); ll t = 1; while(t--){ routine(); } return 0; }