Segment remainders

Given a segment [l; r], your task is to find all the numbers that when divided by d produce a remainder c.
The input of the program contains 4 numbers l, r, c, and d.
The program should print all the numbers satisfying the condition separated by a space.
Input
2
5
0
2

Output
2 4
 
To check your solution you need to sign in
Sign in to continue