#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, a;
  cin >> n >> m;
  a = n / m;
  cout << m * a * (a - 1) / 2 + a * (n % m) << " " << (n - m + 1) * (n - m) / 2;
  return 0;
}
