Harryxun/stf_run huggingface dataset:
H, W = map(int, input().split())
maze = []
for i in range(H):
    maze.append(list(input()))

import numpy as np    
from collections import deque

s = (2, 0)

def dfs(s, maze):
    H, W = maze.shape

    visited = np.array([[-1 for _ in range(W)] for _ in range(H)])
    visited[s[0]][s[1]] = 0

    actions = [(-1,0),(1,0),(0,-1),(0,1)]
    queue = deque([s])

    while queue:
        c = queue.popleft()
        for action in actions:
            nc = [0,0]
            nc[0] = c[0] + action[0]
            nc[1] = c[1] + action[1]
            if nc[0] in range(H) and nc[1] in range(W) and maze[tuple(nc)]=='.' and visited[tuple(nc)]==-1:
                visited[tuple(nc)] = visited[tuple(c)] + 1
                queue.append(nc)
    return np.max(visited)

ret = -1

for sx in range(H):
    for sy in range(W):
        if maze[sx][sy] == '.':
            ret = max(dfs((sx,sy), maze), ret)
print(ret)  

### FIXED CODE ###

import numpy as np
n, m = map(int, input().split())
g = [input() for _ in range(n)]
maze = np.array(list(map(list, g)))

from collections import deque


def dfs(s, maze):
    H, W = maze.shape

    visited = np.array([[-1 for _ in range(W)] for _ in range(H)])
    visited[s[0]][s[1]] = 0

    actions = [(-1,0),(1,0),(0,-1),(0,1)]
    queue = deque([s])

    while queue:
        x,y = queue.popleft()
        for action in actions:
            nx = x + action[0]
            ny = y + action[1]
            if nx in range(H) and ny in range(W) and maze[(nx,ny)]=='.' and visited[(nx,ny)]==-1:
                visited[(nx,ny)] = visited[(x,y)] + 1
                queue.append((nx,ny))
    return np.max(visited)
    
ret = -1
H, W = maze.shape

for sx in range(H):
    for sy in range(W):
        if maze[sx][sy] == '.':
            ret = max(dfs((sx,sy), maze), ret)
print(ret)
X,N,*P = map(int,open(0).read().split())
if P != []:
  P = sorted(list(map(int,P.split())),reverse=True)
else:
  print(X)
  exit()

min_diff = 101
min_val = 101

if N == 100:
  if X <=50:
    ans = 0
  else:
    ans = 101
else:
  for i in range(100,-1,-1):
    #print(i,min_val,min_val)
    if not i in P:
      if abs(X-i) <= min_diff and min_val >i:
      	min_diff = abs(X-i)
      	min_val = i
  ans = min_val
print(ans)

### FIXED CODE ###

X,N,*P = map(int,open(0).read().split())
if P != []:
  P = sorted(list(P),reverse=True)
else:
  print(X)
  exit()

min_diff = 101
min_val = 101

for i in range(101,-1,-1):
  #print(i,min_val,min_val)
  if not i in P:
    if abs(X-i) <= min_diff and min_val >=i:
      min_diff = abs(X-i)
      min_val = i
  ans = min_val
print(ans)
n, y = map(int, input().split())



def helper(n,y):
    for ten in range(y,-1,-1):

        for five in range(y-ten, -1,-1):
            
            sum = 10000*ten + 5000*five + 1000*one

            if n < sum:
                continue

            if n == sum:
                return('{} {} {}'.format(ten,five,one))

            else:
                return ('-1 -1 -1')

    return('-1 -1 -1')

print(helper(n,y))

### FIXED CODE ###

n, y = map(int, input().split())

def helper(n,y):

    for ten in range(n,-1,-1):
        for five in range(n-ten, -1,-1):


            one = n-ten-five
            sum = 10000*ten + 5000*five + 1000*one

            if y == sum:
                return('{} {} {}'.format(ten,five,one))


    return('-1 -1 -1')

print(helper(n,y))
n = input()

color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
t = 0

def dfs_v(u):
  color[u] = 1
  t += 1
  d[u] = t
  for v in range(n):
    if M[u][v] == 1 and color[v] == 0:
      dfs_v(v)
  color[u] = 2
  t += 1
  f[u] = t

