题意
编号1~N,每数K个出局,范围1e6
代码
#include<iostream>
#include<cstdio>
#include<cstdio>
#include<algorithm>
#define ll long long
using namespace std;
ll n,k;
ll cur;
int main(){
cin>>n>>k;
cur=0;
for(int i=2;i<=n;i++){
cur=(cur+k)%i;
}
cur++;
cout<<cur<<endl;
return 0;
}