Codeforces Round 167 (Div. 1)
D
Dima and Figure
Codeforces
2400
原题
← CE →
翻译中…

Dima loves making pictures on a piece of squared paper. And yet more than that Dima loves the pictures that depict one of his favorite figures.

翻译中…

A piece of squared paper of size $*n* × *m*$ is represented by a table, consisting of $*n*$ rows and $*m*$ columns. All squares are white on blank squared paper. Dima defines a picture as an image on a blank piece of paper, obtained by painting some squares black.

翻译中…

The picture portrays one of Dima's favorite figures, if the following conditions hold:

翻译中…
  • The picture contains at least one painted cell;
  • All painted cells form a connected set, that is, you can get from any painted cell to any other one (you can move from one cell to a side-adjacent one);
  • The minimum number of moves needed to go from the painted cell at coordinates $(*x*_{1}, *y*_{1})$ to the painted cell at coordinates $(*x*_{2}, *y*_{2})$, moving only through the colored cells, equals $|*x*_{1} - *x*_{2}| + |*y*_{1} - *y*_{2}|$.
翻译中…

Now Dima is wondering: how many paintings are on an $*n* × *m*$ piece of paper, that depict one of his favorite figures? Count this number modulo $1000000007 (10^{9} + 7)$.

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*m*$ — the sizes of the piece of paper $(1 ≤ *n*, *m* ≤ 150)$.

翻译中…

Output

翻译中…

In a single line print the remainder after dividing the answer to the problem by number $1000000007 (10^{9} + 7)$.

翻译中…

样例

Input #1
2 2
Output #1
13
InputCopy OutputCopy
Input #2
3 4
Output #2
571
InputCopy OutputCopy
题目信息
题号
273D
时间限制
3 s
内存限制
256 MB
标签
动态规划

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。