2018-11-10 01:00 AKST

Bergen Open 2018


2018-11-10 06:00 AKST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -907 days 16:48:37

Time elapsed


Time remaining


Problem J
Joint Attack

General Torstein has sent the $x$-coordinate for the next joint attack and is expecting you to promptly follow his orders in order to avoid impeding doom. Unfortunately Torstein hates numbers with more than 2 digits and loves horizontal line segments, and has therefore sent the coordinate as a continued fraction, i.e.

\[ x = x_0 + {1 \over {x_1 + {1 \over {\ldots }}}} \]

Your rocket launcher only accepts coordinates as reduced fractions, so you need to quickly compute the correct numbers to feed it in order to commence the attack. Hurry! Failure may have dire consequences!


The first line of output is one integer $n$ ($1 \leq n < 40$), the number of coefficients in the continued fraction, followed by a line with $n$ integers ($1\leq x_ i < 100$) the coefficients of $x$.


The coordinate $x$ as a reduced fraction. It is guaranteed that the numerator and denominator are both less than $10^{18}$.

Sample Input 1 Sample Output 1
2 3