def dfs():
  for u in range(n):
    if color[u] == 0:
      dfs_v(u)
  for u in range(n):
    print u+1, d[u], f[u]

for i in range(n):
  X = map(int, raw_input().split())
  for j in range(X[1]):
    M[X[0]-1][X[2+j]-1] = 1

dfs()
    

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
#-------------------------------------------------------------------
def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            if i != n // i:
                divisors.add(n//i)
    return divisors
#-------------------------------------------------------------------
def is_prime(n):
    if n == 2: return True
    if n == 1 or n & 1 == 0: return False
 
    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1
 
    for k in range(100):
        a = random.randint(1, n - 1)
        t = d
        y = pow(a, t, n)
 
        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1
 
        if y != n - 1 and t & 1 == 0:
            return False
 
    return True

#-------------------------------------------------------------------
#Python -3.4.x
from fractions import gcd
#-------------------------------------------------------------------
import sys
def p(*_a):
  _s=" ".join(map(str,_a))
  #print(_s)
  sys.stderr.write(_s+"\n")
#-------------------------------------------------------------------
a,b = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

g=gcd(a,b)
#p('g ', g)
L=make_divisors(g)

#p( gcd(a,b) )
#p( L )

ans=1
for l in L:
	#if a%l==0 and b%l==0: ans+=1
	if is_prime(l): ans+=1

print(ans)


### FIXED CODE ###

#-------------------------------------------------------------------
def make_divisors(n):
    divisors = set()
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.add(i)
            if i != n // i:
                divisors.add(n//i)
    return divisors
#-------------------------------------------------------------------
import random
def is_prime(n):
    if n == 2: return True
    if n == 1 or n & 1 == 0: return False
 
    d = (n - 1) >> 1
    while d & 1 == 0:
        d >>= 1
 
    for k in range(100):
        a = random.randint(1, n - 1)
        t = d
        y = pow(a, t, n)
 
        while t != n - 1 and y != 1 and y != n - 1:
            y = (y * y) % n
            t <<= 1
 
        if y != n - 1 and t & 1 == 0:
            return False
 
    return True

#-------------------------------------------------------------------
#Python -3.4.x
from fractions import gcd
#-------------------------------------------------------------------
import sys
def p(*_a):
  _s=" ".join(map(str,_a))
  #print(_s)
  sys.stderr.write(_s+"\n")
#-------------------------------------------------------------------
a,b = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7

g=gcd(a,b)
#p('g ', g)
L=make_divisors(g)

#p( gcd(a,b) )
#p( L )

ans=1
for l in L:
	#if a%l==0 and b%l==0: ans+=1
	if is_prime(l): ans+=1

print(ans)
n=int(input())
a=list(map(int,input().split()))
m=max(a)
cou=[0]*m
for i in range(m):
  cou[i]=a.count(i-1)+a.count(i)+a.count(i+1)
print(max(cou))

### FIXED CODE ###

import collections

n=int(input())
a=list(map(int,input().split()))
m=max(a)
cnt=collections.Counter(a)
if m==0:
  print(len(a))
else:
  ans=[0]*(m-1)
  for j in range(m-1):
    ans[j]=cnt[j]+cnt[j+1]+cnt[j+2]
  print(max(ans))
x=input(xを入力してください)
if x==1:
  print("0")
 elif x==0:
  print("1")

### FIXED CODE ###

x=int(input())
if x==1:
  print("0")
if x==0:
  print("1")
n = int(input())
A = list(map(int,input().split()))

ans = 1
for i in range(n):
    ans = ans * a[i]
    
if ans <= 1e18:
    print(ans)  
else:
    print(-1)


### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
A.sort()
if A[0]==0:
    print(0)
    exit()

ans = 1
for i in A:
    ans*=i
    if ans>1e18:
        print(-1)
        exit()

print(ans)
A = int(input())
B = int(input())
print(A*B)


### FIXED CODE ###

A, B=map(int, input().split())
print(A*B)
def root(i):
  if par[i] == i:
    return i
  par[i] = root(par[i])
  return par[i]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[ry] = rx

def same(x, y):
  return par[x] == par[y]

n,m = map(int, input().split(" "))
p = [0] + list(map(int, input().split(" ")))
a = [(list(map(int, input().split(" ")))) for i in range(m)]
par = list(range(n + 1))
count = 0
for i, j in a:
  union(i, j)
  #print(par)
#print(p)
for i in range(1, n + 1):
  if same(root(par[p[i]]), root(par[i])):
    count += 1
print(count)

### FIXED CODE ###

import sys
import resource

def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0

sys.setrecursionlimit(10 ** 6)
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))
#print(countpar, par)
cx1, cy1, r1 = map(float, raw_input().split())
cx2, cy2, r2 = map(float, raw_input().split())

