1 solutions

  • 0
    @ 2023-10-17 19:49:51
    #include <stdio.h>
    int main()
    {
        int M;
        int k;
        scanf("%d %d",&M,&k);
        int j=M;
        int miu=0;
        int i=0;
        for(i=M;i>0;i--)
        {
            miu++;
            if(i==j-k)
            {
                i++;
                j=i;
            }
        }
        if(j==k)
                miu++;
        printf("%d",miu);
        return 0;
    }
    

    Information

    ID
    6818
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    5
    Tags
    # Submissions
    46
    Accepted
    18
    Uploaded By