#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, q, b, c, d, t = 1;
  scanf("%I64d", &n);
  scanf("%I64d", &m);
  b = n / m;
  q = n % m;
  n -= m - 1;
  cout << q * b * (b + 1) / 2 + (m - q) * b * (b - 1) / 2 << " "
       << n * (n - 1) / 2;
}
