You are viewing a single comment's thread. Return to all comments →
simple solution in c++
int main(){ int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int n; int c; int m; int t=0,w=0,l=0; cin >> n >> c >> m; t=n/c; w=n/c; while(w>=m) { t+=w/m; w=(w/m) + (w%m); } cout<<t<<endl; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Chocolate Feast
You are viewing a single comment's thread. Return to all comments →
simple solution in c++