The number of times that "A" is printed in code segment I is equal to m * n, while the number of times that "B" is printed in code segment II is equal to (m - 1) * n.
Therefore, the number of times that "A" is printed is equal to the number of times that "B" is printed if and only if m * n = (m - 1) * n, which simplifies to m = 1.
In other words, if m is equal to 1, then the two code segments will print the same number of "A"s and "B"s. If m is greater than 1, then code segment I will print more "A"s than code segment II will print "B"s. If m is less than 1, then code segment II will print more "B"s than code segment I will print "A"s.