Skip to content

Commit bd27dbf

Browse files
committed
SPOJ Problems
1 parent f8ca148 commit bd27dbf

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Print all integers ai such that ai is divisible by x and not divisible by y, where 1 < ai < n < 100000.
2+
#
3+
# Input
4+
#
5+
# First, you are given t (t<100) - the number of test cases. In each of the following t lines, 3 integers: n x y.
6+
#
7+
# You might assume also that x < n and x is not divisible by y.
8+
#
9+
# Output
10+
#
11+
# In each of the following t lines, numbers requested in the problem description in the separated by a single space in
12+
# ascending order.
13+
#
14+
# Example
15+
#
16+
# Input:
17+
# 2
18+
# 7 2 4
19+
# 35 5 12
20+
# Output:
21+
# 2 6
22+
# 5 10 15 20 25 30
23+
24+
testCases = int(input())
25+
for _ in range(testCases):
26+
n, x, y = map(int, input().split())
27+
for i in range(n):
28+
if i % x == 0 and i % y != 0:
29+
print(i, end = ' ')
30+
print()

0 commit comments

Comments
 (0)