#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, m;
  cin >> n >> m;
  long long maxNo = n - m + 1;
  long long kmax = (maxNo * (maxNo - 1)) / 2;
  long long other1 = n / m;
  long long other2 = n % m;
  long long ans1 = (other1 * (other1 - 1)) / 2;
  long long ans2 = ((other1 + 1) * other1) / 2;
  long long kmin = ans1 * (m - other2) + (ans2 * other2);
  cout << kmin << " " << kmax << "\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while ((T--) > 0) {
    solve();
  }
  return 0;
}
