#include <bits/stdc++.h>
using namespace std;
long long const inf = 1 << 28;
double const pi = acos(-1);
long long nc2(long long n) { return n * (n - 1) / 2; }
int main() {
  long long n;
  while (cin >> n) {
    long long m;
    cin >> m;
    long long ax = (m - n % m) * nc2(n / m) + (n % m) * nc2(n / m + 1);
    long long y = n - m + 1;
    long long ay = nc2(y);
    cout << ax << " " << ay << endl;
  }
}
