Public submissions
Source code of every submission to this problem in this contest
will be visible for everyone since 20130826 11:14:31.
Submit  All submissions  Best solutions  Back to list 
SMPDIV  Divisibility 
Print all integers a_{i} such that a_{i} is divisible by x and not divisible by y, where 1 < a_{i} < 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
Added by:  kuszi 
Date:  20130826 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 
Public source code since:  20130826 11:14:31 
hide comments
20140625 20:24:06 Jitendra Mandi
anyone whats the logic of t lines please... 

20140126 11:04:11 Unknown
i am getting the wrong answer here while the code is running on my console. please help 

20140119 16:19:57 kuszi
@Stefan Majoor: Thank you for your comment, fixed. 

20140118 17:47:05 Stefan Majoor
Some more restrictions for the input: n > x and x is not divisible by y 

20140109 05:43:03 Abhijit Raj
Arrays aren't required to solve this problem. You can use simple increment scratching the ones you don't require. 

20131230 19:58:08 Sandhya Saravanan
Is there a simpler way to solve the problem without using arrays where all the input is given together and all output printed together after that? Please suggest! @Snehasish Nothing will be printed then. Leave it blank and go to the next line. Last edit: 20131231 08:52:37 

20131228 08:37:18 Snehasish Karmakar
What to print if for a particular combination of n, x and y, there is no such number which is divisible by x and not divisible by y ?? 