#B4130. Longest Consecutive Non-prime Subsequence
Longest Consecutive Non-prime Subsequence
Longest Consecutive Non-prime Subsequence
Given a positive integer n, consider the sequence \(\{2, 3, \ldots, n\}\). Your task is to find the maximum length of a consecutive subsequence that consists solely of non-prime numbers. A non-prime number is any number that is not prime. If there are no non-prime numbers in the sequence, the answer is 0.
inputFormat
The input consists of a single positive integer n (\(n \ge 2\)).
outputFormat
Output the maximum length of the consecutive non-prime subsequence in the sequence \(\{2, 3, \ldots, n\}\).
sample
2
0