#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m, temp, mnn, mxn, mn, mx;
  cin >> n >> m;
  temp = n - m + 1;
  temp = ((temp - 1) * (temp)) / 2;
  mn = n / m;
  mx = mn + 1;
  mxn = n % m;
  mnn = m - mxn;
  cout << (mxn * ((mx - 1) * (mx)) / 2) + (mnn * ((mn - 1) * (mn)) / 2) << ' '
       << temp << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int t = 1;
  while (t--) {
    solve();
  }
}
