#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long k = n / m;
  long long d = n - k * m;
  long long t = n - m + 1;
  cout << (d * (k + 1) * k) / 2 + (m - d) * (k * (k - 1)) / 2 << " "
       << t * (t - 1) / 2;
  return 0;
}
