Problem:


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



Sample input:
2


Sample output:
2

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)
N = int(input())
p = 10**9+7
ans = 0

nCr = {}
def cmb(n, r, p):
    if r == 0 or r == n: return 1
    if r == 1: return n%p
    if (n,r) in nCr: return nCr[(n,r)]%p
    nCr[(n,r)] = (cmb(n-1,r, p) + cmb(n-1,r-1, p))%p
    return nCr[(n,r)]

sl = [1]
egtl = [1]

for i in range(N):
    sl.append(2*sl[i]%p)
    egtl.append(8*egtl[i]%p)

i = 0
j = N
while j>=2:
    if i != 0:
        ans += cmb(j+1,i,p)*(sl[j]-2)*egtl[i]
    else: 
        ans += 1*(sl[j]-2)*egtl[i]
    i+=1
    j-=1
print(ans)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

def P(x):
    if x == 0:
        return 1
    return x * P(x - 1)
    
N = int(input())

if N == 1:
    print(0)
else:
    print(P(N) * 9**(N-2))

Submission status: Runtime Error

Solution code:
from scipy.special import perm
n = int(input())
def re_factorial(n):
    if n < 2:
        return 1
    return n * re_factorial(n-1)
mas = n-2 # 0と9は必ず使う
#print(perm(n, 2))
if mas == 0:
  print(2)
elif n == 0:
  print(1)
else:
  #res = (permutations_count(n, 2) * 10^mas)%(10^9 + 7)
  res = (re_factorial(n) * int(perm(n, 2)) * 10**mas) %1000000007
  print(int(res))

Submission status: Runtime Error

Solution code:
def func(a):
    if (a==1):
        return 0
    else:
        return func(a-1)+a
N=int(input())

S=10**9+7
if N==1:
    z=0
elif N==2:
    z=2
else:
    z=((10**(N-2) *N*2) - (10**(N-3) * ((6+func(N-2))))) %S
print(z)

Submission status: Runtime Error

Solution code:
mod =10**9 + 7
N=int(input())
a=10**N
b=a*((8/10)**N)
print(int(a-b)/mod)

Submission status: Runtime Error

Solution code:
import math
def combinations_count(N, r):
    return math.factorial(N) // (math.factorial(N - r) * math.factorial(r))
 
# 整数の入力
N = int(input())
r = 2

print(combinations_count(N, r))

Submission status: Runtime Error

Solution code:
n=int(input())
def solve(n):
    if n==1:
        return 1
    return n*solve(n-1)
mod = 10 ** 9 + 7
if n==1:
    print(0)
elif n==2:
    print(2)
else:
    x=(10*(n-2)*solve(n))%mod
    print(x)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(1000000)

def factorial(n):
    if n <= 0:
        return 1
    if n == 1:
        return n
    return n * factorial(n-1)

s = int(input())
ans = (s * (s - 1)) * factorial(s - 2)
ans %= 1000000007
print(ans)

Submission status: Runtime Error

Solution code:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n = int(input())



a = cmb(n,2)*2
b = (8**(n-2))
d = (2**n) -2

print((a*b+d)%1000000007)

Submission status: Runtime Error

Solution code:
def combinations_count(N, r):
    return math.factorial(N) // (math.factorial(N - r) * math.factorial(r))

# 整数の入力
N = int(input())
r = 2

print(combinations_count(N, r) * 10**(N-r) % (10**9 +7))

Submission status: Runtime Error

Solution code:
S = input()
L = int(S)
D = L-2
A = int(D)
G = L-1
Z = int(G)
B = L-3
V = int(B)

if L==0:
    print(0)

elif L==1:
    print(0)

elif L==2:
    print(2)

