#C13605. Prime Check and Factorization
Prime Check and Factorization
Prime Check and Factorization
This problem requires you to determine whether a given integer \(n\) is a prime number. If \(n\) is prime, output a string in the format "n is a prime number
". Otherwise, output the list of all factors of \(n\) in increasing order formatted as a Python list (including the square brackets and commas).
Please note that if \(n\) is less than 2, you should print "Number must be 2 or greater
". Use the standard input for reading the number and standard output for printing the result.
Examples:
- Input: 5 → Output:
5 is a prime number
- Input: 4 → Output:
[1, 2, 4]
- Input: 12 → Output:
[1, 2, 3, 4, 6, 12]
- Input: 0 → Output:
Number must be 2 or greater
inputFormat
The input consists of a single integer \(n\) provided via standard input.
outputFormat
If \(n < 2\), output "Number must be 2 or greater". If \(n\) is prime, output "n is a prime number
" (with the actual number in place of \(n\)). Otherwise, output a list of all factors of \(n\) in the Python list format (e.g., [1, 2, 4]
for \(n = 4\)).
5
5 is a prime number