const maxh = 500000;
var n,h,i,a,min,smin:longint;
f: array[1..maxh] of longint;
begin
readln(n,h);
for i:=1 to h do
f[i]:=0;
for i:=1 to n do
begin
readln(a);
if i mod 2 = 1 then
begin
inc(f[1]);
dec(f[a+1]);
end
else
if i mod 2 = 0 then
begin
inc(f[h-a+1]);
dec(f[h+1]);
end;
end;
min:=f[1];
smin:=1;
for i:=2 to h do
begin
f[i]:=f[i]+f[i-1];
if f[i]=min then
begin
inc(smin);
end
else if f[i]<min then
begin
min:=f[i];
smin:=1;
end;
end;
writeln(min,' ',smin);
end.
Y29uc3QgbWF4aCA9IDUwMDAwMDsKdmFyIG4saCxpLGEsbWluLHNtaW46bG9uZ2ludDsKICAgIGY6IGFycmF5WzEuLm1heGhdIG9mIGxvbmdpbnQ7CmJlZ2luCiAgcmVhZGxuKG4saCk7CiAgZm9yIGk6PTEgdG8gaCBkbwogIGZbaV06PTA7CiAgZm9yIGk6PTEgdG8gbiBkbwogIGJlZ2luCiAgICByZWFkbG4oYSk7CiAgICBpZiBpIG1vZCAyID0gMSB0aGVuCiAgICBiZWdpbgogICAgICBpbmMoZlsxXSk7CiAgICAgIGRlYyhmW2ErMV0pOwogICAgZW5kCiAgICBlbHNlCiAgICBpZiBpIG1vZCAyID0gMCB0aGVuCiAgICBiZWdpbgogICAgICBpbmMoZltoLWErMV0pOwogICAgICBkZWMoZltoKzFdKTsKICAgIGVuZDsKICBlbmQ7CiAgbWluOj1mWzFdOwogIHNtaW46PTE7CiAgZm9yIGk6PTIgdG8gaCBkbwogIGJlZ2luCiAgICBmW2ldOj1mW2ldK2ZbaS0xXTsKICAgIGlmIGZbaV09bWluIHRoZW4gCiAgICBiZWdpbgogICAgICBpbmMoc21pbik7CiAgICBlbmQKICAgIGVsc2UgaWYgZltpXTxtaW4gdGhlbgogICAgYmVnaW4KICAgICAgbWluOj1mW2ldOwogICAgICBzbWluOj0xOwogICAgZW5kOwogIGVuZDsKICB3cml0ZWxuKG1pbiwnICcsc21pbik7CmVuZC4KICA=