Frobenius coin problem
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
There are coins of two denominations and respectively. Find the largest sum that cannot be represented with these two denominations (assuming infinite supply of coins) and the total number of such not representable amounts. If such value does not exist, print "NA".
Input
Two positive integer and .
Output
Print in one line two numbers: and .
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 661
Acceptance rate 29%