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