#P16285. [蓝桥杯 2026 省 Python A 组] 可选数
[蓝桥杯 2026 省 Python A 组] 可选数
Problem Description
Given positive integers and a target integer .
If a positive integer is a common multiple of , then we call an optional number.
Now, you need to find the smallest positive integer such that for any optional number , (the least common multiple of and ) is divisible by .
Input Format
The first line contains two integers and .
The second line contains integers .
Output Format
Output one integer, representing the smallest positive integer that satisfies the condition.
3 12
6 4 9
1
2 10
4 6
5
Hint
Constraints
For of the testdata, , .
For all testdata, , .
Translated by ChatGPT 5