fork(3) download
  1. t = int(input())
  2. for i in range(t):
  3. n, x, y = list(map(int, input().split(' ')))
  4. result = [num for num in range(1,n) if (num % x == 0 and num % y != 0)]
  5. print(*result)
Success #stdin #stdout 0.02s 9244KB
stdin
2 
7 2 4
35 5 12
stdout
2 6
5 10 15 20 25 30