import math
distance = math.sqrt( math.pow(cx1-cx2, 2) + math.pow(cy1-cy2, 2) )
rsum = r1 + r2
rmax = math.max(r1, r2)
rmin = math.min(r1, r2)

import sys
if distance > rsum:
  print(4)
elif abs(distance - rsum) < sys.float_info.epsilon:
  print(3)
else:
  if rmax < distance + rmin:
    print(2)
  elif abs(rmax - distance - rmin) < sys.float_info.epsilon:
    print(1)
  else:
    print(0)


### FIXED CODE ###


cx1, cy1, r1 = map(float, input().split())
cx2, cy2, r2 = map(float, input().split())

import math
distance = math.sqrt( math.pow(cx1-cx2, 2) + math.pow(cy1-cy2, 2) )
rsum = r1 + r2
rmax = max(r1, r2)
rmin = min(r1, r2)

import sys
if distance > rsum:
  print(4)
elif abs(distance - rsum) < sys.float_info.epsilon:
  print(3)
else:
  if rmax < distance + rmin:
    print(2)
  elif abs(rmax - distance - rmin) < sys.float_info.epsilon:
    print(1)
  else:
    print(0)
N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
print(s)

### FIXED CODE ###

N=int(input())
for i in range(1,N+1):
    if i*i>N:
        s=(i-1)**2
        break
if N==1:
    print(N)
else:
    print(s)
def add_node_2_tree_dic(tree_dic, x, y):
    if x not in tree_dic:
        tree_dic[x] = [y]
    else:
        tree_dic[x].append(y)

#   深さ優先探索で行けそう

N = int(input())
tree_dic = {}
for _ in range(N-1):
    a, b = map(int, input().split())
    add_node_2_tree_dic(tree_dic, a, b)
    add_node_2_tree_dic(tree_dic, b, a)

c_lst = list(map(int, input().split()))
c_lst.sort()
ans_lst = [0]*N

def search_next_node_and_add_side_wate(tree_dic, ans, current_node, c_lst, ans_lst):
    tmp_lst = tree_dic[current_node][:]

    for next_node in tmp_lst:
        try:
            c = c_lst.pop()
            ans += c
            ans_lst[next_node - 1] = c

            tree_dic[current_node].remove(next_node)    #   今回通った枝を取り払う
            tree_dic[next_node].remove(current_node)
        except:
            return ans
            
        if len(tree_dic[current_node]) == 0:
            del tree_dic[current_node]#   探索し終えたノードの削除
        if len(tree_dic[next_node]) == 0:
            del tree_dic[next_node]#   探索し終えたノードの削除
            
        else:   #   次のノードにつながっている辺があるとき
            ans = search_next_node_and_add_side_wate(tree_dic, ans, next_node, c_lst, ans_lst)


    return ans


ans = 0
current_node = 1
ans_lst[0] = c_lst.pop()
ans = search_next_node_and_add_side_wate(tree_dic, ans, current_node, c_lst, ans_lst)


ans_str = ""
for i in range(N):
    ans_str += str(ans_lst[i])
    if i != N - 1:
        ans_str += " "


print(ans)
print(ans_str)



### FIXED CODE ###

import sys
sys.setrecursionlimit(20000)

def add_node_2_tree_dic(tree_dic, x, y):
    if x not in tree_dic:
        tree_dic[x] = [y]
    else:
        tree_dic[x].append(y)

#   深さ優先探索で行けそう

N = int(input())
tree_dic = {}
for _ in range(N-1):
    a, b = map(int, input().split())
    add_node_2_tree_dic(tree_dic, a, b)
    add_node_2_tree_dic(tree_dic, b, a)

c_lst = list(map(int, input().split()))
c_lst.sort()
ans_lst = [0]*N

