#include <iostream>
#define FAST_IO() \
{\
ios::sync_with_stdio(false);\
cin.tie(NULL); \
cout.tie(NULL); \
}\
using namespace std;
int main()
{
FAST_IO();
int arr[250000]{0};
int n, x;
cin >> n >> x;
for (int i = 1; i <= n; i++)
{
int num;
cin >> num;
arr[i] = arr[i - 1] + num;
}
int ans = 0, cnt = 0;
for (int i = x; i <= n; i++)
{
int tmp = arr[i] - arr[i - x];
if (ans < tmp)
{
ans = tmp;
cnt = 1;
}
else if (ans == tmp)
cnt++;
}
if (ans > 0)
cout << ans << "\n" << cnt;
else
cout << "SAD";
return 0;
}