#K83522. Longest Arithmetic Subsequence in First N Natural Numbers
Longest Arithmetic Subsequence in First N Natural Numbers
Longest Arithmetic Subsequence in First N Natural Numbers
Given a positive integer \(N\), consider the array of the first \(N\) natural numbers: \(1, 2, \ldots, N\). This array is an arithmetic sequence with a common difference of 1. Your task is to compute the length of the longest arithmetic subsequence within this array. Since the entire array is an arithmetic sequence, the answer is always \(N\).
Example:
- For \(N = 5\), the sequence is \(1, 2, 3, 4, 5\) and the longest arithmetic subsequence is the array itself, so the answer is 5.
Input/Output Format: The input is read from standard input and the output is written to standard output.
inputFormat
The input consists of a single integer \(N\) (where \(1 \leq N \leq 10^5\)) given in one line from standard input.
outputFormat
Output a single integer which is the length of the longest arithmetic subsequence in the array of first \(N\) natural numbers.
## sample5
5
</p>