#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<i;j++)
        {
            if(x[i]==x[j])
            {
                x[i]=x[i]+1;
                if(x[i]>a)
                {
                    x[i]=x[i]-a;
                }
            }
        }
        x[i+1]=x[i];
        x[i-1]=0;
    }
    printf("<");
    for(int i=0;i<a-1;i++)
    {
        printf("%d, ",x[i]);
    }
    printf("%d",x[a]);
    printf(">");
}

Embed on website

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