Spiral Recurrence Relation
Description
Spiral recurrence relation, which is simply two interleaving regular recurrence relations. For this assignment, you are asked to implement a program that evaluates a spiral recurrence relation of the form.
$x_n = ax_{n-1} + bx_{n-1} + cx_n$
$y_n = d(e - y_{n-1}) + fy_{n-1}$
Requirement: Please use recursion to solve this problem. All other methods will NOT pass TA's demo, you bet.
Input
Six integers representing coefficients a, b, c, d, e, and f, ranging from -20 to 20.
Two more integers representing two initial terms (namely $x_0$, $y_0$), ranging from -20 to 20.
Two more integers representing which terms in the respective sequence to output (i, j for $x_i$, $y_j$), ranging from 0 to 20.
Output
The correct answer for $x_i$ and $y_j$, separated by a single space.
Sample Input 1
1 1 1 1 1 1
1 2
6 6
Sample Input 2
11 5 20 13 32 5
0 0
1 2
Sample Input 3
20 20 20 20 20 20
20 20
20 20
Sample Output 1
36 11
Sample Output 2
1 2
Sample Output 3
149232642064267904 -215302842381157376