#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long int n, m, p, xx, md, zz, ans = 0;
  cin >> n >> m;
  xx = n / m;
  md = n % m;
  p = xx + 1;
  p = p * (p - 1) / 2;
  p = p * md;
  if (xx > 1) {
    zz = m - md;
    ans = xx * (xx - 1) / 2;
    ans = ans * zz;
  }
  ans += p;
  cout << ans << " ";
  long long pp = n - m + 1;
  ans = pp * (pp - 1) / 2;
  cout << ans << endl;
  return 0;
}
