Let's define the recursive function :
Let's define the function S(p, q) as follows:
Given values and , calculate S(p, q).
The input consists of several test cases. Each line contains two non-negative integers and (p \leq q). and are -bit signed integers. The last line contains two negative integers and should not be processed.
For each pair and , output the value of S(p, q) on a single line.
Beispiel 1