Untitled

 avatar
unknown
plain_text
a year ago
601 B
7
Indexable
#include <bits/stdc++.h>
using namespace std;

double Fpow(double x , int n) {
    double res = 1;
    while(n > 0) {
        if(n & 1) res *= x;
        x *= x;
        n >>= 1;
    }
    return res;
}

void solve() {
    cout << fixed << setprecision(8);
    double R; int  n;
    cin >> R >> n;

    double x = R * ((sqrt(2) - 1)) / (sqrt(2) + 1); 
    cout << Fpow(x , n) << '\n';
}

int main() {
    std::ios::sync_with_stdio(false);
    ios_base::sync_with_stdio(false);
    cout.tie(nullptr);
    cin.tie(nullptr);
    int t = 1; cin >> t;
    while (t--)solve();
}
Editor is loading...
Leave a Comment