#include <bits/stdc++.h>
int main() {
  long long int n, m, a, b;
  scanf("%I64d %I64d", &n, &m);
  b = n - m + 1;
  b = b * (b - 1) / 2;
  a = (m * (n / m) * ((n / m) - 1) / 2) + (n % m) * (n / m);
  printf("%I64d %I64d", a, b);
}
