Submission #16374

#TimeUsernameProblemLanguageResultExecution timeMemory
16374eaststar새로운 달력 (GCJ12KOR_calendar)C++14
25 / 25
0 ms1084 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...