#include using namespace std; int main() { int T; cin >> T; for( int i = 0; i < T; i++ ) { double p; int K; cin >> p >> K; double ans = K; if( p ) { ans = (1 - pow( 1 - p, K )) / p; } cout << fixed << setprecision(12) << ans << endl; } }