Harryxun/stf_run huggingface dataset:
from bisect import bisect_left

n,k=map(int,input().split())
x=list(map(int,input().split()))

iz=bisect_left(x,0)
if x[iz+1]==0:
    k=k-1
if x[n-1]<=0 :
    t=-x[-k]
    print(t)
elif x[0]>=0:
    t=x[k-1]
    print(t)

else:
    tmin=10**9
    for i in range(max(0,iz-(k-1)+1),min(iz,n-1-(k-1)+1)):
        kt=i
        t1=-x[kt]+x[kt+(k-1)]*2
        t2=-x[kt]*2+x[kt+(k-1)]
        if t1<tmin:
            tmin=t1
        if t2<tmin:
            tmin=t2
    print(tmin)
    


### FIXED CODE ###

from bisect import bisect_right
from bisect import bisect_left

n,k=map(int,input().split())
#n=100000
#k=100000

#n=100000
#k=100000
x=list(map(int,input().split()))

if x[n-1]<0 :
    t=-x[-k]
#    print(1)
    print(t)
elif x[n-1]==0 :
    t=-x[-k+1]
#    print(2)
    print(t)

elif x[0]>0:
    t=x[k-1]
#    print(3)
    print(t)
elif x[0]==0:
    t=x[k-1-1]
#    print(4)
    print(t)

else:
    iz=bisect_left(x,0)
    if x[iz+1]==0:
        k=k-1
        tmin=10**9
#        print((iz-(k-1)+1),iz,n-1-(k-1))
        for i in range(max(0,iz-(k-1)+1),min(iz,n-1-(k-1)+1)):
            kt=i
            t1=-x[kt]+x[kt+(k-1)]*2
            t2=-x[kt]*2+x[kt+(k-1)]
#        print("2",kt,kt+k-1,t,x[kt],x[kt+k-1])
#            print(tmin,t1,t2)
            if t1<tmin:
                tmin=t1
            if t2<tmin:
                tmin=t2
    else:
        tmin=10**9
#        print((iz-(k-1)+1),iz,n-1-(k-1))
        for i in range(max(0,iz-(k-1)+1),min(iz,n-1-(k-1)+1)):
            kt=i
            t1=-x[kt]+x[kt+(k-1)]*2
            t2=-x[kt]*2+x[kt+(k-1)]
#        print("2",kt,kt+k-1,t,x[kt],x[kt+k-1])
#            print(tmin,t1,t2)
            if t1<tmin:
                tmin=t1
            if t2<tmin:
                tmin=t2
    print(tmin)
    
#  299993628 
# 1000000000        
#   99990701
a, b = map(int, input().split())
n = min(a, b)
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]
l = primes(n)
count = 1
for p in l:
    if a % p == 0 and b % p == 0:
        count += 1
print(count)

### FIXED CODE ###

n = int(input())
if n % 2 == 0:
    odds = n // 2
