Problem Description
source:https://uva.onlinejudge.org/external/8/834.html
Let b0, b1, b2, . . . , bn be integers with bk > 0 for k > 0. The continued fraction of order n with coeficients b1, b2, . . . , bn and the initial term b0 is defined by the following expression
which can be abbreviated as [b0; b1, . . . , bn]. An example of a continued fraction of order n = 3 is [2; 3, 1, 4]. This is equivalent to
source:https://uva.onlinejudge.org/external/8/834.html
Let b0, b1, b2, . . . , bn be integers with bk > 0 for k > 0. The continued fraction of order n with coeficients b1, b2, . . . , bn and the initial term b0 is defined by the following expression
which can be abbreviated as [b0; b1, . . . , bn]. An example of a continued fraction of order n = 3 is [2; 3, 1, 4]. This is equivalent to