Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
502 B
5
Indexable
Never
a = int(input())
b = int(input())
c = int(input())
d = int(input())

low_limit_1, high_limit_1 = a, a + c 
low_limit_2, high_limit_2 = b, b + d 

primes_str = "11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97" 

for num1 in range(low_limit_1, high_limit_1 + 1):
  first_half = str(num1)
  for num2 in range(low_limit_2, high_limit_2 + 1):
    second_half = str(num2)
    if first_half in primes_str and second_half in primes_str:
      print(f"{first_half}{second_half}")