Futures Market Trends

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Fedor wants to earn some extra money out of oil futures. His analysis is based on trends and historical data of dd previous days.

A cost sequence of at least three distinct days c_0,c_1,c_2,,c_nc\_0, c\_1, c\_2, \cdots, c\_n forms a trend of power PP if average cost change is at least PP times bigger than the standard deviation of cost changes.

Formally, average cost change is A=1n_i=1n(c_ic_i1)A = \frac{1}{n}\sum\limits\_{i=1}^n \left(c\_i - c\_{i-1}\right). The standard deviation of cost changes is D=1n_i=1n(c_ic_i1A)2D = \sqrt{\frac{1}{n}\sum\limits\_{i=1}^n{\left(c\_i - c\_{i-1} - A\right)^2}}. The sequence forms a positive trend of power PP if ADP\frac{A}{D} \ge P, and a negative trend of power PP if ADP\frac{A}{D} \le -P

We assume that if A>0A > 0 and D=0D = 0 then a positive trend of any power is formed. Similarly, if A<0A < 0 and D=0D = 0 then a negative trend of any power is formed. If A=0A = 0 then no trend is formed, even if D=0D = 0.  

To check his theory, Fedor needs to count the number of subsegments of historical data which form positive and negative trends of the given power. Can you help him?

입력

The first line contains an integer dd (3d3,0003 \le d \le 3\\,000) and a real number PP (0.001P10000.001 \le P \le 1000) --- the number of days in Fedor's historical data and the required trend power. PP is given with at most 9 digits after the decimal point.  

The next line contains dd integers c_1,c_2,,c_dc\_1, c\_2, \ldots, c\_d (1000c_i1000-1000 \le c\_i \le 1000). For each ii, c_ic\_i is the cost of oil futures at the end of the ii-th day.

출력

Print two integers --- the number of subsegments of historical data forming a positive and a negative trend of power PP, respectively. It's guaranteed that the answer would not change if one changes PP by no more than 10810^{-8}.

힌트

The third example test case demonstrates the real prices of oil futures in April 2020 (in dollars, multiplied by 10 and rounded). Be careful with theories like the one Fedor made.