Some sequences of bits (2)

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.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T10:21:21.386Z

© Jutge.org, 2006–2026.
https://jutge.org