mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
da5da8ec9f
3100-3199
10 lines
187 B
C++
10 lines
187 B
C++
#include<cstdio>
|
|
int main(){
|
|
int a,e,f,c,b;
|
|
while(~scanf("%d%d%d",&e,&f,&c)){
|
|
for(a=e+f,b=0;a>=c;a=a%c+a/c)
|
|
b+=a/c;
|
|
printf("%d\n",b);
|
|
}
|
|
}
|