#include <bits/stdc++.h>
using namespace std;
const long long int INF = LONG_LONG_MAX;
const long long int NINF = LONG_LONG_MIN;
const long long int mmod = 998244353;
bool isprime[1000009];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int extra = n - (n / m) * m;
  long long int t = m - extra;
  t = (t) * ((n / m) * (n / m - 1) / 2);
  t += (extra) * ((n / m + 1) * (n / m) / 2);
  cout << t << ' ';
  t = n - (m - 1);
  t = t * (t - 1) / 2;
  cout << t << endl;
}
