package main import "fmt" func main() { var n int _, _ = fmt.Scan(&n) p := make([]int, 0) // 試行した数字をためる for i := 3; i <= n; i++ { contain := false for _, num := range p { if i%num == 0 { contain = true break } } if contain { continue } if n%i == 0 { fmt.Println(i) return } p = append(p, i) } fmt.Println(n) }