elif L>=3:
    print((10*A*Z+8*U+10*B)%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
N = int(input())
if N>2:
	print((math.factrial(N)*10)%(10**9+7))
else:
  print(N)

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
MOD = 1000000007
if N==1 or N==0:
    ans=0

elif N==2:
    ans =2

else:
    ans = (  ( N*(N-1) ) %MOD  ) * (  (  10**(N-2) - (N-2)*(N-3)/2   )%MOD)
    ans = ans % MOD

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math

result = 0

def meso(x):
    #print("x = ",x)
    y = 0

    kurikaeshi = (math.floor(x / 2) - 3) + 1
    #print("loop=" ,kurikaeshi)

    for i in range(kurikaeshi):
        icode = i + 3
        #print("icode=", icode)

        if icode >= 6 or x - icode >= 6:
            #print("saiki_1", y)
            y += meso(icode) * 2
            #print("saiki_2", y)
            y += meso(x - icode) * 2
            #print("saiki_end", y)

        else:
            y += 1*2

            #y = 1

        #print("icode=", icode, "y=", y)
        #total += y

    if x >= 3:
        y += 1
    #print("y = ", y)
    return y

total = 0
user1 = int(input())
result = meso( user1 )

print(result)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
print(math.factrial(N)%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
N = int(input())

all = 0
for i in range(2, N//2+1):
    basyo = combinations_count(N, i)  # iとN-iの時、値が同じ

    zero_iti  = 2 ** (3 * N - 2 * i - 1)  # i=iの時
    zero_iti2 = 2 ** (N + 2 * i - 1)      # i=N-iの時

    all += basyo * (zero_iti + zero_iti2)

if S % 2 == 0:  # i = Nが無いので足す
    basyo = combinations_count(N, N)
    zero_iti = 2 ** (N - 1)
    all += basyo * zero_iti

if S % 2 == 1:  # i = N-1も無いので足す
    basyo = combinations_count(N, N)
    zero_iti = 2 ** (N - 1)
    all += basyo * zero_iti

    basyo = combinations_count(N, N - 1)
    zero_iti = 2 ** (N - 2)
    all += basyo * zero_iti

print(int(all % (10**9+7)))

Submission status: Runtime Error

Solution code:
from scipy.special import perm
n = int(input())
def re_factorial(n):
    if n < 2:
        return 1
    return n * re_factorial(n-1)
mas = n-2 # 0と9は必ず使う
#print(perm(n, 2))
if mas == 0:
  print(2)
elif n == 0:
  print(1)
else:
  #res = (permutations_count(n, 2) * 10^mas)%(10^9 + 7)
  res = (re_factorial(n) * int(perm(n, 2)) * 10^mas) %(10^9 + 7)
  print(int(res))

Submission status: Runtime Error

Solution code:
n = int(input())
num = 0
x = n#0,9が置かれる場所
y = 0#0,9の選び方
z = 8 * (n - 1)#それ以外の選び方
for i in range(2,n + 1):#0,9の個数
    x * (n - i + 1) // i
    y = (y + 2) * 2 - 2
    z = z // 8 
    num += ((x % (10 ** 9 + 7)) * ((y * z) % (10 ** 9 + 7))
print(num % (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
import math
# import statistics
import itertools
a=int(input())
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(int(i))
# e1,e2,e3,e4 = map(int,input().split())
#f = list(map(int,input().split()))
# g = [input() for _ in range(a)]
def permutations_count(n):
    return math.factorial(n)
ya=a-2
con = permutations_count(a)//ya
ans=(10**ya)
ans2=ans//(10**9+7)*(10**9+7)+ans%(10**9+7)
if ya==0:
    print((1*con)%(10**9+7))
elif ya<0:
    print(0)
else:
    print(((ans2*con)-(con))%(10**9+7))

Submission status: Runtime Error

Solution code:
N = int(input())

if N == 2:
    ans = 2
elif N ==1:
    ans = 0
else:
    ans = 10**(N-2)

ans = int(ans%(10e9+7))
print(ans)

Submission status: Runtime Error

Solution code:
# 整数の入力
N = int(input())

print((10 ** (N-2) * N * (N-1) / 2) % (10**9 + 7))

Submission status: Runtime Error

Solution code:
inp = int(input())
if inp == 1:
  print(0)
  
else:
  all = 10 ** inp
  none = 8 ** inp
  a = sum([i * 8 for i in range(1,inp-1)]) + 1
  frag = 2 * 9 ** (inp-1) * inp - a * 2
  
print(all - none - frag)

Submission status: Runtime Error

Solution code:
from math import factorial

N = int(input())
if N == 1:
    ans = 0
else:
    # N == 3
    # [[0|9], [0|9], [1-8]] = (3! * 8^1 * (2^2 - 2)) / 2! * 1!
    # [[0|9], [0|9], [0|9]] = (3! * 8^0 * (2^3 - 2)) / 3! * 0!
    # N == 4
    # [[0|9], [0|9], [1-8], [1-8]] = (4! * 8^2 * (2^2 - 2)) / 2! * 2!
    # [[0|9], [0|9], [0|9], [1-8]] = (4! * 8^1 * (2^3 - 2)) / 3! * 1!
    # [[0|9], [0|9], [0|9], [0|9]] = (4! * 8^0 * (2^4 - 2)) / 4! * 0!
    ans = 0
    factorial_N = factorial(N)
    factorial_r = factorial_N // (N * (N - 1))
    e = 8 ** (N-2)
    t = 2
    rem = N - 2
    for i in range(2, N+1):
        t *= 2
        factorial_N = factorial_N // i
        ans += (factorial_N * e * (t - 2)) // factorial_r
        factorial_r = factorial_r // rem
        e = e // 8
        rem -= 1
print(ans % (10**9 + 7))

Submission status: Runtime Error

Solution code:
def factorial(n):
    if n == 1:
        return n
    return n * factorial(n-1)

s = int(input())
ans = (s * (s - 1)) * factorial(s-2)
ans %= 1000000007
print(ans)

Submission status: Runtime Error

Solution code:
def factorial(n):
    if n == 1:
        return n
    return n * kaijo(n-1)

s = int(input())
ans = (s * (s - 1)) * factorial(s-2)
ans %= 1000000007
print(ans)

Submission status: Runtime Error

Solution code:
import math

from math import factorial

# a = comb(n, r)

N = int(input())
a = factorial(N) / factorial(N-2) / factorial(N - (N-2))
    
B = 0


def power_func(a,n,p):
    bi = str(format(n,"b"))#2進表現に
    res = 1
    for i in range(len(bi)):
        res = (res*res) %p
        if bi[i] == "1":
            res = (res*a) %p
    return res

def pow_r(x, n):
    """
    O(log n)
    """
    if n == 0:  # exit case
        return 1
    if n % 2 == 0:  # standard case ① n is even
        return pow_r(x ** 2, n // 2)
    else:  # standard case ② n is odd
        return x * pow_r(x ** 2, (n - 1) // 2)
        
def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod




mod_1 = power(10, N-2, 1000000007)  
mod_2 = a % (1000000007)

if N == 1:
    print(0)
elif N == 2:
    print(2)
    

else:
    print((mod_1 * mod_2) % (1000000007))

Submission status: Runtime Error

Solution code:
N = int(input())
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print((comb(N,2)*2*(9**(N-2)))%(10**9+7))

Submission status: Runtime Error

Solution code:
N = int(input())
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print((comb(N,2)*2*9**(N-2))%(10**9+7))

Submission status: Runtime Error

Solution code:
// Template: https://github.com/maitaken/atcoder-template
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

const (
	BUFSIZE = 10000000
	MOD     = 1000000007
	INT_INF = math.MaxInt32
)

var rdr *bufio.Reader

func main() {
	rdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)
	solve()
}

func solve() {
  N:=readint()
  dp := make([][]int,N+1)
  for i := 0; i < N+1; i++ {
	dp[i] = make([]int,4)
  }
  dp[0][0] = 1
  for i := 0; i < N; i++ {
	dp[i+1][0] = mod(dp[i][0] * 8,MOD)
	dp[i+1][1] = mod(dp[i][0] + (dp[i][1] * 9),MOD)
	dp[i+1][2] = mod(dp[i][0]+ (dp[i][2] * 9),MOD)
	dp[i+1][3] = mod(dp[i][1]+dp[i][2]+(dp[i][3] * 10),MOD)
  }
  fmt.Println(dp[N][3])
}

func readline() string {
	buf := make([]byte, 0, 16)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			fmt.Println(e.Error())
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func readIntSlice() []int {
	slice := make([]int, 0)
	lines := strings.Split(readline(), " ")
	for _, v := range lines {
		slice = append(slice, s2i(v))
	}
	return slice
}

func readint() int {
	return s2i(readline())
}

func readint2() (int, int) {
	lines := strings.Split(readline(), " ")
	return s2i(lines[0]), s2i(lines[1])
}

func readint3() (int, int, int) {
	lines := strings.Split(readline(), " ")
	return s2i(lines[0]), s2i(lines[1]), s2i(lines[2])
}

func readint4() (int, int, int, int) {
	lines := strings.Split(readline(), " ")
	return s2i(lines[0]), s2i(lines[1]), s2i(lines[2]), s2i(lines[3])
}

// For int
func b2i(b bool) int {
	if b {
		return 1
	}
	return 0
}

func abs(v int) int {
	if v < 0 {
		return -v
	}
	return v
}

func pow(x, y int) int {
	return int(math.Pow(float64(x), float64(y)))
}

func mod(x, y int) int {
	m := x % y
	if m < 0 {
		return m + y
	}
	return m
}

func modpow(x, y int) int {
	ret := 1
	for ; y != 0; y >>= 1 {
		if y&1 == 1 {
			ret = mod((ret * x), MOD)
		}
		x = mod(x*x, MOD)
	}
	return ret
}

func min(values ...int) int {
	ret := INT_INF
	for _, v := range values {
		if ret > v {
			ret = v
		}
	}
	return ret
}

func max(values ...int) int {
	ret := -INT_INF
	for _, v := range values {
		if ret < v {
			ret = v
		}
	}
	return ret
}

func s2i(s string) int {
	v, ok := strconv.Atoi(s)
	if ok != nil {
		panic("Faild : " + s + " can't convert to int")
	}
	return v
}

func i2s(i int) string {
	return strconv.Itoa(i)
}

func gcd(v1, v2 int) int {
	if v1 > v2 {
		v1, v2 = v2, v1
	}
	for v1 != 0 {
		v1, v2 = v2%v1, v1
	}
	return v2
}

func lcm(v1, v2 int) int {
	return v1 * v2 / gcd(v1, v2)
}

func extgcd(a, b, c int) (int, int, int) {
	if a < b {
		a, b = b, a
	}
	if b == 0 {
		return a, 1, 0
	}
	d, x, y := extgcd(b, mod(a, b), c)
	return d, y, x - int(a/b)*y
}

func bit(size int) [][]bool {
	bSize := int(math.Pow(2, float64(size)))
	b := make([][]bool, bSize)
	for i := 0; i < bSize; i++ {
		b[i] = make([]bool, size)
		for j := 0; j < size; j++ {
			if i>>j&1 == 1 {
				b[i][j] = true
			} else {
				b[i][j] = false
			}
		}
	}
	return b
}

/* ------------------------------------------------ */
/* Data stracture                                   */
/* ------------------------------------------------ */
type IntHeap []int

func (h *IntHeap) Push(x interface{}) {
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

// BIT Tree
type FenwickTree []int

func NewFenwickTree(size int) *FenwickTree {
	var t FenwickTree
	t = make([]int, size+1)
	return &t
}

func (t FenwickTree) add(index, v int) {
	for i := index + 1; i < len(t); i += (i & -i) {
		t[i] += v
	}
}

func (t FenwickTree) sum(index int) int {
	total := 0
	for i := index + 1; i != 0; i -= (i & -i) {
		total += t[i]
	}
	return total
}

type Comb struct {
	length int
	fac    []int
	inv    []int
	finv   []int
}

func NewComb() *Comb {
	return &Comb{
		length: 2,
		fac:    []int{1, 1},
		inv:    []int{1, 1},
		finv:   []int{1, 1},
	}
}

func (c Comb) calc(n, k int) int {
	if n < k {
		return 0
	}
	if n < 0 || k < 0 {
		return 0
	}

	if c.length <= n {
		for i := c.length; i <= n; i++ {
			c.fac = append(c.fac, mod(c.fac[i-1]*i, MOD))
			c.inv = append(c.inv, MOD-mod(c.inv[mod(MOD, i)]*(MOD/i), MOD))
			c.finv = append(c.finv, mod(c.finv[i-1]*c.inv[i], MOD))
		}
	}
	return mod(c.fac[n]*mod(c.finv[k]*c.finv[n-k], MOD), MOD)
}

Submission status: Runtime Error

Solution code:
def func(a):
    if (a==0):
        return 6
    else:
        return func(a-1)+2
N=int(input())

S=10**9+7
if N==1:
    z=0
elif N==2:
    z=2
else:
    z=((10**(N-2) *N*2) - (10**(N-3) * (func(N-3)))) %S
print(z)

Submission status: Runtime Error

Solution code:

n = int(input())
n_all = 10**(n) % mod
bad_0 = 9**(n)%mod
bad_9 = 9**(n)%mod
bad_18 = 8**(n)%mod

print(n_all-bad_0-bad_9+bad_18)

Submission status: Runtime Error

Solution code:
n = int(input())

def p(m, n):
    k = 1
    for i in range(n):
        k = (k * m) % (10**9 + 7)
    return k

x = p(10, n) - 2*p(9, n) + p(8, n)
while x < 0:
    x += 10 ** 9 + 7
elif x == 10 ** 9 + 7:
    x = 0
print(x)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(1000000)
def pow_r(x, n):
    if n == 0:
        return 1 # exit case
    else:
        return x * pow_r(x, n - 1) % 1000000007
n=int(input())
m = n * (n-1) % 1000000007
m = m * pow_r(8,n-2) % 1000000007
print(m)

Submission status: Runtime Error

Solution code:
n = int(input())

n_zero = 10**n - 9**n #19
n_nine = 10**n - 9**n #19
n_non_zn = 8**n #64

a = (10**n - n_zero - n_nine - n_zn)

if a < 0:
  a = -a

print(a % (10**9+7))

Submission status: Runtime Error

Solution code:
def make_comb_dp(n):
    dp = [[0] * (n + 1) for i in range(n + 1)]
    for i in range(n + 1):
        dp[i][0] = 1
        dp[i][i] = 1
    for i in range(2, n + 1):
        for j in range(1, i):
            dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j]
    return dp

N = int(input())
a = 0

for n, i in enumerate(make_comb_dp(N)[N][:-1]):
    a += i * 8**n
    
ans = 10**N - (a*2 + 8**N) 

print(int(ans % 1000000007))

Submission status: Runtime Error

Solution code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations
import re
import sys

N=int(input())

if N <= 1:
    print('0')
elif N == 2:
    print('2')
else:
    ans1 = 2**N - 2

    ans2 = 0
    for i in range(N-2):
        ans2 = math.factorial(N) / ( math.factorial(2+i) * math.factorial(N-2-i))
        ans2 = ans2 * ( ( (2**(2+i))-2) * (8**(i+1)) )

    ans = long((ans1+ans2) % (10**9+7))
    print(ans)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)
N = int(input())
p = 10**9+7
ans = 0
comb = 1
s = 1
i = 0
j = N
nCr = {}
def cmb(n, r, p):
    if r == 0 or r == n: return 1
    if r == 1: return n%p
    if (n,r) in nCr: return nCr[(n,r)]%p
    nCr[(n,r)] = (cmb(n-1,r, p) + cmb(n-1,r-1, p))%p
    return nCr[(n,r)]

while j>=2:
    if i != 0:
        comb *= cmb((j+1), i, p)%p
    s = (2**j-2)%p
    egt = 8**i%p
    ans += comb*s*egt
    i += 1
    j -= 1

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())

def cc(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

if n<2:
  print(0)
elif n==2:
  print(2)
else:
  cc_=cc(n,2)
  ans=cc_ * 9 * 2
  print(ans%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N = int(input())

answer = 0
rest = 10 ** 9 + 7
  
if N == 1:
  answer = 0
else:
  answer = cmb(N, 2) * 2 * (10 ** (N - 2))
print(answer % rest)

a = cmb(N, 2)
print(a)

Submission status: Runtime Error

Solution code:
import math


result = 0

n = int(input())
for zeros in range(1,n+1):
  for nines in range(1,n+1):
    if zeros + nines > n:
      break
    else:
      result = result + (8**(n-zeros-nines) * (math.factorial(n) / (math.factorial(zeros) * math.factorial(nines))))
      
print(result % (10**9 + 7) )

Submission status: Runtime Error

Solution code:
N = int(input())

if N<(10**6):
	a=(10**N)%(10**9+7)
	b=(9**N)%(10**9+7)
	c=(8**N)%(10**9+7)
	print((a+c-2*b)%(10**9+7))
else:
	print((a+c-2*b)%(10**9+7))

Submission status: Runtime Error

Solution code:
a,b,c,d = map(int, input().split())

if a >= 0 and c >= 0:
  print(b*d)
elif b <= 0 and d <= 0:
  print(a*c)
elif a < 0 and c < 0:
  if b<=0 or d<=0:
    print(a*c)  
  elif abs(a)>=abs(b) and abs(c)>=abs(d):
    print(a*c)
  else:
    print(b*d)
elif (b<0 and c>=0):
  print(b*c)
elif (a>=0 and d<0):
  print(a*d)
else:
  print(b*d)

Submission status: Runtime Error

Solution code:
N=int(input())

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10**(N-2)
	each=N*(N-1)/2
	final=without*each

	considered=final%(1000000007)

	print(final)

Submission status: Runtime Error

Solution code:
n = input()
MOD = 1000000007
a1 = ((n%MOD)*((n-1)*MOD))%MOD
a2 = 1
for i in range(n-2):
  a2 = ((a2%MOD)*10)%MOD
print(((a1%MOD)*(a2%MOD))%MOD)

Submission status: Runtime Error

Solution code:
N = int(input())

x = 10**N - 8**N - (2/7) * ((8/7) * (8**N-1) - N)
y = 10**9 + 7
print(x % y)

Submission status: Runtime Error

Solution code:
# 整数の入力
N = int(input())
 
print( (10**(N-2) * N * (N-1) -7) / (10**9 + 7))

Submission status: Runtime Error

Solution code:
n = int(input())
if n == 0 or n == 1:
  print(0)
elif n == 2:
  print(2):
else:
  print((n * (n - 1) / 2) * 10 * (n - 2))

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(1,n + 1):
       fac = fac*i
c=10**(n-2)
print((fac*c)%1000000007)

Submission status: Runtime Error

Solution code:
import sys
import math
sys.setrecursionlimit(10**6)

MOD = 10**9 + 7
def mod_pow(x, mod):
    xx = [1, x]
    def _pow(y, x=x):
        nonlocal xx
        if y == 0:
            return 1
        while len(xx) <= math.log(y, 2)+1:
            v = xx[-1] * xx[-1]
            v %= mod
            xx.append(v)
        i = 1
        result = 1
        while y > 0:
            if y % 2 == 1:
                result *= xx[i]
                result %= mod
            y = y >> 1
            i += 1
        return result
    return _pow

pow9 = mod_pow(9, MOD)

def f(n):
    if n == 1:
        return 0
    else:
        return 10 * f(n-1) + 2 * pow9(n-2)
def main():
    N = int(input())
    ans = f(N)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())

if N <= 1:
  print(0)
else:
  res = (10**N - 8**N - 2 * (9**N - 8**N)) % mod

  print(int(res))

Submission status: Runtime Error

Solution code:
import math
n = int(input())
ans = math.factorial(10) / math.factorial(10 - (n-2))
print(ans % (10**9 + 7))

Submission status: Runtime Error

Solution code:
a = 1000000007

n = input()

not0 = 1
not0and9 = 1
all = 1
for i in range(n):
  not0and9 = (not0and9 * 8) % a
  not0 = (not0 * 9) % a
  all = (all * 10) % a;
  
print((all + not0and9 - 2 * not9) % a)

Submission status: Runtime Error

Solution code:
N=int(input())

if N<2:
	print(0)
ellif N==2:
	print(2)
else:
	without=10**(N-2)
	considered=(without+2)*(without+1)
	considered=considered%(1000000007)
	print(considered)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
ans = math.factorial(10) // math.factorial(10 - (n-2))
print(ans % (10**9 + 7))

Submission status: Runtime Error

Solution code:
import math
n = int(input())
if n == 1:
    print(0)
else if n==2:
  	print(2)
else:
    print(10**(n-2)*(math.factorial(n))%(10**9+7))

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

#define int long long

int mod = 1000000007;

#include "debug.cpp"

int dp[1000010][4];

int32_t main(){
	int n;
	cin >> n;

	if(n == 1){
		cout << "0\n";
		return 0;
	}

	dp[2][0] = 64;
	dp[2][1] = 17;
	dp[2][2] = 17;
	dp[2][3] = 2;

	for(int i=3; i<=n; i++){
		dp[i][0] = dp[i-1][0]*8;
		dp[i][1] = dp[i-1][0] + dp[i-1][1]*9;
		dp[i][2] = dp[i-1][0] + dp[i-1][2]*9;
		dp[i][3] = dp[i-1][1] + dp[i-1][2] + dp[i-1][3]*10;

		dp[i][0] %= mod;
		dp[i][1] %= mod;
		dp[i][2] %= mod;
		dp[i][3] %= mod;
	}

	cout << dp[n][3] << "\n";
}

Submission status: Runtime Error

Solution code:
n = int(input())
ans = math.factorial(10) // math.factorial(10 - (n-2))
print(ans % (10**9 + 7))

Submission status: Runtime Error

Solution code:
from math import comb
if __name__=="__main__":
  n=int(input())
  if n==1:
    print(0)
    break
  else:
    print(comb(n,2)*2)

Submission status: Runtime Error

Solution code:
N = int(input())
mod = 10**9+7
if N == 1:
  print(0)
elif N == 2:
  print(2)
else:
  ans = 10*8*6*(10**(3(N-3)))
  print((ans*2)%mod)

Submission status: Runtime Error

Solution code:
from tqdm import tqdm
N = int(input())

if N == 1:
    print(0)
    exit()

Z = 10 ** 9 + 7
a = 1
b = 1
c = 1
for n in range(N):
    a *= 10
    b *= 9
    c *= 8

    a = a % Z
    b = b % Z
    c = c % Z

print((a - 2 * b + c) % Z)

Submission status: Runtime Error

Solution code:
def powmod(a, n, p):
    if(n==0):
        return 1
    elif(n==1):
        return a%p
    elif(n%2==1):
        return ((a%p)*(powmod(a,n//2,p)**2%p))%p
    elif(n%2==0):
        return powmod(a,n//2,p)**2%p
N=int(input())
if(N==1):
  print(0)
else:
  print(powmod(10,N-2))

Submission status: Runtime Error

Solution code:
# coding: utf8
# 日本語を入力できるようにするために上記一文が必要

import math

N = int(input())

if N == 1:
        print(0)
elif N == 2:
        print(1)
else:
        ans = math.factorial(N)*(10**(N -2))


print(ans%(10**9+7))

Submission status: Runtime Error

Solution code:
N = int(input())
mod = 10**9+7
if N == 1:
  print(0)
elif N == 2:
  print(2)
else:
  ans = 10*8*6*10**(3(N-3))*2
  print(ans%mod)

Submission status: Runtime Error

Solution code:
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

#[allow(dead_code)]
struct Scanner<'a> {
    cin: StdinLock<'a>,
}
#[allow(dead_code)]
impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn input<T: FromStr>(&mut self) -> T {
        self.read().unwrap()
    }

    fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.input()).collect()
    }

    fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let n: usize = sc.input();
    const MOD: usize = 1000_000_007;

    let all = mod_pow(10 as i64, n as i64, MOD as i64);
    let complement = mod_pow(8 as i64, n as i64, MOD as i64);
    let nonzero = mod_pow(9 as i64, n as i64, MOD as i64);
    let x = if nonzero - complement < 0 {
        nonzero - complement + MOD as i64
    } else {
        nonzero - complement
    };
    let x = x * 2 % MOD as i64;
    let rest = if all - complement < 0 {
         all - complement + MOD as i64
    } else {
         all - complement
    };

    let ans = if rest - x < 0 {
        rest - x+ MOD as i64
    } else {
        rest - x
    };
    println!("{}", ans);
}

fn mod_pow(x: i64, n: i64, modulo: i64) -> i64 {
    let mut n = n;
    let mut x = x;
    let mut ret = 1;
    while n > 0 {
        if n & 1 == 1 {
            ret = ret * x % modulo;
        }
        x = x * x % modulo;
        n >>= 1;
    }
    ret
}

struct Combination {
    fac: Vec<usize>,
    finv: Vec<usize>,
    modulo: usize,
}

impl Combination {
    fn new(max_n: usize, modulo: usize) -> Combination {
        let mut fac = vec![0; max_n];
        let mut finv = vec![0; max_n];
        let mut inv = vec![0; max_n];
        fac[0] = 1;
        fac[1] = 1;
        finv[0] = 1;
        finv[1] = 1;
        inv[1] = 1;
        for i in 2..max_n {
            fac[i] = fac[i - 1] * i % modulo;
            inv[i] = modulo - inv[modulo % i] * (modulo / i) % modulo;
            finv[i] = finv[i - 1] * inv[i] % modulo;
        }
        Combination {
            fac: fac,
            finv: finv,
            modulo: modulo,
        }
    }

    fn get(&self, n: usize, k: usize) -> usize {
        assert!(n >= k);
        self.fac[n] * (self.finv[k] * self.finv[n - k] % self.modulo) % self.modulo
    }

    #[allow(dead_code)]
    fn h(&self, n: usize, k: usize) -> usize {
        self.get(n + k - 1, k)
    }

    #[allow(dead_code)]
    fn p(&self, n: usize, k: usize) -> usize {
        assert!(n >= k);
        self.fac[n] * self.finv[n - k]
    }
}

Submission status: Runtime Error

Solution code:
n = int(input())
x = 10**n％(10**9+7) + 8**n％(10**9+7) - 2 * 9**n％(10**9+7)
print(x％(10**9+7))

Submission status: Runtime Error

Solution code:
N=int(input())

if N<2:
	print(0)

else:
	without=10*(N-2)
	considered=(without+2)*(without+1)
	consider%=10**9+7

Submission status: Runtime Error

Solution code:
import math

def combinations_count(N, r):
    return math.factorial(N) // (math.factorial(N - r) * math.factorial(r))

# 整数の入力
N = int(input())
r = 2
 
print((combinations_count(N, r) * (10**(N-r)))  / (10**9 + 7))

Submission status: Runtime Error

Solution code:
N=input()

if N<2:
	print(0)

else:
	without=10*(N-2)
	considered=(without+2)*(without+1)
	print(considered)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
hoge = 10**9+7
if N == 1:
    print(0)
else:
    a = math.factorial(N) / math.factorial(N-2)
    b = 10**(N-2)
    print(a*b%hoge)

Submission status: Runtime Error

Solution code:
from tqdm import tqdm
N = int(input())

if N == 1:
    print(0)
    exit()

Z = 10 ** 9 + 7
a = 1
b = 1
c = 1
for n in tqdm(range(N)):
    a *= 10
    b *= 9
    c *= 8

    a = a % Z
    b = b % Z
    c = c % Z

print((a - 2 * b + c) % Z)

Submission status: Runtime Error

Solution code:
N=input()

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10*(N-2)
	considered=(without+2)*(without+1)/2
	print(considered)

Submission status: Runtime Error

Solution code:
import math
def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

N = int(input())

sum = 0
for i in range(2, N+1):
    basyo = permutations_count(N, i)/2  # 9と0が入る場所。i箇所。
    # zerokyuu = i*(i-1)*2(i-2)  # 入る場所に0と9を入れる。
    zerokyuu = 2**i - 2  # 全部0と全部9を抜く。
    iti_hachi = 8**(N-i)  # 残った部分に1-8が入る全通り
    sum += basyo * zerokyuu * iti_hachi

print(int(sum%(10**9+7)))

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int, input().split())
print(max(a*c, a*d, b*c, b*d))

Submission status: Runtime Error

Solution code:
import math
# 整数の入力
N = int(input())
r = 2
def combinations_count(N, r):
    return math.factorial(N) // (math.factorial(N - r) * math.factorial(r))
 
print(math.ceil(10**(N-2) * combinations_count(N, r) / (10**9 + 7)))

Submission status: Runtime Error

Solution code:
n = int(input())
factorial = [1, 1]

for i in range(2, n+1):
  factorial.append(i*factorial[i-1])

print((10**(n-2)%(10**9+7)*factorial(n)%(10**9+7))10**9+7)

Submission status: Runtime Error

Solution code:
M = 10**9 + 7
n = int(input())
print((pow(10, n, M) - 2 * pow(9, n, M) + pow(8, n, M) % M)

Submission status: Runtime Error

Solution code:
N=input()

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10*(N-2)
	considered=without*(without-1)/2
	print(considered)

Submission status: Runtime Error

Solution code:
import math
def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

N = int(input())

sum = 0
for i in range(2, N+1):
    basyo = permutations_count(N, i)/2  # 9と0が入る場所。i箇所。
    # zerokyuu = i*(i-1)*2(i-2)  # 入れる場所に0と9を入れる。
    zerokyuu = 2**i - 2  # 全部0と全部9を抜く。
    iti_hachi = 8**(N-2)  # 残った部分に1-8が入る全通り
    sum += basyo * zerokyuu * iti_hachi

print(int(sum%(10**9+7)))

Submission status: Runtime Error

Solution code:
x = int(input())
if x < 2:
  print(0)
  exit(0)
if x == 2:
  return 2
ans = (2*((x-2)*10)) % 1000000007
print(ans)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
mod=10**9+1
if n==1:
    print(0)
else:
    print((2*int((math.pow(8,n-2)))%mod)%mod)