#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, p, avg, c, avgteam, avgfr, xtrateam, xtra, xtrafr, total;
  while (cin >> n >> m) {
    p = n - (m - 1);
    c = p * (p - 1) / 2;
    avg = n / m;
    xtrateam = n % m;
    xtra = avg + 1;
    avgteam = m - xtrateam;
    avgfr = avg * (avg - 1) / 2;
    xtrafr = xtra * (xtra - 1) / 2;
    total = xtrateam * xtrafr + avgteam * avgfr;
    cout << total << " " << c << endl;
  }
  return 0;
}
