#include <stdio.h> int main(){ int m,k; int count=0; int k_count=0; if (scanf("%d %d",&m,&k)!=EOF && k>=2 && m>=k && m<=1000){ while (m>0){ m--; count++; k_count++; if (k_count%k==0){m++;k_count=0;} // printf("day=%d %d\n",count,m); } printf("%d",count); } else{ printf("input wrong"); } return 0; }