#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 10;
int d[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};
int man[105], woman[105];
int main() {
  long long n, m;
  cin >> n >> m;
  long long maxx = 0, minn = 0;
  maxx = n - (m - 1);
  maxx = (maxx - 1) * maxx / 2;
  if (n % m != 0) {
    minn = (n % m) * (n / m);
  }
  minn += m * (n / m - 1) * (n / m) / 2;
  cout << minn << " " << maxx << endl;
  return 0;
}
