Harryxun/stf_run huggingface dataset:
n,m=map(int, input().split())
ab=[]
for _ in range(n):
    tmpa, tmpb=map(int, input().split())
    ab.append((tmpa,tmpb))
ab.sort(reverse=True)
import heapq
h = []
ans = 0
for i in range(1, m+1):
    print(h)
    while ab and ab[-1][0] == i:
        heapq.heappush(h,ab.pop()[1]*(-1))
    if h:
        ans -= heapq.heappop(h)
print(ans)

### FIXED CODE ###

n,m=map(int, input().split())
ab=[]
for _ in range(n):
    tmpa, tmpb=map(int, input().split())
    ab.append((tmpa,tmpb))
ab.sort(reverse=True)
import heapq
h = []
ans = 0
for i in range(1, m+1):
    while ab and ab[-1][0] == i:
        heapq.heappush(h,ab.pop()[1]*(-1))
    if h:
        ans -= heapq.heappop(h)
print(ans)
w=input()
s=[0]*123
while len(w)==0:
    for i in range(97,97+26):
        if chr(i)==w[0]:
        s[i]+=1
        w=w[1:]
c=1
for i in range(97,97+26):
    if s[i]%2!=0:
        c=0
        break
if c==1:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

w=input()
s=[0]*123
for i in range(len(w)):
    s[ord(w[i-1])]+=1
c=1
for i in range(97,97+26):
    if s[i]%2==1:
        c=0
        break
if c==1:
    print("Yes")
else:
    print("No")
N = int(input())
K = int(input())
result = K
for i in range(N-1) :
    result = result * (K -1)
print(result)

### FIXED CODE ###

N, K = map(int, input().split())
result = K
for i in range(N-1) :
    result = result * (K -1)
print(result)
a,b,k = map(int,input().split())
li = list(range(a,b + 1))
if (b - a + 1) > 2 * k:
    for i in li[:k]:
        print(i)
    for i in li[-k:]:
        print(i)
else:
    for i in li:
        print(i)

### FIXED CODE ###

# coding: utf-8
import re
S = input()
find_a = re.findall("a",S)
find_b = re.findall("b",S)
find_c = re.findall("c",S)
if find_a and find_b and find_c:
    print("Yes")
else:
    print("No")
a=int(input("enter a"))
b=int(input("enter b"))
c=int(input("enter c"))
if a<=100 and a>=-100 and b<=100 and b>=-100 and c<=100 and c>=-100:
    if a==b:
        print(c)
    elif a==c:
        print(b)
    elif c==b:
        print(a)

### FIXED CODE ###

x,y,z=input().split()
x,y,z=int(x),int(y),int(z)
if x==y:
        print(z)
elif x==z:
        print(y)
elif y==z:
        print(x)
c = input()
vowel = ["a", "e", "i", "o", "u"]
if vowel.find(c) == -1:
  print("consonant")
else:
  print("vowel")

### FIXED CODE ###

c = input()
vowel = ["a", "e", "i", "o", "u"]
if c in vowel:
  print("vowel")
else:
  print("consonant")
n,m = map(int, input().split())
if n == 1:
    print(input().split()[0])
else:
    for _ in range(n):
        for i in map(int, set(input().split()[1:])):
            kdict[i] += 1
    print(len([i for i in kdict.values() if i == n]))


### FIXED CODE ###

n,m = map(int, input().split())
if n == 1:
    print(input().split()[0])
else:
    kdict = {i:0 for i in range(1,m+1)}
    for _ in range(n):
        for i in map(int, set(input().split()[1:])):
            kdict[i] += 1
    print(len([i for i in kdict.values() if i == n]))
S = input()
K = int(input())
lc1 = -1
while S[lc1 + 1] == '1':
    lc1 += 1

if lc1 == -1:
    print(S[0])
else:
    print("1" if lc1 + 1 >= K else S[lc1 + 1])


### FIXED CODE ###

S = input()
K = int(input())
firstNot1 = ([i for i in range(len(S)) if S[i] != '1'] + [len(S)])[0]

print('1' if firstNot1 >= K else S[firstNot1])
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

n, x = map(int, input().split())
xlist = list(map(int, input().split()))
for i in range(n):
    xlist[i] = abs(xlist[i]-x)
    
