#include <bits/stdc++.h> #define ll long long using namespace std; int main() { ll a,b; while(cin>>a>>b){ cout<<a*b-a-b<<" "<<(a-1)*(b-1)/2<<' '; } return 0; }