I. Spinnin' On It (Hard)
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

The difference between the versions is the constraint on $$$N$$$.

Although the Red River Rivalry is in Dallas nowadays, Akshaj decided to use the game as motivation to explore the state his new university would (yet again) thrash. While taking a unique route he stumbles upon the Great Prairie Wind Farm. The wind farm contains $$$N$$$ turbines in a row, where the $$$i$$$th turbine has rotation period $$$a_i$$$ seconds.

Akshaj wants to take a picture of these turbines, but he can only do so when they are all aligned in their "neutral" state. A picture is represented by a contiguous subsegment of the turbines, and if Akshaj has to wait longer than $$$T$$$ seconds for alignment he will opt to not take this photograph. Note that at $$$t=0$$$ all of the turbines are aligned at their "neutral" state, but Akshaj must take the photograph at a positive time $$$t \gt 0$$$.

Akshaj wants to make sure he has enough storage, and thus needs to know both how many pictures he can take and their total size. Can you help him out?

Input

The first line contains two integers: $$$N$$$ ($$$1 \le N \le 10^5$$$) and $$$T$$$ ($$$1 \le T \le 10^6$$$), the number of turbines and the max time he will wait. The second line contains $$$N$$$ space-separated integers ($$$1 \le a_i \le 10^5$$$), where $$$a_i$$$ is the rotation period of the $$$i$$$th turbine.

Output

Your output should be two space-separate integers $$$C$$$ and $$$S$$$. $$$C$$$ should be the number of pictures he can take, and $$$S$$$ should be the sum of the lengths of all pictures he can take.

Example
Input
4 3
2 4 1 3
Output
4 5
Note

In the sample test case, the possible pictures he can take (represented by the periods themselves and not the indices) are $$$[2]$$$, $$$[1]$$$, $$$[1,3]$$$, and $$$[3]$$$. The pictures below should help (courtesy of querying Astra with a rough sketch), where the black blade must be pointed directly up to be neutral.

$$$^\dagger$$$Like most things I write, the title of this problem was Kpop-inspired.