if len(xlist)==1:
    print(xlist[0])
else:
    maxgcd = gcd(xlist[0], xlist[1])
    for i in range(2,n):
        maxgcd = gcd(maxgcd, xlist[i])
    
    
print(maxgcd)

### FIXED CODE ###

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

n, x = map(int, input().split())
xlist = list(map(int, input().split()))
for i in range(n):
    xlist[i] = abs(xlist[i]-x)
    
if len(xlist)==1:
    print(xlist[0])
else:
    maxgcd = gcd(xlist[0], xlist[1])
    for i in range(2,n):
        maxgcd = gcd(maxgcd, xlist[i])
    print(maxgcd)
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())


#n = ip()                              #入力整数1つ
#a,b= (int(i) for i in input().split())      #入力整数横2つ
#n,x,y= (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
a = #input()                                   #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)


#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
s = 0
for i in range(len(a))):
    s+= int(a[0])
j(a%s ==0)

### FIXED CODE ###

from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())


#n = ip()                              #入力整数1つ
#a,b= (int(i) for i in input().split())      #入力整数横2つ
#n,x,y= (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
a = input()                                   #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)


#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
s = 0
for i in range(len(a)):
    s+= int(a[i])
j(int(a)%s ==0)
import math
N = int(input())

if N%2 == 1:
    ans = 0
