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