#include <bits/stdc++.h>
const double eps = 1e-7, PI = 3.1415926;
const int N = 5e5;
using namespace std;
long long n, m, k, x, y, a[N], mx = -1, mn = 1e9, sum;
char c[N];
string s, s1, s2;
map<int, int> mp;
vector<string> vec;
int main() {
  scanf("%lld", &n);
  scanf("%lld", &m);
  cout << (n % m) * ((n / m + 1) * (n / m) / 2) +
              (m - (n % m)) * ((n / m) * (n / m - 1) / 2)
       << " " << (n - (m - 1)) * (n - (m - 1) - 1) / 2 << endl;
  return 0;
}
