#include <bits/stdc++.h>
using namespace std;
const int MX = (1 << 20), INF = (1 << 31) - 1;
int bit[MX], n, lim;
bool dp[MX];
void update(int x, int V) {
  while (x > 0) {
    bit[x] = min(bit[x], V);
    x -= x & (-x);
  }
}
int get(int x) {
  if (x == 0) return 0;
  int res = INF;
  while (x <= lim) {
    res = min(res, bit[x]);
    x += x & (-x);
  }
  return res;
}
int arr[100], bfs[MX], K;
int main() {
  cin >> n >> K;
  for (int j = 1; j <= n; j++) {
    cin >> arr[j];
    lim += arr[j];
  }
  dp[0] = 1;
  for (int j = 1; j <= lim; j++) bit[j] = INF;
  for (int j = 1; j <= n; j++)
    for (int i = lim; i >= arr[j]; i--) dp[i] |= dp[i - arr[j]];
  int maxy = 0, days = 0;
  for (int j = 1; j <= lim; j++) {
    if (!dp[j]) continue;
    int prev = max(0, j - K);
    bfs[j] = get(prev);
    if (bfs[j] == INF) break;
    ++bfs[j];
    update(j, bfs[j]);
    maxy = j;
    days = bfs[j];
  }
  cout << maxy << ' ' << days << endl;
}
