#include #define poly vector #define IOS ios::sync_with_stdio(false) #define ll long long #define mp make_pair #define mt make_tuple #define pa pair < int,int > #define fi first #define se second #define inf 1e18 #define mod 998244353 #define sz(x) (int)((x).size()) #define int ll //#define N using namespace std; inline double quickPower(double x,ll y) { double res=1; while (y) { if (y&1) res=res*x; x=x*x; y>>=1; } return res; } void BellaKira() { double p; int n; cin>>p>>n; double ans=0; for (int i=1;i<=n;i++) { ans+=p*quickPower(1.0-p,i-1)*i; } ans+=quickPower(1.0-p,n)*n; cout<>T; while (T--) { BellaKira(); } }