else:
    odds = (n // 2)  + 1
ans = odds / n
print(ans)
# -*- coding: utf-8 -*-
from collections import defaultdict
def inpl(): return list(map(int, input().split()))
H, W = inpl()
coins = []
grid = defaultdict(int)

z = 0
for h in range(H):
    for w, x in enumerate(input()):
        if x == "#":
            coins.append((w-h, w+h))
            #print(z, (w-h, w+h))
            z+= 1


ans = 0
check = set(coins)
for i in range(len(coins)):
    for j in range(i+1, len(coins)):
        a, b = coins[i]
        c, d = coins[j]
        if a == c or b == d:
            continue
        if (a, d) in check:
            pass
            #print((a, b), (c, d), (a, d))
        if (c, b) in check:
            pass
            #print((a, b), (c, d), (c, b))
        ans += ((a, d) in check) + ((c, b) in check)

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())
A = sorted([int(input()) for _ in range(N)])
ans = 0
if N%2 == 0:
    B = []
    for i in range(N//2)[::-1]:
        if i%2:
            B.append(-i-1)
        else:
            B.append(i)
    for i in range(N//2):
        if i%2:
            B.append(i)
        else:
            B.append(-i-1)
    S = [A[b] for b in B]
    for i in range(N-1):
        ans += abs(S[i+1] - S[i])
else:
    M = N//2
    B = list(range(1, M+2))[::-1] + list(range(1, M+1))
    S = []
    for i, b in enumerate(B):
        if i%2:
            S.append(A[-b])
        else:
            S.append(A[b-1])
    for i in range(N-1):
        ans += abs(S[i+1] - S[i])

    S = []
    for i, b in enumerate(B):
        if i%2:
            S.append(A[b-1])
        else:
            S.append(A[-b])
    tmp = 0
    for i in range(N-1):
        tmp += abs(S[i+1] - S[i])
    ans = max(ans, tmp)
print(ans)
A,B=map(int,input().split())
sum =0
for i in range(2)
  if A >= B:
     sum+=A
      A-=1
  else:
      sum+=B
      B-=1
print(sum)

### FIXED CODE ###

A,B=map(int,input().split())
sum =0
for i in range(2):
  if A >= B:
     sum+=A
     A-=1
  else:
     sum+=B
     B-=1
print(sum)
n = list(input())
if n[0] ==7:
 	print("Yes")
 else:
 	if n[1] ==7:
 		print("Yes")
    else:
    	if n[2] ==7:
 			print("Yes")
        else:
        	print("No")

### FIXED CODE ###

n = list(input())
if int(n[0]) == 7:
    print("Yes")
else:
    if int(n[1]) == 7:
        print("Yes")
    else:
        if int(n[2]) == 7:
            print("Yes")
        else:
            print("No")
N, x = map(int, input().split())
a = input().split()
count = 0
for i in range(len(a)):
      a[i] = int(a[i])
      if a[i] > x:
            count = count + a[i] - x
            a[i] = x
      else:
            a[i] = a[i]
for i in range(len(a)-1):  
      if i%2 == 0:
            if a[i] + a[i + 1] > x:
                  count = count + a[i] + a[i + 1] - x
                  a[i+1] = x - a[i]
      else:
            if a[i] + a[i + 1] > x:
                  count = count + a[i] + a[i + 1] - x
                  a[i] = x - a[i + 1]
print(count)


### FIXED CODE ###

a, x, c = input().split()
print("A"+x[0]+"C")
s = input()
k = int(input())

for i in s:
    if i != '1':
        ans = int(i)
        break

print (i)


### FIXED CODE ###

a,b = map(int,input().split())

print((a-1)*(b-1))
import sys
import math
from collections import deque

input = sys.stdin.readline

N = int(input())
a = [int(x) for x in input().split()]
q = deque(a)

while len(q) > 1:
    x = q.popleft()
    y = q.popleft()
    z =  math.gcd(x, y)
    q.append(z)

ans = q.popleft()
print(ans)

### FIXED CODE ###

import sys
import fractions
from collections import deque

input = sys.stdin.readline

N = int(input())
a = [int(x) for x in input().rstrip("\n").split()]
q = deque(a)

while len(q) > 1:
    x = q.popleft()
    y = q.popleft()
    z =  fractions.gcd(x, y)
    q.append(z)

ans = q.popleft()
print(ans)
a, b, c = [int(x) for x in input().split()]

from math import gcd

def foo(a, b, c):
    if a == 1:
        return "YES"
    elif b == 1:
        return "NO"
    elif gcd(a, b) ==1:
        return "NO:
    else:
        return "YES"

print(foo(a, b, c))

### FIXED CODE ###

a, b, c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
    print("YES")
else:
    print("NO")
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in sorted(list(set(lst[:K]+lst[-K:]))):
    print(i)

### FIXED CODE ###

from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
ran = range(A,B+1)
for i in sorted(set(ran[:K])|set(ran[-K:])):
    print(i)
import math
r = int(input())
print('%.5f %.5f' % (r * r * math.pi, 2 * r * math.pi))

### FIXED CODE ###

import math
r = float(input())
print('%.5f %.5f' % (r * r * math.pi, 2 * r * math.pi))
# 常備セット
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import copy as cp
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

n,wmax = imap()
wv = np.array([iarr() for i in range(n)])
w,v = wv.T[0], wv.T[1]
#dp = np.zeros((n+1, wmax+1),dtype=np.int64)
dp = [[0 for ww in range(wmax+1)] for i in range(n+1)]

for i in range(n):
    for ww in range(wmax+1):
        dp[i+1][ww] = max(dp[i][ww], dp[i][ww-w[i]]+v[i]) if ww-w[i]>=0 else dp[i][ww]

ans = dp[n][wmax]
print(ans)


### FIXED CODE ###

n,w_lim = map(int,input().split())
dp = [[0 for i in range(w_lim+1)] for i in range(n+1)]

w,v = [],[]
for i in range(n):
    ww,vv = map(int,input().split())
    w.append(ww)
    v.append(vv)

#初期条件
for ww in range(w_lim+1): dp[0][ww] = v[0] if ww>=w[0] else 0

#漸化式
for i in range(n-1):
    for ww in range(w_lim+1):
        dp[i+1][ww] = dp[i][ww] if w[i+1]>ww else max(dp[i][ww], dp[i][ww-w[i+1]]+v[i+1])

ans = dp[n-1][w_lim]
print(ans)
import math
from collections import deque

H,W = map(int, input().split())
ch,cw = map(int,input().split())
dh,dw = map(int, input().split())

#input maze information
s = ["#"*(W+4)]
s.append("#"*(W+4))
for i in range(H):
    s.append("##"+input()+"##")
s.append("#"*(W+4))
s.append("#"*(W+4))

ans = [[-1]*(W*4) for _ in range(H+4)]
for i in range(H+4):
    for j in range(W+4):
        if s[i][j] == "#":
            ans[i][j] = -2 #壁があるところは−２と重みをつけておく

ch += 1
cw += 1
dh += 1
dw += 1
ans[ch][cw]=0

move = [[-1,0],[1,0],[0,1],[0,-1]]
magic = [
    [-2,-2],[-2,-1],[-2,0],[-2,1],[-2,2],\
    [-1,-2],[-1,-1],[-1,0],[-1,1],[-1,2],\
    [0,-2],[0,-1],[0,0],[0,1],[0,2],\
    [1,-2],[1,-1],[1,0],[1,1],[1,2],\
    [2,-2],[2,-1],[2,0],[2,1],[2,2]
    ]

list1=deque([])
list2=deque([])
list1.append([ch,cw])

while len(list1)>0:
    x,y = list1.popleft()
    list2.append([x,y])
    for p,q in move:
        v1,v2 = x+p,y+q
        if ans[v1][v2] == -1:
            list1.append([v1,v2])
            ans[v1][v2] = ans[x][y]
    if len(list1)==0:
        while len(list2) > 0:
            x2,y2 = list2.popleft()
            for v1,v2 in magic:
                i,j = x2+v1,y2+v2
                if ans [i][j] == -1:
                    ans[i][j] = ans[x2][y2]+1
                    list1.append([i,j])
print(ans[dh][dw])


### FIXED CODE ###


from enum import Enum
from queue import Queue
import collections

import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001
N,X,T = list(map(int,input().split()))
print(math.ceil(N/X)*T)
a = [input() for _ in range(int(input()))]
b = [input() for _ in range(int(input()))]
print(max(0, max([ a.count(i) - b.count(i) for i in set(a.extend(b))])))

### FIXED CODE ###

a = [input() for _ in range(int(input()))]
b = [input() for _ in range(int(input()))]
l = list(set(a))
c = max(0, max([a.count(i) - b.count(i) for i in l]))
print(c)
N, M = map(int,input().split())

tg = [list(map(int,input().split())) for _ in range(N)]

#tmpl0〜M-1
tmpl = [list(map(int,input().split())) for _ in range(M)]

#tg0〜N-Mにつき、tmpl0を探し、一致したら同じ添字のtmpl1~M-1を探す
for i in range(0,N-M+1):
  for j in range(0,N-M+1):
    if tmpl[0] == tg[i][j:j+M]:
      for k in range(i+1,i+M):
        if tmpl[k] != tg[i+k][j:j+M]: break
      else:
        print('Yes')
        exit()
print('No')

### FIXED CODE ###

N, M = map(int,input().split())

tg = [input() for _ in range(N)]

#tmpl0〜M-1
tmpl = [input() for _ in range(M)]

#tg0〜N-Mにつき、tmpl0を探し、一致したら同じ添字のtmpl1~M-1を探す
for i in range(0,N-M+1):
  for j in range(0,N-M+1):
    if tmpl[0] == tg[i][j:j+M]:
      if N == 1:
        print('Yes')
        exit()
      for k in range(1,M):
        if tmpl[k] != tg[i+k][j:j+M]: break
      else:
        print('Yes')
        exit()
print('No')
import numpy as np

#N = 39
#S = "RBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB"
N=int(input())
S=input()
r = len(S.replace("G", "").replace("B", ""))
g = len(S.replace("R", "").replace("B", ""))
#b = len(S.replace("R", "").replace("G", ""))
b = N - r - g
 
ans = r * g * b
 
for i in range(N):
    for k in [N - k_ - 1 for k_ in range(N)]:
        tar_j = i + k
        if (tar_j > 2 * i) & (tar_j < 2 * k):
            if np.mod(tar_j, 2) == 0:
                j = int(tar_j / 2)
                s = S[i] + S[j] + S[k]
                if ("R" in s) & ("G" in s) & ("B" in s):
                    ans -= 1
        else:
            break
print(ans)


### FIXED CODE ###


#S = "RBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB"# * 1000
#N = len(S)

N=int(input())
S=input()
r = len(S.replace("G", "").replace("B", ""))
g = len(S.replace("R", "").replace("B", ""))
b = N - r - g
 
ans = r * g * b
 
is_break = False
for i in range(N):
    for j in range(i, int((N+i)/2 + 1)):
        k = 2 * j - i
        if k < N:
            s = S[i] + S[j] + S[k]
            if ("R" in s) & ("G" in s) & ("B" in s):
                    ans -= 1

print(ans)
#!/opt/local/bin/python
from math import pi
a = raw_input()
print"%f %f" %(pi*int(a)**2.0,2.0*pi*int(a))

### FIXED CODE ###

#!/opt/local/bin/python
import math
a = raw_input()
print"%f %f" %(math.pi*float(a)**2.0,2.0*math.pi*float(a))
input_line=input().rstrip().split(" ")
a=int(input_line[0])
b=int(input_line[1])
c=int(input_line[2])
if a==b==5 or a==c==5 or b==C==5:
    if a+b+c==17:
        print("YES")
else:
    print("NO")

### FIXED CODE ###

input_line=input().rstrip().split(" ")
five=int(input_line.count("5"))
seven=int(input_line.count("7"))
if five==2 and seven==1:
    print("YES")
else:
    print("NO")
a,b,c=map(int,raw_input().split())
if(a<b and b<c) :
	print 'Yes'
else
	print 'No'

### FIXED CODE ###

a,b,c=map(int,raw_input().split())
if(a<b and b<c) :
	print 'Yes'
else:
	print 'No'
def dfs(node, color=0):
    colors[node] = color
    for next_n, weight in graph.get(node, set()):
        if colors[next_n] != -1:
            continue
        if weight % 2 == 0:
            color = colors[node]
        else:
            color = 1 if colors[node] == 0 else 0
        colors[next_n] = color
        dfs(next_n, color)


N = int(input())
u_v_w_l = [map(int, input().split()) for _ in range(N - 1)]

graph = {}
for u, v, w in u_v_w_l:
    u, v = u - 1, v - 1
    u_set = graph.get(u, set())
    u_set.add((v, w))
    v_set = graph.get(v, set())
    v_set.add((u, w))
    graph[u] = u_set
    graph[v] = v_set

colors = [-1 for _ in range(N)]

if N == 1:
    colors[0] = 0
else:
    for n in range(N):
        if colors[n] != -1:
            continue
        dfs(n)

for c in colors:
    print(c)


### FIXED CODE ###

from collections import deque

N = int(input())
graph = [[] for _ in range(N)]
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    u, v = u - 1, v - 1
    graph[u].append([v, w])
    graph[v].append([u, w])

colors = [-1 for _ in range(N)]
stack = deque()
stack.append(0)
colors[0] = 0

while stack:
    n = stack.popleft()
    for _next, w in graph[n]:
        if colors[_next] != -1:
            continue
        colors[_next] = (colors[n] + w) % 2
        stack.append(_next)

for c in colors:
    print(c)
n = int(input())
h = map(int, input().split())

for i in range(1,n):
    if h[n-i] < h[n-i+1]:
        ans = i
        break
print(ans)

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))

