#P1762. 偶数

    ID: 721 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>数学高精度递归扩展欧几里德,扩欧

偶数

Description

Given a positive integer nn, please output the number of even entries in the first nn rows of Pascal's triangle modulo 10000031000003.

Input Format

One line with a positive integer nn.

Output Format

One line with an integer denoting the answer.

6

6

Hint

For 30%30\% of the testdata, n4×103n \le 4 \times 10^3.

For 70%70\% of the testdata, n4×109n \le 4 \times 10^9.

For 100%100\% of the testdata, 1n10151 \le n \le 10^{15}.

The first seven rows of Pascal's triangle:

       1
      1 1
     1 2 1
    1 3 3 1
   1 4 6 4 1
 1 5 10 10 5 1
1 6 15 20 15 6 1

Translated by ChatGPT 5