def search_next_node_and_add_side_wate(tree_dic, ans, current_node, c_lst, ans_lst):
    next_node_lst = tree_dic[current_node][:]

    for next_node in next_node_lst:
        c = c_lst.pop()
        ans += c
        ans_lst[next_node - 1] = c

        tree_dic[current_node].remove(next_node)    #   今回通った枝を取り払う
        tree_dic[next_node].remove(current_node)

        if len(tree_dic[current_node]) == 0:
            del tree_dic[current_node]#   探索し終えたノードの削除
        if len(tree_dic[next_node]) == 0:
            del tree_dic[next_node]#   探索し終えたノードの削除
        else:   #   次のノードにつながっている辺があるとき
            ans = search_next_node_and_add_side_wate(tree_dic, ans, next_node, c_lst, ans_lst)

    return ans


ans = 0
current_node = 1
ans_lst[0] = c_lst.pop()
ans = search_next_node_and_add_side_wate(tree_dic, ans, current_node, c_lst, ans_lst)


ans_str = ""
for i in range(N):
    ans_str += str(ans_lst[i])
    if i != N - 1:
        ans_str += " "


print(ans)
print(ans_str)
abc = list(map(int, input().split()))
abc = sort(abc)
abc = abc[:,:,-1]
print(abc[0]*10+abc[1]+abc[2])

### FIXED CODE ###

abc = list(map(int, input().split()))
abc = sorted(abc)
print(abc[2]*10+abc[1]+abc[0])
data =input()
data = list(data)
deter =""


if len(data) >9 :
  print("NO")
if len(data) >=5 and len(data)<=9:
  if data[0] !="A":
    data.insert(0,"A")
  if data[4] !="A":
    data.insert(4,"A")
  if data[6] !="A":
    data.insert(6,"A")
  if len(data) ==8:
    data.append("A")
  else:
    if data[8] !="A":
      data.insert(8,"A")
 
  for s in range(len(data)):
    deter +=data[s]
   
  if deter =="AKIHABARA":
    print("YES")

 
if len(data) <=4:
  print("NO")


### FIXED CODE ###

data =input()
data = list(data)
deter =""
cnt2 =0
cnt =[0]*5
cnt3 =0
for t in range(len(data)):
  if data[t] =="I":
    cnt[0] +=1
  if data[t] =="K":
    cnt[1] +=1
  if data[t] =="H":
    cnt[2] +=1
  if data[t] =="B":
    cnt[3] +=1
  if data[t] =="R":
    cnt[4] +=1
  
if cnt[0] ==1 and cnt[1] ==1 and cnt[2] ==1 and cnt[3] ==1 and cnt[4] ==1:
  cnt2 +=1 

if len(data) >9 or cnt2 ==0 :
  print("NO")
  cnt3 +=1
if len(data) >=5 and len(data)<=9  and cnt2 ==1:
  if data[0] !="A":
    data.insert(0,"A")
  if data[4] !="A":
    data.insert(4,"A")
  if data[6] !="A":
    data.insert(6,"A")
  if len(data) ==8:
    data.append("A")
  else:
    if data[8] !="A":
      data.insert(8,"A")
 
  for s in range(len(data)):
    deter +=data[s]
  
  if deter =="AKIHABARA":
    print("YES")
  else:
    print("NO")

 
if len(data) <=4 and cnt3==0:
  print("NO")
s = input()
p = input()
ret = 'No'
tts = s + s[:len(p)]
if p in tts: ret = 'Yes'
print(ret)


### FIXED CODE ###

import string
x = ''
allcase = string.ascii_lowercase
while True:
    try: x+=input().lower()
    except:break
for letter in allcase:
    print(letter + " : " + repr(x.count(letter)))
N = int(input())
A = [int(x) for x in input().split(" ")]
result = 1
for idx in A:
	result *= idx
if result <= 10**18:
	print(result)
else:
 	print(-1)

### FIXED CODE ###

data = input().split(" ")
a ,b= int(data[0]) , int(data[1])
print(a*b)
import itertools
N,M,X = map(int,input().split())
A = [0,0,0,0]
C = []
Z = []
cz = []
for i in range(N) :
    C.append(list(map(int,input().split())))

