#P5627. 【AFOI-19】sum与prod

【AFOI-19】sum与prod

Description

Find the value of

$$\sum_{i=1}^{2^{n}}\log_{2}{(\prod_{j = 1}^{i}lowbit(j))}$$

where lowbit(x)lowbit(x) means the result of x&(~x+1).

Input Format

One line containing an integer nn.

Output Format

One line containing one integer, the answer modulo 109+710^9+7.

2

5
5

447

Hint

For the first 20%20\% of the testdata, 1n601 \leq n \leq 60.

For the first 50%50\% of the testdata, 1n1041 \leq n \leq 10^4.

For the full 100%100\% of the testdata, 1n2621 \leq n \leq 2^{62}.

Translated by ChatGPT 5