A New Change Problem

题目链接

/*
给定两个互质的数,a,b,求这两个数不能表示的数的最大值和个数。
最大值=a*b-a-b;
个数  =(a-1)*(b-1)/2;
*/
#include <set>
#include <map>
#include <cmath>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
typedef long long  LL;
using namespace std;
int n,m;
int main ()
{
    while(~scanf("%d%d",&n,&m))
    {
        printf("%d %d\n",n*m-n-m,(n-1)*(m-1)/2);
    }
    return 0;
}
posted @ 2016-08-10 14:43  _Mickey  阅读(108)  评论(0编辑  收藏  举报