#include <bits/stdc++.h>
using namespace std;
long long get(long long x) { return (x * (x - 1)) / 2; }
int main(int argc, char const *argv[]) {
  long long n, m;
  cin >> n >> m;
  long long kmax = get(n - m + 1), kmin;
  if (n % m == 0)
    kmin = get(n / m) * m;
  else
    kmin = get(n / m) * (m - n % m) + get(n / m + 1) * (n % m);
  cout << kmin << ' ' << kmax;
  return 0;
}
