package main import ( "fmt" "math" ) func getSieve(N int) []int { field := make([]bool, N + 1) sieve := make([]int, 0) for k := 2; k <= N; k++ { if field[k] { continue } for v := k * k; v <= N; v += k { field[v] = true } sieve = append(sieve, k) } return sieve } func getMinSieve(n int) int { for k := 2; k <= n; k++ { if n % k == 0 { return k } } return -1 } func main() { var L int var H int fmt.Scanf("%d", &L) fmt.Scanf("%d", &H) sieve := getSieve(int(math.Sqrt(float64(H)) + 5)) for l := len(sieve) - 1; l >= 0; l-- { p := sieve[l] if p * p > H { continue } for m := H / p; m * p >= L; m-- { if getMinSieve(m) == p { fmt.Println(m * p) return } } } }