#include <bits/stdc++.h>
using namespace std;
int N, D;
int val[60];
int dp[10010 * 60];
int main() {
  int i, j;
  cin >> N >> D;
  int sum = 0;
  dp[0] = 1;
  for (i = 0; i < N; i++) {
    cin >> val[i];
    sum += val[i];
    for (j = sum; j >= val[i]; j--) {
      if (dp[j - val[i]]) {
        dp[j] = 1;
      }
    }
  }
  int day, ans;
  day = ans = 0;
  while (true) {
    for (i = D; i > 0; i--) {
      if (dp[ans + i]) {
        ans += i;
        day++;
        break;
      }
    }
    if (i == 0) {
      break;
    }
  }
  cout << ans << " " << day << endl;
}
