#include <stdio.h> int main() { int n,e,f,c,p,s; scanf("%d",&n); while (n--) { scanf("%d%d%d",&e,&f,&c); s=0; p=e+f; while (p>=c) { s=s+p/c; p=p/c+p%c; } printf("%d\n",s); } return 0; }
Sunday, April 24, 2016
Subscribe to:
Post Comments (Atom)
Coprights @ 2016, Coder Cart
0 comments:
Post a Comment