for i in range(2,N+1) :
    c = list(itertools.combinations(C,i))
    for j in range(len(c)) :
        A = [0,0,0,0]
        cj = c[j]
        for k in range(i) :
            ck = cj[k]
            A[0]+= ck[0]
            A[1] += ck[1]
            A[2] += ck[2]
            A[3] += ck[3]
        Z.append(A)

for i in range(len(Z)) :
    zi = Z[i]
    if zi[1]>=X and zi[2]>=X and zi[3]>=X :
        cz.append(zi[0])        

if len(cz) == 0 :
    print(-1)
else :
    print(min(cz))


### FIXED CODE ###

import numpy
N,M,X = map(int,input().split())
A = numpy.array([[int(i) for i in input().split()] for _ in range(N)])
ans = 10**8
for i in range(2**N) :
    i = format(i,'b').zfill(N)
    check = numpy.array([0]*(M+1))
    for j in range(N) :
        if i[j] == '0' :
            continue
        check +=  A[j][0:]
    if all (check[m] >= X for m in range(1,M+1)) :
        ans = min(ans,check[0])

if ans == 10**8 :
    print(-1)
else :
    print(ans)
N, M, K = list(map(int, input().split()))

mod = 998244353


def factorial(x, p):
    a = 1
    for i in range(1, x + 1):
        a *= i
        a %= p
    return a


def comb(a, b, p):
    if a < 0 or b < 0:
        return 0
    elif a < b:
        return 0
    c = 1
    c *= factorial(a, p)
    c *= pow(factorial(b, p), p - 2, p)
    c *= pow(factorial(a - b, p), p - 2, p)
    return c % p


ans = 0
ans += M * pow(M-1, N-1)
ans %= mod

for k in range(1, K+1):
    ans += comb(N-1, k, mod) * (M * pow(M-k, N-1-k)

print(ans % mod)


### FIXED CODE ###

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

mod = 998244353


fac = [0] * (N+1)
fac[0] = 1
fac[1] = 1
for i in range(2, N+1):
    fac[i] = (fac[i-1] * i) % mod


def comb(a, b, p):
    if a < 0 or b < 0:
        return 0
    elif a < b:
        return 0
    c = fac[a]
    c *= pow(fac[b], p - 2, p)
    c *= pow(fac[a-b], p - 2, p)
    return c % p


ans = 0
ans += M * pow(M-1, N-1, mod)
ans %= mod

for k in range(1, K+1):
    ans += comb(N-1, k, mod) * M * pow(M-1, N-1-k, mod)
    ans %= mod

print(ans)
# -*- coding: utf-8 -*-
from collections import deque
from heapq import heappush, heappop, heapify, merge
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)
def inpl(): return tuple(map(int, input().split()))
 
N, M = inpl()
A = inpl()
tree = [[-1, 1]  for _ in range(N)] # [next, rank]

def find(i):
    if tree[i][0] == -1:
        group = i
    else:
        group = find(tree[i][0]) 
        tree[i][0] = group
    return group
  
def unite(x, y):
    px = find(x)
    py = find(y)
      
    if tree[px][1] == tree[py][1]: # rank is same
        tree[py][0] = px
        tree[px][1] += 1
    else:
        if tree[px][1] < tree[py][1]:
            px, py = py, px
        tree[py][0] = px
  
for _ in range(M):
    x, y = tuple(map(int, input().split()))
    if not int(find(x) == find(y)):
        unite(x, y)

D = defaultdict(list)
for n in range(N):
    D[find(n)].append(A[n])

H = []
S = deque([]) # single
for k, v in D.items():
    if len(v) == 1:
        S.append(v)
    else:
        H.append(sorted(v))

heapify(H)

res = 0 
while True:
    if (len(H) == 0) or (len(S) + len(H) <= 1):
        break
    
    if len(S) > 1:
        A = S.leftpop()
    else:
        if len(H) <= 1:
            break
        A = heappop(H)

    B = heappop(H)

    res += A[0] + B[0]
    C = list(merge(A[1:], B[1:]))

    if len(C) == 1:
        S.append(C)
    elif len(C) == 0: # ありえないはず
        pass
    else:
        heappush(H, C)

