#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, u;
  cin >> n >> u;
  cout << ceil(float(n - 1) / float(u - 1));
  cout << 1 + ceil(float(n - u) / float(u - 1));
  return 0;
}