ans = 0
mx = h[0]
for i in range(n):
    if h[i] >= mx:
        ans = ans + 1
        mx = h[i]
print(ans)
s = input()
dp = [[0 for i in range(13)] for i in range(len(s))]
if s[-1] != "?":
    r_0 = int(s[-1]) % 13
    dp[0][r_0] += 1
else:
    for k in range(10):
        r_0 = k % 13
        dp[0][r] += 1

for i in range(1,len(s)):
    for r in range(13):
        if s[-(i+1)] != "?":
            j = (int(s[-(i+1)]) * (10**i) + r) % 13
            dp[i][j] += dp[i-1][r]
        else:
            for k in range(10):
                j = (k * (10**i) + r) % 13
                dp[i][j] += dp[i-1][r]
print(dp[len(s)-1][5]%(10**9+7))


### FIXED CODE ###

s = input()
dp = [[0 for i in range(13)]]
if s[-1] != "?":
    dp[0][int(s[-1]) % 13] += 1
else:
    for k in range(10):
        dp[0][k % 13] += 1
        
d = [1]   
for i in range(1,len(s)):
    dp.append([0]*13)
    d.append(d[i-1]*10 % 13)
    for r in range(13):
        if s[-(i+1)] == "?":
            for k in range(10): 
                dp[i][(k * d[i] + r) % 13] += dp[i-1][r] % (10**9 + 7)
                
        else:
            dp[i][(int(s[-(i+1)]) * d[i] + r) % 13] += dp[i-1][r] % (10**9 + 7)

