Problem:


Score : 200 points

Problem Statement

Snuke loves working out. He is now exercising N times.

Before he starts exercising, his power is 1. After he exercises for the i-th time, his power gets multiplied by i.

Find Snuke's power after he exercises N times. Since the answer can be extremely large, print the answer modulo 10^{9}+7.

Constraints

1 ≤ N ≤ 10^{5}

Input

The input is given from Standard Input in the following format:

N

Output

Print the answer modulo 10^{9}+7.

Sample Input 1

3

Sample Output 1

6

After Snuke exercises for the first time, his power gets multiplied by 1 and becomes 1.

After Snuke exercises for the second time, his power gets multiplied by 2 and becomes 2.

After Snuke exercises for the third time, his power gets multiplied by 3 and becomes 6.

Sample Input 2

10

Sample Output 2

3628800

Sample Input 3

100000

Sample Output 3

457992974

Print the answer modulo 10^{9}+7.



Sample input:
3


Sample output:
6

Submission status: Runtime Error

Solution code:
N = int(input())
mod = int(1e9+7)
for j in range(1, N+1):
    prod = j * (prod%mod)
print(prod)

Submission status: Runtime Error

Solution code:
N = int(input())
prod = 1
for j in range(1, N+1):
	prod *= j
print(prod%(1e9+7))

Submission status: Runtime Error

Solution code:
n = int(input())
r = 1
w = 10**9 + 7
for i in range(n):
  r = (r * i) % x
  
print(r)

Submission status: Runtime Error

Solution code:
n = int(input())
r = 1
w = 10**9 + 7
for i in range(n):
  r = r * i / x
  
print(r)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


# import re
# import array
# import copy
# import functools
# import operator

# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd
from math import gcd
# import collections
# import itertools
# import bisect

# import heapq
# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace
# from queue import PriorityQueue as pq
from queue import Queue

# from itertools import accumulate

# from collections import deque
# from collections import Counter

# from operator import mul
# from functools import reduce

# def lcm(n,m):
#     return int(n*m/gcd(n,m))

# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )

# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom

# import random
# import time


def main():
    n = int(input().strip())
    temp = 1
    for i in range(1, n + 1):
        temp *= i
        temp = temp % (10**9 + 7)
    print(temp)
    return


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
num = 10**9 + 7

def factorial(n):
    if n == 1:
        return n
    return n * factorial(n-1)
  
print(factorial(n) % num)

Submission status: Runtime Error

Solution code:
n = int(input())
num = 10**9 + 7
print(factorial(n) % numß)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
mod = 10 ** 9 + 7
def fact(n):
    if n == 1:
        return 1
    return n * fact(n-1)

answer = fact(N)
print(answer % mod)

Submission status: Runtime Error

Solution code:
N = int(input())

def fact(n):
    if n == 1:
        return 1
    return n * fact(n-1)

answer = fact(N)
print(answer)

Submission status: Runtime Error

Solution code:

n = int(input())
power = 1

for i in range(1,n+1):
    power *= i
    ans = ans % (10**9 + 7)

print(ans)

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
def fact(n):
    if n == 1:
        return n
    else:
        return n*fact(n-1)
    
n = int(input())
print(fact(n)%(10**9+7))

Submission status: Runtime Error

Solution code:
N=int(input())
mod=10**9+7
bikkuri=[1 for i in range(N+1)]
for i in range(N+1):
  bikkuri[i+1]=((i+1)*bikkuri[i])%mod
print(bikkuri[N])

Submission status: Runtime Error

Solution code:
N=int(input())
mod=10**9+7
bikkuri=[1*(N+1)]
for i in range(N+1):
  bikkuri[i+1]=((i+1)*bikkuri[i])%mod
print(bikkuri[N])

Submission status: Runtime Error

Solution code:
n = int(input())
mod = 10 ** 9 + 7
def a(n):
    if n == 1:
        return n
    else:
        return n * (a(n - 1))

print(a(n) % mod)

Submission status: Runtime Error

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

n = int(input())

print(kaijo(n)%1000000007)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 1
for i in range(1, N+1):
  (ans *= i) %= 1000000007
