Note that the memory limit for all tasks in this SRM is 256 MB.
You are given ints A and B.
These determine a set of A*B lines in the plane:
for each pair of integers (a,b) such that 0 <= a < A and 0 <= b < B, there is a line with the equation y=ax+b.
These lines divide the plane into several regions.
(Some of them are finite, some are infinite.)
Compute and return the total number of regions.