#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, k;
  cin >> n >> k;
  if (k == 1) {
    long long int ans = n * (n - 1) / 2;
    cout << ans << " " << ans << endl;
  } else {
    long long int ans = (n - k + 1) * (n - k) / 2;
    long long int x = n / k;
    long long int y = n % k;
    long long int ans2 = x * (x - 1) / 2;
    long long int ans3 = (x + 1) * x / 2;
    cout << ans3 * y + ans2 * (k - y) << " " << ans << endl;
  }
  return 0;
}
