問題一覧 > 通常問題

No.492 IOI Sequence

レベル : / AI推定難易度 : 1150 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 137
作問者 : square1001 / テスター : e869120
お気に入りにしたユーザー ProblemId : 1283 / 自分の提出
問題文最終更新日: 2026-06-25 03:38:17
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 158 (順位表) の他の問題:

Problem Statement

One day, ltt placed 101st in a contest and narrowly missed out on the prize money.

However, ltt, who is always positive, thought as follows.

"'101'... this stands for IOI. It means I have the ability to go to the IOI!"

So, he defined a sequence called the "IOI sequence" as follows, trying to boost his confidence.

The IOI sequence is the sequence that goes $1, 101, 10101, 1010101, 101010101, 10101010101,\dots$.

He noticed that this sequence satisfies $a_1=1, a_i=100a_{i-1}+1$.

However, he did not know a fast way to solve this, so he decided to ask you, his friend, for help.

An integer $N$ is given. Find the remainder when the Nth term of the IOI numbers is divided by $1000000007$ and the remainder when it is divided by $101010101010101010101$.

Input

$N$

The first line contains an integer $N (1≦N≦10^{18})$.

Output

On the first line, output $a_N$ mod $1000000007$.

On the second line, output $a_N$ mod $101010101010101010101$.

Do not forget the newline at the end.

Sample

Sample 1
Input
3
Output
10101
10101

$a_3=10101$.

Sample 2
Input
7
Output
101003031
1010101010101

$a_7=1010101010101$, and $a_7$ mod $1000000007 = 101003031$.

Sample 3
Input
101
Output
963727330
101

$a_{101}$ mod $101010101010101010101 = 101$.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。