Bryce1010模板

K - KazaQ’s Socks

#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;
}

相关文章:

  • 2021-09-19
  • 2022-12-23
  • 2021-10-12
  • 2021-10-28
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2021-08-31
猜你喜欢
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-09-26
  • 2021-08-12
  • 2021-06-12
相关资源
相似解决方案