fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4.  
  5. int main(){
  6. int t; scanf("%d", &t);
  7. while(t--)
  8. {
  9. long long int a,b,c;
  10. scanf("%lld %lld %lld", &a,&b,&c);
  11. //find first divisor
  12. long long int nxt_divisor;
  13. if(a%c == 0)nxt_divisor=a;
  14. else nxt_divisor = c*((a/c)+1);
  15.  
  16. for(long long int i=nxt_divisor; i<=b; i=i+c){
  17. printf("%lld\n", i);
  18. }
  19. printf("\n");
  20. }
  21.  
  22. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
Standard output is empty