# the maximal value the total number（数论）

Now given two kinds of coins A and B,which satisfy that GCD(A,B)=1.Here you can assume that there are enough coins for both kinds.Please calculate the maximal value that you cannot pay and the total number that you cannot pay.
InputThe input will consist of a series of pairs of integers A and B, separated by a space, one pair of integers per line.

OutputFor each pair of input integers A and B you should output the the maximal value that you cannot pay and the total number that you cannot pay, and with one line of output for each line in input.
Sample Input
2 3
3 4
Sample Output
1 1
5 3

#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int a,b;
while(~scanf("%d%d" ,&a,&b))
{
cout<<a*b-(a+b)<<" "<<(a-1)*(b-1)/2<<endl;
}
return 0;
}

06-17 712

02-22 208

06-16 889

07-06 520

05-17 573

05-20 1万+

12-19 47

04-05 34

09-23 14

08-28 1352

05-17 27

05-07 35

10-21 5084

03-19 83万+

04-14 62万+

03-13 16万+

03-01 14万+

03-08 5万+

#### 上班一个月，后悔当初着急入职的选择了

©️2019 CSDN 皮肤主题: 1024 设计师: 上身试试