You are given an integer array of size . You are also given queries. In each query, you are given three integers , , and respectively.
You are required to determine the length of the largest contiguous segment in the indices range of that forms an arithmetic progression with a common difference of .
Note: The segment whose length is always forms an arithmetic progression of a common difference .
Input format
Output format
Print lines representing the answer such as the line denotes the answer for the query.
Constraints
For the first query, [1,2,3] forms an AP with difference 1.
For the second query, [5] forms an AP.