#include <bits/stdc++.h>
using namespace std;
const long long Max = 1e5 + 10;
const int Mod = 1e9 + 7;
long long v[36][Max];
int main() {
  (ios_base::sync_with_stdio(false), cin.tie(NULL));
  ;
  long long n, m;
  cin >> n >> m;
  long long b = n / m;
  long long mx = ((n - m) * (n - m + 1)) / 2;
  long long mn = ((m * b * (b - 1)) / 2) + (b * (n % m));
  cout << mn << " " << mx << endl;
}
