fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. int main()
  6. {
  7. int n, x, y, t;
  8. cin >> t;
  9. for (int j = 0; j < t; j++)
  10. {
  11. cin >> n >> x >> y;
  12. for (int i = 1; i <= n; i++)
  13. {
  14. if (i%x == 0 && i%y != 0) {
  15. cout << i << " ";
  16. }
  17. }
  18. cout << endl;
  19. }
  20. }
  21.  
Runtime error #stdin #stdout 0s 4448KB
stdin
Standard input is empty
stdout
Standard output is empty