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