#include <bits/stdc++.h>
using namespace std;
#define LL long long
int main()
{
LL n,k;
LL ca=1;
while(cin>>n>>k)
{
if(k<=n)
cout<<"Case #"<<ca++<<": "<<k<<endl;
else
{
LL tmp=(k-n)%(2*(n-1));
// cout<<tmp<<endl;
if(tmp==0)cout<<"Case #"<<ca++<<": "<<n<<endl;
else if(tmp==n-1)cout<<"Case #"<<ca++<<": "<<n-1<<endl;
else
{
cout<<"Case #"<<ca++<<": "<<tmp%(n-1)<<endl;
}
}
}
return 0;
}
K - KazaQ’s Socks
猜你喜欢
转载自blog.csdn.net/Fire_to_cheat_/article/details/80726175
今日推荐
周排行