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