Masala #0267
Qoldiq
\(X\) sonini \(A\) ga bo`lganda qoldiq \(K\) bo`lsa \(X \space mod \space A = K\) degan tenglik tushuniladi. Katta ustoz Sunnat yosh dasturchilarga qoldiqli bo`lishni o`rgatib bo`lganidan so`ng ularga quyidagicha topshiriq berdi.
\([L, R]\) oralig`idan shunday \(X\) sonlar sonini topish kerakki \(X \space mod \space A = K\) bo`lsin! Buni hisoblab beruvchi dastur tuzib yosh dasturchilarga yordam bering.
Yagona qatorda 4 ta butun \(A, K, L\) va \(R (0 < K < A < 10^4 , 0 < L < R < 10^9)\) sonlari beriladi
Yagona butun son masala yechimini chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
10 5 7 10 |
0 |
2 |
5 1 3 8 |
1 |