#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const long long int inf = 1e18 + 1, mod = 1e9 + 7;
void solve() {
  long long int n, m, x, y, i, ans = 0, ans1 = 0;
  cin >> n >> m;
  ans = ((n / m) + 1);
  ans = (n % m) * (ans * (ans - 1) / 2);
  ans = ans + (m - n % m) * (((n / m) - 1) * (n / m) / 2);
  ans1 = (n - m) * (n - m + 1) / 2;
  cout << ans << " " << ans1 << "\n";
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int32_t main() {
  fast();
  int t = 1;
  while (t--) solve();
  return 0;
}
