atcoder#ARC114A. [ARC114A] Not coprime
[ARC114A] Not coprime
Score : points
Problem Statement
Given are integers between and (inclusive): . Find the minimum positive integer that satisfies the following for every :
- and are not coprime.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum positive integer that satisfies the condition.
2
4 3
6
Being not coprime with requires being even, and being not coprime with requires being a multiple of .
1
47
47
7
3 4 6 7 8 9 10
42