P16299 [Lanqiao Cup 2026 NOI Qualifier Python C Group] Underlying Protocol
Description
In the digital twin system of the industrial metaverse, every physical vibration on the real production line is captured as a stream of data, and is labeled in chronological order with indices $1, 2, 3, \dots, N$, serving as the index for synchronizing the virtual and the real.
To resist system jitter caused by high-frequency data throughput, the system temporarily stores these data in a synchronization buffer pool to wait for processing. However, the underlying protocol defines a strict defensive rule: for any two different indices in the buffer pool, their sum must never be divisible by $2026$. Once violated, the data stream will cause a logic conflict due to spectrum overlap, and all data in the buffer pool will be judged as abnormal by the system and discarded.
Now, please compute, within the range of indices from $1$ to $N$, what is the maximum number of indices that the buffer pool can theoretically hold while satisfying the protocol constraint?
Input Format
One line containing a positive integer $N$.
Output Format
One line containing an integer, representing the maximum capacity of the buffer pool that satisfies the condition.
Explanation/Hint
### Constraints
For $30\%$ of the testdata, $1 \le N \le 2026$.
For $50\%$ of the testdata, $1 \le N \le 10^5$.
For all testdata, $1 \le N \le 10^{18}$.
Translated by ChatGPT 5