🏡 index : github.com/captn3m0/codechef.git

---
{"category_name":"hard","problem_code":"DMCS","problem_name":"Dai Ma Chu Shi","languages_supported":{"0":"ADA","1":"ASM","2":"BASH","3":"BF","4":"C","5":"C99 strict","6":"CAML","7":"CLOJ","8":"CLPS","9":"CPP 4.3.2","10":"CPP 4.9.2","11":"CPP14","12":"CS2","13":"D","14":"ERL","15":"FORT","16":"FS","17":"GO","18":"HASK","19":"ICK","20":"ICON","21":"JAVA","22":"JS","23":"LISP clisp","24":"LISP sbcl","25":"LUA","26":"NEM","27":"NICE","28":"NODEJS","29":"PAS fpc","30":"PAS gpc","31":"PERL","32":"PERL6","33":"PHP","34":"PIKE","35":"PRLG","36":"PYPY","37":"PYTH","38":"PYTH 3.4","39":"RUBY","40":"SCALA","41":"SCM chicken","42":"SCM guile","43":"SCM qobi","44":"ST","45":"TCL","46":"TEXT","47":"WSPC"},"max_timelimit":8,"source_sizelimit":50000,"problem_author":"wwwwodddd","problem_tester":"mgch","date_added":"2-12-2015","tags":{"0":"gauss","1":"hard","2":"jan16","3":"recurrence","4":"wwwwodddd"},"editorial_url":"http://discuss.codechef.com/problems/DMCS","time":{"view_start_date":1452504600,"submit_start_date":1452504600,"visible_start_date":1452504600,"end_date":1735669800},"layout":"problem"}
---
<span class="solution-visible-txt">All submissions for this problem are available.</span><h3> Read problems statements in <a target="_blank" href="http://www.codechef.com/download/translated/JAN16/mandarin/DMCS.pdf">Mandarin Chinese</a>, <a target="_blank" href="http://www.codechef.com/download/translated/JAN16/russian/DMCS.pdf">Russian</a> and <a target="_blank" href="http://www.codechef.com/download/translated/JAN16/vietnamese/DMCS.pdf">Vietnamese</a> as well.</h3>
<p>Dai Ma Chu Shi is a Chinese CodeChef.</p>
<p>He recently got a huge chocolate with the size <b>2 × 2 × 2 × 2 × n</b>. (Yes, in five-dimensional space).<br />
He wants to cut it into <b>8n</b> pieces of small chocolate of size <b>1 × 1 × 1 × 1 × 2</b> each. Please notice that the direction doesn't matter, <b>1 × 1 × 1 × 2 × 1</b> and <b>2 × 1 × 1 × 1 × 1 </b> are acceptable.
</p>
<p>He wants to know how many ways he can achieve this feat in. Because the answer is very large, please tell him the answer modulo 10<sup>9</sup>+7.</p>
<h3>Input</h3>
<p>First line of input contain a single integer <b>T</b>, the number of test cases. <b>T</b> tests follow. Each test case contain a single integer <b>n</b>.</p>
<h3>Output</h3>
<p>For each test case output a single line containing the answer for the problem modulo 10<sup>9</sup>+7.</p>
<h3>Constraints</h3>
<ul>
<li><b>1</b>  <b>T</b>  <b>1000</b></li>
<li><b>1</b>  <b>n</b>  <b>10<sup>9</sup></b></li>
<li><b>Subtask 1 (30 points)</b>, <b>n</b> is a power of <b>2</b>.</li>
<li><b>Subtask 2 (70 points)</b>, Original constraints</li>
</ul>
<h3>Example</h3>
<pre><b>Input:</b>
1
1

<b>Output:</b>
272
</pre><h3>Explanation</h3>
<p>I have discovered a truly marvellous enumeration of this, which this margin is too narrow to contain.</p>