The given limits are pretty small, only up to 10 fractions with numerators and denominators in the range [1, 10]. It's to avoid overflow becoming an issue.

Question 1: With the given limits, what is the largest numerator we might end up and what is the largest denominator we might end up?

Question 2: How large could we make the limits so that the numerator and denominator of the result would still fit into 32-bit signed integers? Let's say we use a single limit number n so that up to n fractions were allowed with numerators and denominators in the range [1, n]. How large can we make n?