Some sequences of bits (2) P34343


Statement
 

pdf   zip

Write a program that prints the number of sequences made up of exactly zz zeros and uu ones that do not contain two consecutive zeros nor three consecutive ones.

For instance, there are 8 sequences for z=3z = 3 and u=4u = 4: 010101101011010110101011011010101011010110101101011010100101011 \quad 0101101 \quad 0110101 \quad 0110110 \quad 1010101 \quad 1010110 \quad 1011010 \quad 1101010

Input

Input consists of several pairs of natural numbers zz and uu, each between 0 and 90.

Output

For every pair of zz and uu, print the required number.

Public test cases
  • Input

    0 0
    1 1
    3 4
    65 90
    

    Output

    1
    2
    8
    2529372610666365912
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Official solutions
    C++
    User solutions
    C C++ Python