Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- first_start = int(input())
- second_start = int(input())
- first_diff = int(input())
- second_diff = int(input())
- for i in range(first_start, first_start + first_diff + 1):
- for j in range(second_start, second_start + second_diff + 1):
- is_first_prime = True
- is_second_prime = True
- for k in range(2, int(math.sqrt(i)) + 1):
- if i % k == 0:
- is_first_prime = False
- break
- for k in range(2, int(math.sqrt(j)) + 1):
- if j % k == 0:
- is_second_prime = False
- break
- if is_first_prime and is_second_prime:
- print(f'{i}{j}')
Add Comment
Please, Sign In to add comment