#include <bits/stdc++.h>
using namespace std;
long long hit(long long n) { return ((1 + n) * n) / 2; }
int main() {
  long long m, n;
  scanf("%lld%lld", &n, &m);
  long long hasilmin, hasilmax;
  hasilmin = hit(n / m) * (n % m) + hit(n / m - 1) * (m - n % m);
  hasilmax = hit(n - m);
  printf("%lld %lld\n", hasilmin, hasilmax);
  return 0;
}
