CF70A.Cookies

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Fangy collects cookies. Once he decided to take a box and put cookies into it in some way. If we take a square k×kk×k in size, divided into blocks 1×11×1 in size and paint there the main diagonal together with cells, which lie above it, then the painted area will be equal to the area occupied by one cookie kk in size. Fangy also has a box with a square base 2n×2n2^{n}×2^{n} , divided into blocks 1×11×1 in size. In a box the cookies should not overlap, and they should not be turned over or rotated. See cookies of sizes 22 and 44 respectively on the figure:

To stack the cookies the little walrus uses the following algorithm. He takes out of the repository the largest cookie which can fit in some place in the box and puts it there. Everything could be perfect but alas, in the repository the little walrus has infinitely many cookies of size 22 and larger, and there are no cookies of size 11 , therefore, empty cells will remain in the box. Fangy wants to know how many empty cells will be left in the end.

输入格式

The first line contains a single integer nn ( 0<=n<=10000<=n<=1000 ).

输出格式

Print the single number, equal to the number of empty cells in the box. The answer should be printed modulo 106+310^{6}+3 .

输入输出样例

  • 输入#1

    3
    

    输出#1

    9

说明/提示

If the box possesses the base of 23×232^{3}×2^{3} (as in the example), then the cookies will be put there in the following manner:

首页