#include <stdio.h>
int main()
{
long x,y;
while(scanf("%ld %ld",&x,&y)==2){
long temp=x+((x-1)/(y-1));
printf("%ld\n",temp);
}
return 0;
}
int main()
{
long x,y;
while(scanf("%ld %ld",&x,&y)==2){
long temp=x+((x-1)/(y-1));
printf("%ld\n",temp);
}
return 0;
}
can you prove it plz ?
ReplyDeleteby some trials and some guess ...
Deletefound that
val = x + (x-1)/(y-1)