ok = True
if len(S) > 2:
    print("Impossible")
    ok = False
elif len(S) == 2:
    res += S[0]+S[1]
elif len(S) == 1:
    A = S[0]
    if len(H) == 1:
        B = heappop(H)
        res += A[0] + B[0]
else:
    pass
if ok:
    print(res)

### FIXED CODE ###

# -*- coding: utf-8 -*-
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)
def inpl(): return tuple(map(int, input().split()))
 
N, M = inpl()
A = inpl()
tree = [[-1, 1]  for _ in range(N)] # [next, rank]
 
def find(i):
    if tree[i][0] == -1:
        group = i
    else:
        group = find(tree[i][0]) 
        tree[i][0] = group
    return group
  
def unite(x, y):
    px = find(x)
    py = find(y)
      
    if tree[px][1] == tree[py][1]: # rank is same
        tree[py][0] = px
        tree[px][1] += 1
    else:
        if tree[px][1] < tree[py][1]:
            px, py = py, px
        tree[py][0] = px
  
for _ in range(M):
    x, y = tuple(map(int, input().split()))
    if not int(find(x) == find(y)):
        unite(x, y)
 
D = defaultdict(list)
for n in range(N):
    D[find(n)].append(A[n])
 
H = []
res = 0 

for k, v in D.items():
    v = sorted(v)
    res += v[0]
    H.extend(v[1:])
 
if N < 2*(N-M-1):
    print("Impossible")
elif M == N-1:
    print(0)
else:
    res += sum(sorted(H)[:2*(N-M-1) - len(D.keys())])
    print(res)
N, K = map(int, input().split())
a = []
for _ in range(N):
    a.append(int(input())-K)
    
su = 0
v = [(0, 0)]
for i in range(N):
    su += a[i]
    v.append((su, i+1))
v = sorted(v)

data = [0]*(N+1)

def sumation(i):
    s = 0
    while i > 0:
        s += data[i]
        i -= i & -i
    return s
    
def add(i, x):
    while i <= N:
        data[i] += x
        i += i & -i
ans = 0
for e, i in v:
    ans += sumation(i+1)
    add(i+1, 1)
    
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
a = []
for _ in range(N):
    a.append(int(input())-K)
    
su = 0
v = [(0, 0)]
for i in range(N):
    su += a[i]
    v.append((su, i+1))
v = sorted(v)

data = [0]*(N+5)

def sumation(i):
    s = 0
    while i > 0:
        s += data[i]
        i -= i & -i
    return s
    
def add(i, x):
    while i <= N+2:
        data[i] += x
        i += i & -i
ans = 0
for e, i in v:
    ans += sumation(i+1)
    add(i+1, 1)
    
print(ans)
N,K=map(int,input().split())
H=list(map(int,input().split()))

for i in range(K):
    H.remove(max(H))

print(sum(H))


### FIXED CODE ###

import numpy as np

N,K=map(int,input().split())
H=list(map(int,input().split()))

if K==0:
    print(sum(H))
elif N>K:
    H=sorted(H)
    del H[-K:]
    print(sum(H))
else:
    print(0)
#coding:utf-8

H, W = input().split()
h, w = input().split()

ans = (H - h) * (W - w)
print(ans)

### FIXED CODE ###

#coding:utf-8

H, W = input().split()
h, w = input().split()

ans = ( int(H)-int(h) ) * ( int(W)-int(w) )
print(ans)
n=int(input())
a=list(map(int,input().split()))
a.sort()
k=n//2

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

if n%2==1:
    print(a[-1],a[k])
elif n==2:
    print(a[1],a[0])
else:
    if cmb(a[-1],a[k])>cmb(a[-1],a[k+1]):
        print(a[-1],a[k])
    else:
        print(a[-1],a[k+1])


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
mx=max(a)
d=mx
ans=0
if n==2:
  print(100,0)
  exit()
for i in a:
  if abs(i-mx/2)<d:
    d=abs(i-mx/2)
    ans=i
print(mx,ans)
D, T, S = input().split()
sum = T * S
if D < sum
	return "Yes"
else
	return "No"


### FIXED CODE ###

D, T, S = input().split()
sum_price = int(T) * int(S)
if int(D) <= sum_price:
  print("Yes")
else:
  print("No")