Objective
Given two rational numbers represented in fractional factoriadic as defined below, add them, and output the result in fractional factoriadic.
Fractional factoriadic
Fractional factoriadic is a numeral system that represents every rational number using \$1/2\$'s place, \$1/6\$'s place, \$1/{24}\$'s place and so on (in general, \$1/{n!}\$'s place for each integer \$n \geq 2\$), with these digits of choice:
- The digit at \$1/2\$'s place may be any integer.
- The digit at \$1/6\$'s place may be \$0\$, \$1\$ or \$2\$.
- The digit at \$1/{24}\$'s place may be \$0\$, \$1\$, \$2\$, or \$3\$.
- The digit at \$1/{120}\$'s place may be \$0\$, \$1\$, \$2\$, \$3\$, or \$4\$.
- Ad infinitum. In general, for every integer \$n \geq 3\$, the digit at \$1/{n!}\$'s place may be from \$0\$ to \$n-1\$ inclusive.
Mathematical remarks
Fractional factoriadic identifies \$\mathbb{Q}\$ as the direct limit of the following inclusion sequence in the category of abelian groups: $$ \langle 1/2 \rangle \to \langle 1/6 \rangle \to \langle 1/{24} \rangle \to \langle 1/{120} \rangle \to \langle 1/{720} \rangle \to \cdots $$
I/O format
It is assumed that the inputted fractions are MSD-first and have no trailing zeros. This applies to the output also.
Examples
Fraction = intermediate representation = fractional factoriadic
0 = 0/2 = []
1 = 2/2 = [2]
2 = 4/2 = [4]
3/2 = 3/2 = [3]
-1/2 = -1/2 = [-1]
1/3 = 2/6 = [0, 2]
1/4 = 1/6 + 2/24 = [0, 1, 2]
2/3 = 1/2 + 1/6 = [1, 1]
3/4 = 1/2 + 1/6 + 2/24 = [1, 1, 2]
1/5 = 1/6 + 4/120 = [0, 1, 0, 4]
-1/4 = -1/2 + 1/6 + 2/24 = [-1, 1, 2]
7/3 = 4/2 + 2/6 = [4, 2]
[] + [] = []
[] + [1] = [1]
[0, 2] + [-1] = [-1, 2]
[0, 2] + [0, 2] = [1, 1]
[0, 1, 2] + [0, 1, 2] = [1]