print(ans)

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
if 2 * n >= m:
    print(m // 2)
else:
    a = m - 2 * n
    b = a // 4
    print(n + b)

Submission status: Runtime Error

Solution code:
sum = 1
N = int(input())
for i in range(N):
	sum *= (i+1)
        sum  = sum % 1000000007
print(sum%1000000007)

Submission status: Runtime Error

Solution code:
sum = 1
N = int(input())
for i in range(N):
	sum *= (i+1)
       sum  = sum % 1000000007
print(sum%1000000007)

Submission status: Runtime Error

Solution code:
N = int(input())

N = int(input())
power = 1
for i in range(N):
  power = power*(i+1) % (10**9+7)
  
print(power)

Submission status: Runtime Error

Solution code:
N = int(input())

N = int(input())
power = 1
for i in range(N):
  power = power*(i+1)
  if power > 10**9+7:
    power = power % (10**9+7)
  
print(power)

Submission status: Runtime Error

Solution code:
N = int(input())

N = int(input())
power = 1
for i in range(N):
  power = power*(i+1)%(10**9+7)
  
print(power)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())


def time_memo(n):
    memo = [0]*(n+1)

    def _time(n):
        if n <= 0:
            return 0
        elif n == 1:
            return 1
        elif memo[n] != 0:
            return memo[n]
        else:
            memo[n] = _time(n-1)*n
            return memo[n]
    return _time(n)


print(time_memo(N) % (10 ^ 9+7))

Submission status: Runtime Error

Solution code:
N = int(input())


