Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start_first_pair_value = int(input())
- start_second_pair_value = int(input())
- diff_first_pair = int(input())
- diff_second_pair = int(input())
- first_prime_pair = 0
- second_prime_pair = 0
- counter = 0
- first_pair_found = False
- second_pair_found = False
- for first_pair in range(start_first_pair_value, ((start_first_pair_value + diff_first_pair) + 1)):
- for n in range(1, first_pair + 1):
- if first_pair % n == 0:
- counter += 1
- if counter <= 2:
- first_prime_pair = first_pair
- first_pair_found = True
- counter = 0
- for second_pair in range(start_second_pair_value, ((start_second_pair_value + diff_second_pair) + 1)):
- for n in range(1, second_pair + 1):
- if second_pair % n == 0:
- counter += 1
- if counter <= 2:
- second_prime_pair = second_pair
- second_pair_found = True
- if first_pair_found and second_pair_found:
- print(f"{first_prime_pair}{second_prime_pair}")
- counter = 0
- first_pair_found = False
- second_pair_found = False
Add Comment
Please, Sign In to add comment