#include <bits/stdc++.h>
template <class T>
inline bool rd(T &ret) {
  char c;
  int sgn;
  if (c = getchar(), c == EOF) return 0;
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  sgn = (c == '-') ? -1 : 1;
  ret = (c == '-') ? 0 : (c - '0');
  while (c = getchar(), c >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  ret *= sgn;
  return 1;
}
template <class T>
inline void pt(T x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) pt(x / 10);
  putchar(x % 10 + '0');
}
using namespace std;
long long n, m;
long long go(long long x) { return (x * (x - 1)) / 2; }
int main() {
  while (cin >> n >> m) {
    long long a = 0;
    long long c = n % m;
    a = c * go(n / m + 1);
    a += (n - c * (n / m + 1)) / (n / m) * go(n / m);
    long long b = go(n - m + 1);
    cout << a << " " << b << endl;
  }
  return 0;
}
