#include<bits/stdc++.h>
using namespace std;
int yue(long long int tt,long long int t)
{
if(t == 0)
return tt;
yue(t, tt% t);
}
int main()
{
long long int n,m ,k;
//freopen("222.txt", "r", stdin);
//freopen("111.txt", "w", stdout);
cin >> m;
for(long long int i = 1;i <= m; i++)
{
cin >> n >> k;
long long t, tt;
t = (long long )1 << k ;
tt = t - k - (long long ) 1;
long long int tw = yue(tt, t);
tt /= tw;
t /= tw;
if(tt == 0)
t = 1;
if(tt == t)
tt = t =1;
printf("Case #%lld: %lld/%lld\n",i,tt, t);
}
}
[UVA-11971]
最新推荐文章于 2020-09-02 11:40:52 发布