else:

    df = math.log10(N)
    d = math.floor(df)
    cnt = 0
    for i in range(d,0,-1):
        cnt += (N//10**i) * (10**i-1)//(10-1)
        N/=10**i

print(cnt)

### FIXED CODE ###

N = int(input())

if N%2 == 1:
    cnt = 0
else:
    cnt = 0
    a = 1
    while (5**a)*2<=N:
        cnt += N//((5**a)*2)
        a += 1

print(cnt)
S = input()
if S[-1] = "s"
	print( S + "es" )
else print( S + "s" )


### FIXED CODE ###

S = input()
if S[-1] == "s":
  print( S + "es" )
else: 
  print( S + "s" )
data = list(map(int,"5 7 5".split())
if 2 == data.count(5) and 1 == data.count(7):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

# coding: utf-8

data = list(map(int,input().split()))
if 2 == data.count(5) and 1 == data.count(7):
    print("YES")
else:
    print("NO")
stay = int(input())
change_day = int(input())
first_cost = int(input())
change_cost = int(input())
total_cost = 0

for i in range(stay):
 if(i < change_day):
 total_cost += first_cost
else:
 total_cost += change_cost

print(total_cost)

### FIXED CODE ###

stay = int(input())
change_day = int(input())
first_cost = int(input())
change_cost = int(input())
total_cost = 0
 
for i in range(stay):
 if(i < change_day):
  total_cost += first_cost
 else:
  total_cost += change_cost
print(total_cost)
import sys

K = int(sys.stdin.readline())
S = sys.stdin.readline().rstrip('\n')

# ## COMBINATION (MOD) ###
N_MAX = 10**6  # 問題サイズに合わせて変えておく
MOD = 10**9 + 7

inv = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N_MAX + 1):
    inv.append((-inv[MOD % i] * (MOD // i)) % MOD)

# K 文字追加
ans = 0

ln = len(S)

p1 = 1
p2 = 1
s2 = pow(26, K, MOD)

for i in range(1, K + 2):

    ans += (p1 * p2 * s2) % MOD
    ans %= MOD

    # print(p1, p2, s2)

    # pre
    p1 = (p1 * (ln + i - 1) * inv[i]) % MOD
    p2 = (p2 * 25) % MOD

    # suf
    s2 = (s2 * inv[26]) % MOD

print(ans)


### FIXED CODE ###

import sys

K = int(sys.stdin.readline())
S = sys.stdin.readline().rstrip('\n')

# ## COMBINATION (MOD) ###
N_MAX = 10**6  # 問題サイズに合わせて変えておく
MOD = 10**9 + 7

inv = [0, 1]  # 逆元テーブル計算用テーブル

for i in range(2, N_MAX + 2):
    inv.append((-inv[MOD % i] * (MOD // i)) % MOD)

# K 文字追加
ans = 0

ln = len(S)

p1 = 1
p2 = 1
s2 = pow(26, K, MOD)

for i in range(1, K + 2):

    ans += (p1 * p2 * s2) % MOD
    ans %= MOD

    # print(p1, p2, s2)

    # pre
    p1 = (p1 * (ln + i - 1) * inv[i]) % MOD
    p2 = (p2 * 25) % MOD

    # suf
    s2 = (s2 * inv[26]) % MOD

print(ans)
n,m = map(int,input().split())
edges = []
for _ in range(m):
    edges.append(list(map(int,input().split())))
ans = []
cur = ((m-1)*m)//2
par = {i:i for i in range(1,n+1)}
size = {i:1 for i in range(1,n+1)}
def find(x):
    if x != par[x]:
        par[x] = find(par[x])
    return par[x]

def union(x,y):
    px,py = find(x),find(y)
    res = 0
    if px != py:
        res = size[px]*size[py]
        par[py] = px
        size[px] += size[py]
    return res

for i in range(m-1,-1,-1):
    ans.append(cur)
    x,y = edges[i]
    cur -= union(x,y)
for i in range(m-1,-1,-1):
    print(ans[i])

### FIXED CODE ###

n,m = map(int,input().split())
edges = []
for _ in range(m):
    edges.append(list(map(int,input().split())))
ans = []
cur = ((n-1)*n)//2
par = {i:i for i in range(1,n+1)}
size = {i:1 for i in range(1,n+1)}
rank = {i:0 for i in range(1,n+1)}
def find(x):
    if x != par[x]:
        par[x] = find(par[x])
    return par[x]

def union(x,y):
    px,py = find(x),find(y)
    res = 0
    if px != py:
        res = size[px] * size[py]
        if rank[px] < rank[py]:
            par[px] = py
            size[py] += size[px]
        else:
            par[py] = px
            size[px] += size[py]
            if rank[px] == rank[py]:
                rank[px] += 1
    return res

for i in range(m-1,-1,-1):
    ans.append(cur)
    x,y = edges[i]
    cur -= union(x,y)
for i in range(m-1,-1,-1):
    print(ans[i])
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = s_inpl()   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import math
import copy
from collections import defaultdict, Counter
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
from bisect import bisect_left, bisect_right
import numpy as np

def i_inpl(): return int(input())
def s_inpl(): return map(int,input().split())
def l_inpl(): return list(map(int, input().split()))
INF = float("inf")

N = i_inpl()
F = []
for _ in range(N):
    Fi = l_inpl()
    F.append(Fi)

P = []
for _ in range(N):
    Pi = l_inpl()
    P.append(Pi)


# bit全探索
ans = -1 * INF
for i in range(1, 2<<10):
    tmp = 0
    for j in range(N):
        c = 0
        # NOTE: iとF[j]のAND演算
        for k in range(10):
            if ((i>>k) & 1) & F[j][k]:
                c += 1
        tmp += P[j][c]
    ans = max(ans, tmp)

print(ans)

### FIXED CODE ###

# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = s_inpl()   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import math
import copy
from collections import defaultdict, Counter
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
from bisect import bisect_left, bisect_right
# import numpy as np

def i_inpl(): return int(input())
def s_inpl(): return map(int,input().split())
def l_inpl(): return list(map(int, input().split()))
INF = float("inf")

N = i_inpl()
F = []
for _ in range(N):
    Fi = l_inpl()
    F.append(Fi)

P = []
for _ in range(N):
    Pi = l_inpl()
    P.append(Pi)


# bit全探索
ans = -1 * INF
for i in range(1, 2**10):
    tmp = 0
    for j in range(N):
        c = 0
        # NOTE: iとF[j]のAND演算
        for k in range(10):
            if ((i>>k) & 1) & F[j][k]:
                c += 1
        tmp += P[j][c]
    ans = max(ans, tmp)

print(ans)
import math

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

# S = 'a'*(10**5)
# T = 'a'*(10**5 -1)

if S[0] != T[0]:
    print(-1)
    exit()

gcd = math.gcd(len(S), len(T))
lcm = len(S)*len(T) // gcd

if len(S) == len(T):
    if S == T:
        print(len(S))
    else:
        print(-1)
    exit()


ans = ['' for _ in range(lcm+1)]
tmp1 = ['' for _ in range(lcm+1)]
tmp2 = ['' for _ in range(lcm+1)]
#ans[1] = S[0]

#S
for i in range(0,N):
    L_N = lcm//N
    ind = i * L_N + 1

    tmp1[ind] = S[i:i+1]
for i in range(0,M):
    L_M = lcm//M
    ind = i * L_M + 1

    tmp2[ind] = T[i:i+1]

for i in range(lcm):
    s1,s2 = tmp1[i],tmp2[i]
    if s1 == '' or s2 == '' or s1 == s2:
        continue
    else:
        print(-1)
        exit()
print(lcm)

# for i,s in enumerate(ans):
#     if s != '' and M*(i - 1) % lcm == 0:
#         x = M*(i-1)//lcm
#         if T[x] != s:
#             print(-1)
#             exit()

# # for i in range(0,M):
# #     L_M = lcm//M
# #     ind = i * L_M + 1

# #     if ans[ind] == '':
# #         ans[ind] = T[i:i+1]
# #     elif ans[ind] != T[i:i+1]:
# #         print(-1)
# #         exit()

# print(lcm)


### FIXED CODE ###

import bisect

def gcd(a,b):
    if b == 0:
        return abs(a)
    else:
        return gcd(b, a%b)

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


if S[0] != T[0]:
    print(-1)
    exit()

if len(S) == len(T):
    if S == T:
        print(len(S))
    else:
        print(-1)
    exit()

gcd1 = gcd(len(S), len(T))
lcm = len(S)*len(T) // gcd1

SS = []
TT = []
i = 0
j = 0
while i < N:
    SS.append(i*lcm//N + 1)
    i += 1
while j < M:
    TT.append(j*lcm//M + 1)
    j += 1

ind = 0
ind_max = j-1

for i,v in enumerate(SS):
    ind = bisect.bisect_left(TT, v,ind, j)
    if ind == j:
        break
#    print(ind)
    if TT[ind] == v:
        if S[i] == T[ind]:
            continue
        else:
            print(-1)
            exit()
print(lcm)
class Dice:
    def __init__(self,l1,l2,l3,l4,l5,l6):
        self.l1 = l1
        self.l2 = l2
        self.l3 = l3
        self.l4 = l4
        self.l5 = l5
        self.l6 = l6
        self.top = 1
        self.front = 2
        self.right = 3

    def get_up_front(self):
        return eval("("+"self." + 'l' + str(self.top)+","+"self." + 'l' + str(self.front)+")")

    def get_right(self):
        return eval("self." + 'l' + str(self.right))

    def rot(self):
        self.front,self.right = self.right,7-self.front

    def move(self, order):
        if order == 'S':
            pretop = self.top
            self.top = 7 - self.front
            self.front = pretop
        elif order == 'E':
            pretop = self.top
            self.top = 7 - self.right
            self.right = pretop
        elif order == 'N':
            pretop = self.top
            self.top = self.front
            self.front = 7 - pretop
        elif order == 'W':
            pretop = self.top
            self.top = self.right
            self.right = 7 - pretop

l = list(map(int,input().split()))
q = int(input())
d = Dice(l[0],l[1],l[2],l[3],l[4],l[5])

for i in range(q):
    up,front = list(map(int,input().split()))
    while (up,front) != d.get_up_front():
        for j in range(4):
            d.move('S')
            if up == d.get_up_front()[0]:
                break
        for k in range(4):
            d.rot()
            if front == d.get_up_front()[1]:
                break
    print (d.get_right())

### FIXED CODE ###

class Dice:
    def __init__(self,l1,l2,l3,l4,l5,l6):
        self.l1 = l1
        self.l2 = l2
        self.l3 = l3
        self.l4 = l4
        self.l5 = l5
        self.l6 = l6
        self.top = 1
        self.front = 2
        self.right = 3

    def get_top(self):
        return eval("self." + 'l' + str(self.top))

    def move(self, order):
        if order == 'S':
            pretop = self.top
            self.top = 7 - self.front
            self.front = pretop
        elif order == 'E':
            pretop = self.top
            self.top = 7 - self.right
            self.right = pretop
        elif order == 'N':
            pretop = self.top
            self.top = self.front
            self.front = 7 - pretop
        elif order == 'W':
            pretop = self.top
            self.top = self.right
            self.right = 7 - pretop

l = list(map(int,input().split()))
orders = input()
d = Dice(l[0],l[1],l[2],l[3],l[4],l[5])
for order in orders:
    d.move(order)
print(d.get_top())
n=int(input().strip(EOF))
h=list(map(int,input().split()))
count=flag=0 
for i in range(n-1): 
      if(h[i]>=h[i+1]):
        flag+=1
      else :
        count=flag if(flag>count) else count
        flag=0
print(count)

### FIXED CODE ###

n = int(input())
values = [float(s) for s in input().split(" ")]

start = 0
ans = 0

for i in range(1,n):
    if values[i] > values[i-1]:
        start = i
    ans = max(ans,i-start)
print(ans)
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
BC = [list(map(int,input().split())) for i in range(Q)]
B, C = [list(i) for i in zip(*BC)]
#print(B,C,BC)

dic = {}
for a in A:
  dic[a] = dic.get(a,0) + 1
print(dic)

ans = sum(A)
for q in range(Q):
  ans = ans + (C[q]-B[q]) * dic.get(B[q],0)
  dic[C[q]] = dic.get(B[q],0) + dic.get(C[q],0)
  del dic[B[q]]
  print(ans)



### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Q = int(input())
BC = [list(map(int,input().split())) for i in range(Q)]
B, C = [list(i) for i in zip(*BC)]
#print(B,C,BC)

dic = {}
for a in A:
  dic[a] = dic.get(a,0) + 1
#print(dic)

ans = sum(A)
for q in range(Q):
  ans = ans + (C[q]-B[q]) * dic.get(B[q],0)
  dic[C[q]] = dic.get(B[q],0) + dic.get(C[q],0)
  dic[B[q]] = 0
  print(ans)
import bisect
n = int(input())

li = list(map(int, input().split())).sort()

count = 0

for i in range(n - 2):
  for j in range(i + 1, n - 1):
    bi = bisect.bisect_left(li, li[i] + li[j])
    count += bi - j - 1
print(count)

### FIXED CODE ###

import bisect
n = int(input())

li = list(map(int, input().split()))
li.sort()

count = 0

for i in range(n - 2):
  for j in range(i + 1, n - 1):
    bi = bisect.bisect_left(li, li[i] + li[j])
    count += bi - j - 1
print(count)
{1:14}

A = raw_input('A=')
B = raw_input('B=')

if int(A) == int(B):
  print 'Draw'

elif int(A) ＞ int(B):
  print 'Alice'

elif int(B) ＞ int(A):
  print 'Bob'

### FIXED CODE ###

# -*- coading: utf-8 -#-

A = raw_input()
B = A.split()
C, D = int(B[0]), int(B[1])

if C == 1:
  if D == 1:
    print 'Draw'
  else:
    print 'Alice'
else:
  if D == 1:
    print 'Bob'
  else:
    if C > D:
      print 'Alice'
    elif C < D:
      print 'Bob'
    else:
      print 'Draw'
N=int(input())

for i in range(1,N):
  if i*(i+1)//2 >= N:
    break
    
c = int(i*(i+1)//2 - N)

for j in range(1,i+1):
  if j!=c:
    print(j)

### FIXED CODE ###

N=int(input())
k=1

for i in range(1,N+1):
  if i*(i+1)//2 >= N:
    k=i
    break
    
c = int(k*(k+1)//2 - N)

for j in range(1,k+1):
  if j!=c:
    print(j)
import bisect
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X.copy())
for x in X:
    print(Y[N//2-1] if bisect.bisect(Y, x) >= N//2 else Y[N//2])


### FIXED CODE ###

import bisect
N = int(input())
X = list(map(int, input().split()))
Y = sorted(X.copy())
for x in X:
    print(Y[N//2-1] if bisect.bisect(Y, x) > N//2 else Y[N//2])
n, m, q = map(int, input().split())
req = []
[req.append(tuple(map(int, input().split()))) for _ in range(q)]
a = [0 for _ in range(m)]

def check():
    res = 0
    for i in range(q):
        ra, rb, rc, rd = req[i]
        if a[rb - 1] - a[ra - 1] == rc:
            res += rd
    return res

def set_a(idx: int, au: int):
    ans = 0
    for i in range(au, m + 1):
        a[idx] = i
        if idx + 1 < n:
            ans = max(set_a(idx + 1, i), ans)
        else:
            ans = max(check(), ans)
    return ans

print(set_a(0, 1))


### FIXED CODE ###

n, m, q = map(int, input().split())
req = []
[req.append(tuple(map(int, input().split()))) for _ in range(q)]
a = [0 for _ in range(n)]

def check():
    res = 0
    for i in range(q):
        ra, rb, rc, rd = req[i]
        if a[rb - 1] - a[ra - 1] == rc:
            res += rd
    return res

def set_a(idx: int, au: int):
    ans = 0
    for i in range(au, m + 1):
        a[idx] = i
        if idx + 1 < n:
            ans = max(set_a(idx + 1, i), ans)
        else:
            ans = max(check(), ans)
    return ans

print(set_a(0, 1))
a,b,c=map(int,input.split())

if c>a:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

a,b,c=map(int,input().split())
ch=0
for x in range(b):
  if (x*a)%b==c:
    ch+=1
    
if ch>0:
  print('YES')
else:
  print('NO')
x = int(input())
l = []
for i in range(1, x+1): #b
  for j in range(2, x+1): #p
    bq = i**j
    if bq > x:
      break
    l.append(bq)
print(max(l))

### FIXED CODE ###

x = int(input())
l = []
for i in range(1, x+1): #b
  for j in range(2, 11): #p
    bq = i**j
    if bq > x:
      break
    l.append(bq)
print(max(l))
n = int(input())
e = [0] * (n-1)

# 素因数分解する  
for i in range(2, n+1):
    cur = i
    for j in range(2, i+1):
        # ひたすら割り算を繰り返す
        # 2で割り続ければ、4で割ろうとした時には2で割れない数になっている
        # 自動的に素因数分解ができる
        while cur % j == 0:
            e[j] += 1
            cur //= j

def num(m):
    return len([i for i in e if i >= m-1])

print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)
      + num(5) * (num(5) - 1) * (num(3) - 2) // 2)

### FIXED CODE ###

n = int(input())
e = [0] * (n+1)

# 素因数分解する  
for i in range(2, n+1):
    cur = i
    for j in range(2, i+1):
        # ひたすら割り算を繰り返す
        # 2で割り続ければ、4で割ろうとした時には2で割れない数になっている
        # 自動的に素因数分解ができる
        while cur % j == 0:
            e[j] += 1
            cur //= j

def num(m):
    return len([i for i in e if i >= m-1])

print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1) \
      + num(5) * (num(5) - 1) * (num(3) - 2) // 2)
S = list(input())
num = 700


for i in S:
    if i == "o"
        num += 100
print(num)

### FIXED CODE ###


S = input()
num = 700


for i in S:
    if i == "o":
        num += 100
print(num)
# AtCoder Beginner Contest 176
# A - Takoyaki

import math

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

pritn(math.ceil(N/X)*T)

### FIXED CODE ###

# AtCoder Beginner Contest 176
# A - Takoyaki

N,X,T=map(int,input().split())
if N%X==0:
    print((N//X)*T)
else:
    print(((N//X)+1)*T)
import numpy as np

N = int(input())
A = list(map(int, input().split()))

a = np.array(A)
l = int(((N**2)+1)/2)
b = np.tile((1,-1),(1,l))
c = np.delete(b, 2*l-1, axis=None)
d = c.reshape(N,N)
e = np.triu(d)
f = np.tril(d)
g = np.eye(N)

inv = 0.5*(e-(f-g))

x = 2*(np.dot(inv,a))

print(x)

ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))

### FIXED CODE ###

import numpy as np
N = int(input())
A = list(map(int, input().split()))
a = np.array(A)
# l = int(((N*N)+1)/2)
b = []
for i in range(N):
    if i%2==0:
        b.append(1)
    else:
        b.append(-1)
c = np.dot(np.array(b),a)
x = [c]
for j in range(1,N):
    x_j = 2*a[j-1] - x[j-1]
    x.append(x_j)
ans = list(map(str, list(map(int, list(x)))))
print(" ".join(ans))