Subsequence#2020

Subsequence

1 second
128 megabytes
Medium

A sequence a_n of integers consists of elements. For a given number , find a non-empty subsequence a_i, a_{i+1}, \ldots, a_{i+m} of consecutive elements of the sequence a_n, such that the sum of its elements is as close as possible to .

Input

The first line contains two integers and (1 \le n \le 500\,000, -10^9 \le k \le 10^9) — the number of elements in the sequence and the desired sum.

The second line contains integers a_i (-10^9 \le a_i \le 10^9) — the elements of the sequence.

Output

Print one number |k - l| (the absolute difference between and ), where is the sum of the optimal segment of the sequence.

Examples

Example 1

Loading
Loading