electicode
HomeCoursesResourcesProblemsNational OlympiadContestsLeaderboard
...

Bee

Time Limit: 1000msMemory Limit: 256MB
View Submissions

Problem Description

Imagine a honeycomb — a field of hexagonal cells with side length NNN. In the upper-left cell AAA there is a bee. In one move it can crawl to the cell down, to the cell down-right, or to the cell up-right (the bee does not crawl up or left). It is required to write a program that finds the number of ways in which the bee can crawl from cell AAA to the opposite cell BBB.

bee.png

Input Format

The first line contains a single number NNN — the size of the hexagonal field (2≤N≤12)(2 \le N \le 12)(2≤N≤12).

Output Format

Output a single integer — the number of ways.

Examples

Example 1
Input
2
Output
11
Example 2
Input
3
Output
291

© 2026 Electicode. All rights reserved.