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