Firefly

Time limit1sMemory limit128 MB

Problem

A firefly enters a cave filled with stalagmites and stalactites. The cave is N meters long and H meters high. N is always even. The first obstacle is a stalagmite rising from the floor, and the obstacles then alternate between stalactites hanging from the ceiling and stalagmites rising from the floor.

The cave height is divided into horizontal flight sections numbered 1 through H from bottom to top. A stalagmite of length x blocks sections 1 through x, and a stalactite of length x blocks sections H - x + 1 through H.

The following figure shows a cave of length 14 and height 5.

The firefly does not avoid obstacles. It chooses one flight section and flies straight through it, destroying every obstacle it meets.

In the figure above, if it flies through section 4, it must destroy 8 obstacles.

However, if it flies through section 1 or section 5, it needs to destroy only 7 obstacles.

Given the cave size and the length of every obstacle, find the minimum number of obstacles the firefly must destroy and the number of flight sections that achieve that minimum.

Input

The first line contains N and H. N is always even. (2 <= N <= 200,000, 2 <= H <= 500,000)

Each of the next N lines contains the length of one obstacle, in order from the cave entrance to the exit. The first obstacle is a stalagmite, and the obstacles then alternate between stalactites and stalagmites. Each obstacle length is a positive integer smaller than H.

Output

Print two integers separated by a space: the minimum number of obstacles the firefly must destroy, and the number of flight sections that achieve that minimum.