print(dp[len(s)-1][5]%(10**9+7))
x,y=map(int,input().split())
if x>y:
  print(">")
elif x<y:
  print("<")
else:
  print("=")

### FIXED CODE ###

x,y=input().split()
if x>y:
  print(">")
elif x<y:
  print("<")
else:
  print("=")
# -*- coding: utf-8 -*-

import sys

for line in sys.stdin.readlines():
    #List = map(int, line.strip().split())
    
    seq = raw_input().strip()
    print seq[::-1]

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys

for line in sys.stdin.readlines():
    #List = map(int, line.strip().split())
    
    seq = line.strip()
    print seq[::-1]
N=int(input())
T=int(input())
check=1
ansc=1001

for i in range(N):
    c=int(input())
    t=int(input())

    if t<T and c<ansc:
        ansc=c
        T=t
        check=0

if check==0:
    print(ansc)
else:
    print('TLE')

### FIXED CODE ###

N,T=map(int,input().split())

C=[]

for i in range(N):
    c,t=map(int,input().split())

    if t<=T:
        C.append(c)

if not C:
    print('TLE')
else:
    print(min(C))
import math
def pri(n):
    if n < 2:
        return False
    elif n == 2:
        return True
    elif n % 2 == 0:
        return False

    i = 3
    while i <= math.sqrt(n):
        if n % i == 0:
            return False
        i += 2
    return True

