Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***
- created: 2022-07-08-00.19.17
- ***/
- #include <bits/stdc++.h>
- #include <ext/pb_ds/assoc_container.hpp>
- #include <ext/pb_ds/tree_policy.hpp>
- using namespace std;
- using namespace __gnu_pbds;
- template<typename U> using ordered_set=tree<U, null_type,less<U>,rb_tree_tag,tree_order_statistics_node_update>;
- #define ll long long
- #define test int tt; cin>>tt; for(int cs=1;cs<=tt;cs++)
- #define get_lost_idiot return 0
- #define nl '\n'
- int main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- test
- {
- ll n,m,i,j,t,d;
- cin>>t>>d;
- cout<<"Case "<<cs<<": ";
- if(t==0)
- {
- cout<<1<<nl;
- }
- else if(t%2==0)
- {
- double ans=1.00/((t+1.00)*1.00);
- cout<<fixed<<setprecision(10)<<ans<<nl;
- }
- else cout<<0<<nl;
- }
- get_lost_idiot;
- }
- /*
- d1 = (t / t+1)*(t-1 / t)
- final winning =(t - 1)/(t + 1)*(t - 3)/(t - 1)*(t - 5)/(t - 3) * 5/7 * 3/5 * 1/3
- finally = 1 / (t+1);
- */
Add Comment
Please, Sign In to add comment