Sodium Intake


Submit solution

Points: 1
Time limit: 1.5s
Memory limit: 256M

Problem type
Allowed languages
C, C++, Java, Python

Kate wants to eat another bag of sea salt chips, but has been told by her doctor to watch her sodium intake! To make sure that she does, Kate assigns a sodium value to each chip, that way she can make sure that she eats the recommended amount. However, Kate knows that good things come in multiples, so eating any multiple of the recommended amount is A-Ok with her!

Help Kate find the longest contiguous subsequence of chips that she can eat, given the sodium values of each chip, and the recommended sodium intake by her doctor!

Input

The first line contains two integers n and k (1 \leq n \leq 10^6, 1 \leq k \leq 10^9), representing the number of chips in the bag and the recommended daily intake of sodium.

The next line contains n space-separated integers c_1,\ \dots,\ c_n (1 \leq c_i \leq 10^9), representing the sodium content of each of the n chips.

Output

Output a single integer - the length of the longest contiguous subsequence of chips where the sum of sodium contents is a multiple of the recommended sodium intake. If no non-empty contiguous subsequence satisfies this, output 0.

Example

Input 1
5 4
9 3 1 4 2
Output 1
3

3 + 1 + 4 = 8, which is a multiple of the recommended intake, 4. It is provable this is the longest such contiguous subsequence where this is the case.

Input 2
6 5
3 5 10 1 4 2
Output 2
6

Comments

There are no comments at the moment.