l=[i for i in range(110000)if pri(i) ]

while True:
    n = int(input())
    if n == 0: break
    print(sum(l[:n]))

### FIXED CODE ###

def pri(s,n): 
    tab=[i for i in range(n+1) if s[i] and i>=2]
    return(tab)
 
s=[True for _ in range(999999+1)]
i=2
while i**2<=999999:
    if s[i]:
        j=i*2
        while j<=999999:
            s[j]=False
            j+=i
    i+=1

while True:
    try:
        print(len(pri(s,int(input()))))
    except:
        break
A = int(input())
B = int(input())

count = 0
for i in range (A,B,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)

### FIXED CODE ###

i = list(map(int, input().split()))
A = i[0]
B = i[1]

count = 0
for i in range (A,B+1,1):
    I = str(i)
    if int(I[-1]) == int(I[-5]) and int(I[-2]) == int(I[-4]):
        count = count + 1
    else :
        pass

print(count)
a=int(input())
b=int(input())
c=1
for i in round(3):
  if a==c or b==c:
    c=c+1
  else:
    print(c)
    break


### FIXED CODE ###

a=int(input())
b=int(input())
c=1
for i in range(3):
  if a==c or b==c:
    c=c+1
  else:
    print(c)
    break
N = int(input())

Soinsuu = [1]

for i in range(2, N+1):
    while N % i == 0:
        Soinsuu.append(i)
        N = N // i
    else:
        if N == 1:
            break

Soinsuu.sort(reverse=True)

a = Soinsuu[0]
b = Soinsuu[1]

for i in Soinsuu[2:]:
    if a > b:
        b *= i
    else:
        a *= i
        
print(max(len(str(a)), len(str(b))))


### FIXED CODE ###

