#include<stdio.h>
int main()
{
    int a,b,c=0;
    int x[100];
    x[0]=0;
    scanf("%d %d",&a,&b);
    for(int i=0;i<a;i++)
    {
        x[i]=x[i]+b;
        if(x[i]>a)
        {
            x[i]=x[i]-a;
        }
        for(int j=0;j<a;j++)
        {
            if(x[i]==x[j])
            {
                x[i]=x[i]+1;
            }
        }
        printf("%d ",x[i]);
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: