C - Ubiquity
Editorial
/


Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 300 点
問題文
長さ N の整数の列 A_1,A_2,\ldots,A_N であって以下の条件をすべて満たすものはいくつありますか。
- 0 \leq A_i \leq 9
- A_i=0 なる i が存在する。
- A_i=9 なる i が存在する。
ただし、答えはとても大きくなる可能性があるので、10^9+7 で割った余りを出力してください。
制約
- 1 \leq N \leq 10^6
- N は整数
入力
入力は以下の形式で標準入力から与えられる。
N
出力
答えを10^9+7 で割った余りを出力せよ。
入力例 1
2
出力例 1
2
数列\{0,9\},\{9,0\}の 2 つが条件をすべて満たします。
入力例 2
1
出力例 2
0
入力例 3
869121
出力例 3
2511445
Score : 300 points
Problem Statement
How many integer sequences A_1,A_2,\ldots,A_N of length N satisfy all of the following conditions?
- 0 \leq A_i \leq 9
- There exists some i such that A_i=0 holds.
- There exists some i such that A_i=9 holds.
The answer can be very large, so output it modulo 10^9 + 7.
Constraints
- 1 \leq N \leq 10^6
- N is an integer.
Input
Input is given from Standard Input in the following format:
N
Output
Print the answer modulo 10^9 + 7.
Sample Input 1
2
Sample Output 1
2
Two sequences \{0,9\} and \{9,0\} satisfy all conditions.
Sample Input 2
1
Sample Output 2
0
Sample Input 3
869121
Sample Output 3
2511445