This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
int s[110];
int main(){
    int i,j,tc,b,c,t;
  	long long a;
    scanf("%d",&tc);
    for(i=1;i<=tc;++i){
        scanf("%lld%d%d",&a,&b,&c);
        t=b;
      	for(j=1;j<=c;++j)s[j]=(t+c-1)/c+s[j-1],t=t%c+b;
        printf("Case #%d: %lld\n",i,a/c*s[c]+s[a%c]);
    }
    return 0;
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |