#P3468. 滑雪

滑雪

题目描述

v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);}

<![endif]-->

</p>

<w:WordDocument>

<w:View>Normal</w:View>

<w:Zoom>0</w:Zoom>

<w:PunctuationKerning />

<w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>

<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>

<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>

<w:ValidateAgainstSchemas />

<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>

<w:IgnoreMixedContent>false</w:IgnoreMixedContent>

<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>

<w:Compatibility>

<w:SpaceForUL />

<w:BalanceSingleByteDoubleByteWidth />

<w:DoNotLeaveBackslashAlone />

<w:ULTrailSpace />

<w:DoNotExpandShiftReturn />

<w:AdjustLineHeightInTable />

<w:BreakWrappedTables />

<w:SnapToGridInCell />

<w:WrapTextWithPunct />

<w:UseAsianBreakRules />

<w:DontGrowAutofit />

<w:UseFELayout />

</w:Compatibility>

<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>

</w:WordDocument>

<![endif]--><!--[if gte mso 9]>

<w:LatentStyles DefLockedState="false" LatentStyleCount="156">

</w:LatentStyles>

<![endif]--><!--[if gte mso 10]>

/* Style Definitions */ table.MsoNormalTable {mso-style-name:普通表格; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;}

<![endif]-->

</p>

陶陶最近迷上了滑雪,这天他来到了滑雪场。滑雪场可以看做N*M 的方格区域,每个格子有一个高度,陶陶可以选择任意一个格子作为起点,然后每次可以滑到相邻的某个格子,但要满足经过格子的高度严格递减,同时陶陶可以随时停下来,途中滑的次数就为这条滑雪路径的长度,例如经过了3个格子,路径长度为就为2。有一点需要注意,陶陶不能够停在原地,也就是说路径的长度一定是正整数。

这样的话,陶陶就有很多很多种路径选择,但能发现不可能有无限种路径供陶陶选择,然后陶陶就想知道所有可能路径长度的0K次方之和为多少。由于答案可能会很大,你只需要输出每个答案Mod 12345后的值。

 

输入格式

N+1行。

第一行包含三个正整数N,M,K

接下来有N行,每行包含M个不超过10^9的正整数,依次表示每个格子的高度。

 

输出格式

K+1行,每行包含一个非负整数,第i行的整数表示所有可能路径长度的i-1 次方之和Mod 12345后的值。

3 4 3
1 2 3 4
4 3 2 1
1 2 3 4
38
66
136
318

数据范围与约定

<w:WordDocument>

<w:View>Normal</w:View>

<w:Zoom>0</w:Zoom>

<w:PunctuationKerning />

<w:DrawingGridVerticalSpacing>7.8 磅</w:DrawingGridVerticalSpacing>

<w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>

<w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery>

<w:ValidateAgainstSchemas />

<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>

<w:IgnoreMixedContent>false</w:IgnoreMixedContent>

<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>

<w:Compatibility>

<w:SpaceForUL />

<w:BalanceSingleByteDoubleByteWidth />

<w:DoNotLeaveBackslashAlone />

<w:ULTrailSpace />

<w:DoNotExpandShiftReturn />

<w:AdjustLineHeightInTable />

<w:BreakWrappedTables />

<w:SnapToGridInCell />

<w:WrapTextWithPunct />

<w:UseAsianBreakRules />

<w:DontGrowAutofit />

<w:UseFELayout />

</w:Compatibility>

<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>

</w:WordDocument>

<![endif]-->


<w:LatentStyles DefLockedState="false" LatentStyleCount="156">

</w:LatentStyles>

<![endif]--><!--[if gte mso 10]>


/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}

<![endif]-->

<p align="left" style="text-align:left;text-indent:21.25pt;<br />

mso-char-indent-count:1.77" class="MsoNormal">N<span style="font-size:12.0pt;font-family:宋体;mso-ascii-font-family:Calibri;

mso-hansi-font-family:Calibri">,</span>M<=300,K<=200


</p>