eolymp
bolt
Try our new interface for solving problems
Problems

Industrious bees

Industrious bees

\includegraphics{https://static.e-olymp.com/content/c7/c72d07e8aee2549af24f776e230e3edd9858ab6d.jpg} It is not a secret, that bees are most hard-working in the world. Some of bees look after the collected honey. Such rules were set in our beehive. Every bee had its working territory which depended from its grade. The bee of the first grade had territory of the \textbf{1} cell (hexagon), \textbf{2}th -- \textbf{7} cells (one cell and yet \textbf{6} cells round it), third grade -- \textbf{19} cells -- one cell + \textbf{6} cells around it + yet \textbf{12} cells around them. Consequently the bee of к grade had a figure formed from hexagons, with a radius \textbf{K} -- hexagons. The numeration of cells begins with left inferior cells, and occurs in direction of left inferior side by rows (see a picture). A bee moved from the cells with number 1 to the cell with number N for the care of every cells, but each time she moved by another way because she wanted to control other cells. A bee decided to move in one of the three directions: upward, right-upward and right-downward because she wanted to get from the first cell to cell with number N. From how many methods can a bee with the grade \textbf{K} get from cell with number \textbf{1} to the cells with number \textbf{N}. \InputFile There are two numbers\textbf{ K} -- grade of bee, and number of cell, in which it is needed to be a bee in the one line. \textbf{1 }≤\textbf{ K }≤\textbf{ 14} \OutputFile There is a one number. It is a quantity of methods.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2 7
Output example #1
11