import math
N = int(input())
for i in range(1, int(math.sqrt(N))+1):
    if N % i == 0:
        ans = len(str(N//i))
        
print(ans)
import math
 
a_0, b_0 = input().split()
a = int(a_0)


small = str(a*int(b_0[-2:]))



ans = a*int(b_0[0:-3]) +int(small[:-2])
print(ans)

### FIXED CODE ###

import math
 
a_0, b_0 = input().split()
a = int(a_0)

small = str(a*int(b_0[-2:]))


if len(small) >= 3:
  ans = a*int(b_0[0:-3]) +int(small[:-2])
else:
  ans = a*int(b_0[0:-3])
print(ans)
from math import gcd

def factorization(n):
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n //= i
            e[i] = max(e[i], cnt)

    if n != 1:
        e[n] = max(e[n], 1)


def mod_pow(a, n):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


n = int(input())
a = list(map(int, input().split()))

mod = 10 ** 9 + 7
e = [0] * 10 ** 6

for v in a:
    factorization(v)

lcm = 1
for i, c in enumerate(e):
    if c > 0:
        lcm = lcm * mod_pow(i, c) % mod

res = 0
for v in a:
    res = (res + lcm * mod_pow(v, mod - 2)) % mod

print(res)

### FIXED CODE ###

def factorization(n):
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n //= i
            e[i] = max(e[i], cnt)

    if n != 1:
        e[n] = max(e[n], 1)


def mod_pow(a, n):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


n = int(input())
a = list(map(int, input().split()))

mod = 10 ** 9 + 7
e = [0] * 10 ** 6

for v in a:
    factorization(v)

lcm = 1
for i, c in enumerate(e):
    if c > 0:
        lcm = lcm * mod_pow(i, c) % mod

res = 0
for v in a:
    res = (res + lcm * mod_pow(v, mod - 2)) % mod

print(res)
input()
 
if s == 'SUN':
  print(0)
elif s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s == 'WED':
  print(4)
elif s == 'THU':
  print(3)
elif s == 'FRI':
  print(2)
elif s == 'SAT':
  print(1)
else:
  pass

### FIXED CODE ###

s = input()
 
if s == 'SUN':
  print(7)
elif s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s == 'WED':
  print(4)
elif s == 'THU':
  print(3)
elif s == 'FRI':
  print(2)
elif s == 'SAT':
  print(1)
from sys import stdin
H, A = map(int,stdin.readline().rstrip().split)

a = 0
while True
  if x <= H/A:
    H - A
    a += 1
  else:
    break
print(a)

### FIXED CODE ###

H, A = map(int, input().split())

x = 0
while True:
  if H <= 0:
    break
  if H > 0:
    H -= A
    x += 1
print(x)
ans = 0
for i in range(L,R+1):
    if i%d==0:
        ans += 1
print(ans)

### FIXED CODE ###

def solve():
    L, R, d = map(int, input().split())
    ans = R//d-(L-1)//d
    return ans
print(solve())
A, B = map(int, input())
C = A - B*2

if C >= 0:
  print(C)
else:
  print(0)

### FIXED CODE ###

A, B = map(int, input().split())
C = A - B*2

if C >= 0:
  print(C)
else:
  print(0)
n = int(input())
r = [0] * (n - 1)
for i in range(n - 1):
  r[i] = i + 1
print(sum(r))

### FIXED CODE ###

n = int(input())
print(n * (n - 1) // 2)
md = 10 ** 9 + 7
n = int(input())
s = input()
dp = [1] * n
for i in range(n - 1):
    if s[i] == "<":
        s = dp[0]
        for dpi in range(1, n - i - 1):
            dp[dpi] = s = (dp[dpi] + s) % md
        dp = dp[:-1]
    else:
        s = dp[-1]
        for dpi in range(n - i - 2, 0, -1):
            dp[dpi] = s = (dp[dpi] + s) % md
        dp = dp[1:]
print(dp[0])


### FIXED CODE ###

md = 10 ** 9 + 7
n = int(input())
s = input()
dp = [1] * n
for i in range(n - 1):
    if s[i] == "<":
        for dpi in range(1, n - i - 1):
            dp[dpi] = (dp[dpi] + dp[dpi - 1]) % md
        dp = dp[:-1]
    else:
        for dpi in range(n - i - 2, 0, -1):
            dp[dpi] = (dp[dpi] + dp[dpi + 1]) % md
        dp = dp[1:]
print(dp[0])
def inpl(): return list(map(int, input().split()))

W, H, N = inpl()
l, r, d, u = 0, W, 0, H

for _ in range(N):
    x, y, a = inpl()
    if a == 0:
        l = max(l, a)
    elif a == 1:
        r = min(r, a)
    elif a == 2:
        d = max(d, a)
    else:
        assert a == 3
        u = min(u, a)
print((r-l)*(u-d))

### FIXED CODE ###

def inpl(): return list(map(int, input().split()))

W, H, N = inpl()
l, r, d, u = 0, W, 0, H

for _ in range(N):
    x, y, a = inpl()
    if a == 1:
        l = max(l, x)
    elif a == 2:
        r = min(r, x)
    elif a == 3:
        d = max(d, y)
    else:
        assert a == 4
        u = min(u, y)
print(max((r-l), 0)*max((u-d), 0))