0.SVMC 2017 smpdiv - divisibility


Submit solution

Points: 1 (partial)
Time limit: 1.0s
Memory limit: 10M

Author:
Problem type
Allowed languages
Ada, Assembly, Awk, C, C++, C11, CLANG, CLANGX, Classical, COBOL, Coffee, CSC, D lang, DART, F95, FORTH, Fortrn, GAS32, GO, Haskell, Itercal, Java, kotlin, LEAN, LISP, LUA, MONOVB, Nasm, OCAML, Pascal, Perl, php, PIKE, prolog, Pypy, Python, Ruby 2, RUST, Scala, SCM, SED, SWIFT, TCL, TUR, V8JS, VB, ZIG

Print all integers ai such that ai is divisible by x and not divisible by y, where 1 < ai < n < 100000.

Input

First, you are given t (t<100) - the number of test cases. In each of the following t lines, 3 integers: n x y.

You might assume also that x < n and x is not divisible by y.

Output

In each of the following t lines, numbers requested in the problem description in the separated by a single space in ascending order.

Example

Input:

2

7 2 4

35 5 12

Output:

2 6

5 10 15 20 25 30


Comments

There are no comments at the moment.