You are viewing a single comment's thread. Return to all comments →
int solve(int a, int b, int d) { if(d==0) return 0; else if(d==a || d==b) return 1; else { if((d-b)%b==0) return (d-b)/b+1; else return (d-b)/b+2; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Baby Step, Giant Step
You are viewing a single comment's thread. Return to all comments →
int solve(int a, int b, int d) { if(d==0) return 0; else if(d==a || d==b) return 1; else { if((d-b)%b==0) return (d-b)/b+1; else return (d-b)/b+2; } }