#include <bits/stdc++.h>
using namespace std;
long long s(long long n) {
  long long k = ((n) * (n - 1)) / 2;
  return k;
}
int main() {
  long long n, p, q, t, m, i, j, k;
  cin >> t >> k;
  p = k;
  q = t / k;
  i = t % k;
  k = k - i;
  m = (k * (s(q))) + (i * (s(q + 1)));
  cout << m << " ";
  cout << ((s(t - p + 1)));
}
