fork download
  1. #include "bits/stdc++.h"
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int t;
  7. cin >> t;
  8. while (t--) {
  9. int l,r,d;
  10. cin >> l >> r >> d;
  11. if (d < l || d > r) cout << d << endl;
  12. else cout << (r/d +1)*d << endl;
  13. }
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
32764
32764