Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- double b, m, n, k;
- cin>>b>>m>>n>>k;
- if(b == 1)
- {
- cout<<m<<"\n";
- continue;
- }
- double r = (m*1.0)/(m+n);
- cout<<fixed<<setprecision(10);
- if(k == b) cout<<m+r*(k-1)<<"\n";
- else cout<<m-r<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment