#include <iostream> using namespace std ; int main() { int t ; cin >> t ; while(t--) { int n , c , m ; cin >> n >> c >> m ; int t = n/c ; int w = t ; bool flag = true ; while(flag) { if ( w >= m) { t = t + 1 ; w = w-m+1; flag = true ; } else { cout << t << endl ; flag = false ; } } } return 0 ; }
https://www.hackerrank.com/challenges/chocolate-feast