#include <bits/stdc++.h>
using namespace std;
long long int MAX(long long int a, long long int b) { return a > b ? a : b; }
long long int MIN(long long int a, long long int b) { return a < b ? a : b; }
int main() {
  long long int m, n, i, j;
  scanf("%lld", &n), scanf("%lld", &m);
  long long int min_ans, max_ans;
  if (m > n) {
    min_ans = 0;
    max_ans = 0;
  } else {
    long long int m_temp = m;
    long long int n_temp = n;
    n_temp -= m_temp;
    max_ans = ((n - m + 1) * (n - m)) / 2;
    long long int quo = n / m;
    long long int rem = n % m;
    quo++;
    min_ans =
        rem * ((quo * (quo - 1)) / 2) + (m - rem) * ((quo - 1) * (quo - 2)) / 2;
  }
  cout << min_ans << " " << max_ans << endl;
  return 0;
}
