#include <bits/stdc++.h>
using namespace std;
int dp[555555];
int a[55];
int n, k;
int main() {
  memset(dp, 0, sizeof(dp));
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  dp[0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 555555; j >= a[i]; j--) dp[j] |= dp[j - a[i]];
  int ans = 0, day = 0;
  while (1) {
    int i, t = ans;
    for (i = ans + k; i > ans; i--) {
      if (dp[i]) {
        ans = i;
        day++;
        break;
      }
    }
    if (t == ans) break;
  }
  cout << ans << " " << day << endl;
  return 0;
}