def time(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return time(n-1) * n


print(time(N) % (10 ^ 9+7))

Submission status: Runtime Error

Solution code:
N = int(input())


def time(n):
    if n <= 0:
        return 0
    elif n == 1:
        return 1
    else:
        return time(n-1) * n


print(time(N))

Submission status: Runtime Error

Solution code:
N = int(input())

def main():
    ans = 1
    t = 0
    while t < N:
        t += 1
        ans *= t
        ans %= 1_000_000_007
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
ans = factorial(n) % (10 ** 9 + 7)
print(ans)

Submission status: Runtime Error

Solution code:
n = input()
m = n ** (n-1)
print( m % (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
#coding:utf-8

n = int(input())
power = 1

for i in range(0,n):
  power = ((i+1) * power) % (7 + 10＊＊９)

print(power)

Submission status: Runtime Error

Solution code:
#coding:utf-8

n = int(input())
power = 1

for i in range(n):
  power = ((i+1) * power) % (7 + 10＊＊９)

print(power)

Submission status: Runtime Error

Solution code:
N = int(input())
ans: int = 1
for i in range(1, N+1):
    ans = ans * i
print(ans%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
n = int(input())

print(math.factorial(n) % (10**9+7)

Submission status: Runtime Error

Solution code:
n = int(input())

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

print(p

Submission status: Runtime Error

Solution code:
n = int(input())

p=1
for i in range(1, n+1):
    p = p*i  

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

Submission status: Runtime Error

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
import math

print(math.factorial(n)%(10**9+7))

Submission status: Runtime Error

Solution code:
import math

n=int(input())

print(math.factorial(n)/10**9+7)

Submission status: Runtime Error

Solution code:
A=1
for i in range(1,int(input)+1):
  A*=i
  A%=1000000007
print(A)

Submission status: Runtime Error

Solution code:
N = int(input())
power_r = 1
for n in range(2,N+1):
    power_r = power_r*n % (10**9+7)
print(factorial(N))

Submission status: Runtime Error

Solution code:
def t(n):
    if n==1:
        return 1
    return n*t(n-1)
print(t(int(input()))%(10**9+7))

Submission status: Runtime Error

Solution code:
def t(n):
    if n==1:
        return 1
    return n*t(n-1)
print(t(int(input())))

Submission status: Runtime Error

Solution code:
import math
print(math.factorial(n)%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
print(math(factorial(n))%(10**9+7))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N  = int(input())
p = 1
for i in range(1,N+1):
  p*=i
  
print(p/(10**9+7)  )

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
 
prod = 1
for i in range(1,n+1):
    prod *= i
    ans = ans%(10**9+7)
print(ans)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
print (factorial(N) % (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
    _n = int(sys.stdin.readline())

    # N! = aH + b
    # (N+1) * N! = aH(N+1) + b(N+1)
    #            = aH(N+1) + int(b(N+1)/H) * H + b(N+1) % H
    result = reduce(lambda a, n: (a * n) % H, range(1, _n + 1), 1)

    print(result)

Submission status: Runtime Error

Solution code:
a=int(input())
import math
print(math.fractional(a))

Submission status: Runtime Error

Solution code:
import math

n = int(input())
print(math.factrial(n) % (10^9 + 7))

Submission status: Runtime Error

Solution code:
    n = int(input())
    temp = 1
     
    for i in range(1,n+1):
      temp = temp + i
      temp = temp % (10**10)
     
    print(int(temp % (10 ** 9 + 7)))

Submission status: Runtime Error

Solution code:
n = int(input())
temp = 1
for i in range(1,n+1):
  temp = temp * i
  
 print(temp)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
power=1
for i in range(1,n+1):
  power=power*i
print(power%(10**9+7))

Submission status: Runtime Error

Solution code:
N = int(input())
p = 1
for i in range(1, N + 1):
    p *= i
    p = p % (10**9 + 7)

prin

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**5)
N=int(input())
MOD=10**9+7
def seki(x):
	if x<2:
		return 1
	else:
		return x*seki(x-1)%MOD
print(seki(N)%MOD)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1000000007
//S.size()

using namespace std;


typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<bool> VB;
typedef unsigned long long ll;



int main(void){
  int N; cin>>N;
  ll num = 1;
  for(ll i = 1; i <= N; i++)num *= i;
  cout<<num % INF;
}

Submission status: Runtime Error

Solution code:
n = int(input())
p = 1
for i in range(1,n+1):
  p = p*i
ap = p/1000000007
print(ap)

Submission status: Runtime Error

Solution code:
n = int(input())
p = 1
for i in range(n):
  p = p*2^i
ap = p/(1000000007)
print(ap)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# sはありったけ使うほうがいい（cから作るとコストがかかる）
# ありったけ = m//2
# 残ったcからsccを作るには4つ必要

n, m = map(int, input().split())
c = min(n, m // 2)
c += max(0, (m-2*n) // 4)
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())

mod = 10**9 + 7

ans = 1
for i in range(1, N+1):
  ans = (ans * i) % mod

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 1
for i in range(1, N+1):
	ans = (ans * i) % 1000000007
print ans

Submission status: Runtime Error

Solution code:
N = int(input())
pow = 1
for i in range(1,N+1):
        pow = pow*i10**9+7
print(pow)

Submission status: Runtime Error

Solution code:
n = int(input())

power = 1
mod = 10**9+7

for i in range(n):
  p = (p * (i+1)) % mod
print(p)

Submission status: Runtime Error

Solution code:
x=int(input())
def factorial(n):
  a=1
  if n==1:
    return a
  else:
    a= n*factorial(n-1)
    return a%(10**9+7)
print(factorial(x))

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)
x=int(input())
def factorial(n):
  a=1
  if n==1:
    return a
  else:
    a= n*factorial(n-1)
    return a
print(factorial(x)%(10**9+7))

Submission status: Runtime Error

Solution code:
x=int(input())
def factorial(n):
  a=1
  if n==1:
    return a
  else:
    a= n*factorial(n-1)
    return a
print(factorial(x)%(10**9+7))

Submission status: Runtime Error

Solution code:
def factorial(n):
  a=1
  if n==1:
    return a
  else:
    a*= factorial(n-1)
  return a
print(a/(10**9+7))

Submission status: Runtime Error

Solution code:
def fraction(N):
  w = N
  for x in range(1, N):
    w *= x
  return w
print("{:.0f}".format(fraction(int(input())) % (1e9 + 7)))

Submission status: Runtime Error

Solution code:
def fraction(N):
  w = N
  for x in range(1, N):
    w *= x
  return w
print(fraction(int(input())) % (1e9 + 7))

Submission status: Runtime Error

Solution code:
def fraction(N):
  if N <= 1:
    return 1
  else:
    return N * fraction(N-1)
print(fraction(int(input())) % (1e9 + 7))

Submission status: Runtime Error

Solution code:
def fraction(N):
  if N <= 1:
    return 1
  else:
    return N * fraction(N-1)
print(fraction(int(input())))

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10000)

def kaijo(N):
    if N == 1:
        return 1
    else:
        return N * kaijo(N-1)

if __name__ == '__main__':
    n = int(input().strip())
    print(kaijo(n) % (10**9 + 7))

Submission status: Runtime Error

Solution code:
def kaijo(N):
    if N == 1:
        return 1
    else:
        return N * kaijo(N-1)

if __name__ == '__main__':
    n = int(input().strip())
    print(kaijo(n) % (10**9 + 7))

Submission status: Runtime Error

Solution code:
n = int(input())

total = 1

for i in range(1, n+1):
    total *= i

print(total / (10**9 + 7))

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 1
for i in range(n):
    ans *= i + 1
    asn %= (10**9 + 7)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
power = 1
for i in range(N):
  power *= i+1
print(power / (pow(10, 9) + 7))

Submission status: Runtime Error

Solution code:
import math;print(math.factorial(int(input()))%(7+1e9))

Submission status: Runtime Error

Solution code:
N=int(input())
r = 10**9+7
power=1
for i in range(n):
    power=power*(i+1)%r
print(power)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
ans = math.factorial(n) % (1e9+7)
print(int(ans))

Submission status: Runtime Error

Solution code:
import math
n = int(input())
print(math.factorial(n) % (1e9+7))

Submission status: Runtime Error

Solution code:
N = int(input())
power = 1

for i in range(1, N + 1, 1):
  power = i * power
  
print(power / (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
N = int(input())

for i in range(1, N + 1, 1):
  
  if i == 1:
    power = i
  else:
  	power = i * power
  
print(power / (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
import math
n=int(input())
print(math.factorial(n)%(1e9+7))n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%(1e9+7)
print(int(ans))

Submission status: Runtime Error

Solution code:
import math
n=int(input())
print(math.factorial(n)%(1e9+7))n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%(1e9+7)
print(ans)

Submission status: Runtime Error

Solution code:
res = 1
for i in range(1, n+1):
    res *= i
    if res > 10**9+7:
        res %= 10 ** 9+7

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

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=m//2
if n>a:
    print(a)
else:
    print((n+a)//2)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=1
for i in range(1,n+1):
  ans=ans*i
print(ans/(10**9+7))

Submission status: Runtime Error

Solution code:
n = int(input())

power = 1
for i in range(n):
    power = power + (i+1)%1000000007
    power %= %1000000007

print(power)

Submission status: Runtime Error

Solution code:
N = int(input())

power = 1
mod = 10 ** 9 + 7

for i in range(1, N + 1):
    power *= i
	power %= mod
print(power)

Submission status: Runtime Error

Solution code:
n=int(input())
inport math
m=math.factorial(n)
print(m%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
print(math.factorial(N)%(10**9+7))

Submission status: Runtime Error

Solution code:
import math;print(math.factorial(int(input()))%(1e9+7))

Submission status: Runtime Error

Solution code:
import math
N=int(input())
print(int(math.factorial(N)%(7+1e9)))

Submission status: Runtime Error

Solution code:
import math
N=int(input())
print(math.factorial(N)%(7+1e9))

Submission status: Runtime Error

Solution code:
import math
N=int(input())
print(math.factorial(N)%(7+1e9)

Submission status: Runtime Error

Solution code:
from math import factorial
N=int(input())
print(factorial(N)%(7+1e9)

Submission status: Runtime Error

Solution code:
n = int(input())
ans = 1
for i in range(1, n + 1):
  ans *= i
  if ans >= (10 ** 9 + 7):
    ans = ans - (10 ** 9 + 7)
print(p % (10 ** 9 + 7))

Submission status: Runtime Error

Solution code:
# coding: utf-8
div = 10 ** 9 + 7
n = int(input())
ans = 1
for i in range(1, N + 1):
  ans = (ans * i) % div
print(ans)

Submission status: Runtime Error

Solution code:
from math import fractorial;print(fractorial(int(input()))%(10**9+7))

Submission status: Runtime Error

Solution code:
import math

n = int(input())
actorial(n) % (10**9+7))

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(100000)
n = int(input())
def train(n):
    if n == 1:
        return 1
    else:
        return n * train(n-1)

ans = train(n) % (10**9 + 7)

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
def fact(n):
  if n == 0:
    return 1
  elif n == 1:
    return 1
  else:
    return fact(n-1)*n
print(fact(N) % (10**9 +7))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
n = gets.to_i
print(math.factorical(n) % (10**9 + 7))

Submission status: Runtime Error

Solution code:
def k(n):
    mod =1000000007
    if n==1:
        return 1
    else:
        return (n*k(n-1))%mod
print(k(int(input())))

Submission status: Runtime Error

Solution code:
x, i = 1, 1
while i <= int(input()):
  x = (x * i) % (10 ** 9 + 7)
  i += 1
print(x)

Submission status: Runtime Error

Solution code:
mod = 1000000007

n = int(input())
factorial_previous = 1

for i in range(2,n+1):
    factorial = (i*factorial_previous)%mod
    factorial_previous = factorial
print(factorial)

Submission status: Runtime Error

Solution code:
N = int(input())

power = 1
for i in range(1,N+1):
    power *= i
    power %= (10**9 + 7)

print(ans)

Submission status: Runtime Error

Solution code:
#55b
n = int(input())
p=1

for i in range(1,n+1):
    p = p*i

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

Submission status: Runtime Error

Solution code:
#55b
n=int(input())
p=1
for i in range(1,n+1):
    p = p*i
print(a%(10**9+7))

Submission status: Runtime Error

Solution code:
N = int(input())
import math
def s(n):
  if n == 1:
    return 1
  else:
    return (n*s(n-1))%(10**9+7)
print(s(N))

Submission status: Runtime Error

Solution code:
s = input().split()
h = int(s[0])
w = int(s[1])
s = []
for i in range(h):
    s.append(input())

for i in range(h):
    row = ''
    for j in range(w):
        cnt = 0
        if s[i][j] == '#':
            row += '#'
            continue
        if i > 0 and j > 0 and s[i-1][j-1] == '#':
            cnt += 1
        if i > 0 and s[i-1][j] == '#':
            cnt += 1
        if i > 0 and j < w - 1 and s[i-1][j+1] == '#':
            cnt += 1
        if j > 0 and s[i][j-1] == '#':
            cnt += 1
        if j < w - 1 and s[i][j+1] == '#':
            cnt += 1
        if i < h - 1 and s[i+1][j-1] == '#':
            cnt += 1
        if i < h - 1 and s[i+1][j] == '#':
            cnt += 1
        if  i < h - 1 and j < w - 1 and s[i+1][j+1] == '#':
            cnt += 1
        row += str(cnt)
    print(row)

Submission status: Runtime Error

Solution code:
N = int(input())
p = 1
for i in range(1, N ; 1):
    p *= i
print(p % 1000000007)

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(1,n+1):
  m*=i
print(m%1000000007)

Submission status: Runtime Error

Solution code:
w, a, b = map(int, input().split())
if b >=  a+w:
   print(b-a-w)
elif b+w<= a:
   print(a-b-w)
else:
   print(0)

Submission status: Runtime Error

Solution code:
N = int(input())
print(math.factorial(N) % MOD)

Submission status: Runtime Error

Solution code:
import math


def solve():
    N = int(input())
    print(math.factorial(N) % MOD)


solve()

Submission status: Runtime Error

Solution code:
import math


def solve():
    print(math.factorial(int(input())) % MOD)
    
 
solve()

Submission status: Runtime Error

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

x = int(input())
div = pow(10,9) - 7
print(factorial(x) % div)

Submission status: Runtime Error

Solution code:
def imp_kai(n):
    ac = 1
    for i in range(n):
        ac *= i + 1
        ac = ac % (1e9 + 7)
    return ac % (1e9 + 7)
-
n = int(input())
print(imp_kai(n))

Submission status: Runtime Error

Solution code:
def kai(n):
  if (n == 1):
    return 1
  else:
    return n * kai(n-1) % (1e9 + 7)

n = int(input())
print(kai(n))

Submission status: Runtime Error

Solution code:
N = int(input())
total = 1
for i in range(1,N+1):
    total *= i
print(int(total/(10**9 + 7)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N = int(input())
fn = math.factorial(N)
ans = int(math.factorial(N)%(math.pow(10,9)+7))
print(ans)

Submission status: Runtime Error

Solution code:
m = 1
for var in range(int(raw_input) + 1):
  m = m * var + 1
print(m%1000000000*+7)

Submission status: Runtime Error

Solution code:
m = 1
for var in range(int(raw_input) + 1):
 m = m * var + 1
print(m%1000000000*+7)

Submission status: Runtime Error

Solution code:
    N = int(input())
    ans = 1
    for i in range(N):
        ans = ans * (i + 1) % (10**9 + 7)
    print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
ans = 1
for i in range(N)
    ans = ans * (i + 1) % (10**9 + 7)
print(ans)

Submission status: Runtime Error

Solution code:
#include <iostream>

using namespace std;
int N;

int main()
{
    scanf("%d", &N);
    int q = N/15;
    printf("%d\n", 800*N - 200*q);
    return 0;
}

Submission status: Runtime Error

Solution code:
input_len = input()
ans = 1
for i in range(1, input_len+1):
    ans *= i

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

Submission status: Runtime Error

Solution code:
N = int(input())
power = 1

for i in range(1,N+1):
 power = (i * power % P) 

print(power)

Submission status: Runtime Error

Solution code:
s,c = map(int, raw_input().split())
 
scc = 0
if s*2 <= c:
  scc = s
  c -= s*2
else:
  scc = c/2
print  scc + c/4

Submission status: Runtime Error

Solution code:
import math

n = int(raw_input())

print '{:d}'.format(math.factorial(n) % (math.pow(10,9) + 7))

Submission status: Runtime Error

Solution code:
import math

n = int(raw_input())

print math.factorial(n) % (math.pow(10,9) + 7)

Submission status: Runtime Error

Solution code:
n=input()
a=[0]*(n+1)
def P(n):
    if n==1:
        return 1
    elif a[n]!=0:
        return (a[n])
    else:
        a[n]=P(n-1)*n
        return (a[n])
print (int(P(n)%(1e9 +7)))

Submission status: Runtime Error

Solution code:
n = int(input())
import sys
sys.setrecursionlimit(100000)
def fa(n, memo=dict()):
	if n==0 or n == 1:
		return 1
	elif n in memo.keys():
		return memo[n]
	else:
		temp = fa(n-1)*n %int(10**9+7)
		memo[n] = temp
		return temp

print(fa(n))

Submission status: Runtime Error

Solution code:
n = int(input())
import sys
sys.setrecursionlimit(100000)
def fa(n, memo=dict()):
	if n==0 or n == 1:
		return 1
	elif n in memo.keys():
		return memo[n]
	else:
		temp = fa(n-1)*n
		memo[n] = temp
		return temp

print(fa(n))

Submission status: Runtime Error

Solution code:
n=input()
def P(n):
    if n==1:
        return 1
    else:
        return P(n-1)*n
print int((P(n)%(1e9 +7)))

Submission status: Runtime Error

Solution code:
n=input()
def P(n):
    if n==1:
        return 1
    else:
        return P(n-1)*n
print (P(n)%(1e9 +7))

Submission status: Runtime Error

Solution code:
n=input()
def P(n):
    if n==1:
        return 1
    else:
        return P(n-1)*n
print (P(n)/(1e9 +7))

Submission status: Runtime Error

Solution code:
n=input()
def P(n):
    if n==1:
        return 1
    else:
        return P(n-1)*n
print (P(n))

Submission status: Runtime Error

Solution code:
import math
n = int(input())
print(math.factorial(n) / (pow(10, 9) + 7))

Submission status: Runtime Error

Solution code:
def sunuke_f2(n):
    power = 1
    for i in range(1, n+1, 1):
        power *= i
        i += 1
    print(power % (10 ** 9 + 7))
sunuke_f2(N)

Submission status: Runtime Error

Solution code:
def f(n, memo = dict()):
	if n == 0 or n == 1:
		return 1
	elif n in memo.keys():
		return memo[n]
	else:
		temp = (f(n-1) * n) % int(10e9+7)
		memo[n] = temp
		return temp

n = int(input())
print(f(n))