ac

黄泉锟  •  1年前


include

include

using namespace std; int a[10005]; int main(){

int m,n,count=0,i=1,t;
cin>>m>>n;
t=m;
while(t){
	if(a[i]==0)
	count++;
if(count==n)
{
	a[i]=1;
	count=0;
	cout<<i<<endl;
	t--;
}
if(i==m)
	i=0;
i++;
}

return 0;

}


评论:

请先登录,才能进行评论