yukicoder-569

从 Trac 迁移的文章

这是从旧校内 Wiki 迁移的文章,可能存在一些样式问题,您可以向 memset0 反馈。

原文章内容如下:

{{{
#!html
<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
<script type="text/javascript" async src="http://10.71.10.90/sfiction/tool/MathJax/MathJax-master/MathJax.js?config=TeX-MML-AM_CHTML"></script>
<style>
.input, pre {
    display: block;
    padding: 9.5px;
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.42857143;
    color: #333;
    word-break: break-all;
    word-wrap: break-word;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
}
</style>
}}}

== [https://yukicoder.me/problems/no/569 No.569 3 x N グリッドのパスの数] ==

=== Description ===

{{{
#!html
<p>有下面一个$4$行$N+1$列的格点图。</p>

<img src="http://10.71.10.90/zimpha/images/yukicoder-579.png" />

<p>求从左上角走到右下角的简单路径条数$\bmod (10^9+7)$。</p>
}}}

=== Input ===

{{{
#!html
<p class="input">$N$</p>
<p>
$1 \leq N \leq 10^{18}$
</p>
}}}

=== Output ===

{{{
#!html
输出路径条数$\bmod (10^9+7)$。
}}}

=== Sample ===

==== Sample 1 ====
输入
{{{
#!html
<pre>
1
</pre>
}}}
输出
{{{
#!html
<pre>
8
</pre>
}}}

==== Sample 2 ====
输入
{{{
#!html
<pre>
2
</pre>
}}}
输出
{{{
#!html
<pre>
38
</pre>
}}}

==== Sample 3 ====
输入
{{{
#!html
<pre>
100
</pre>
}}}
输出
{{{
#!html
<pre>
244451960
</pre>
}}}

No.569 3 x N グリッドのパスの数

Description

有下面一个$4$行$N+1$列的格点图。

求从左上角走到右下角的简单路径条数$\bmod (10^9+7)$。

Input

$N$

$1 \leq N \leq 10^{18}$

Output

输出路径条数$\bmod (10^9+7)$。

Sample

Sample 1

输入

1

输出

8
Sample 2

输入

2

输出

38
Sample 3

输入

100

输出

244451960