Harryxun/stf_run huggingface dataset:
n,k = map(int, input().split())
ans = 2*k+1
if ans > n: print(‘NO’)
else: print(‘YES’)


### FIXED CODE ###

n,k = map(int, input().split())
ans = 2*k-1
if n < ans:
  print('NO')
else:
  print('YES')
S = str(input())
box = ["A", "G", "C", "T"]
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox): 
        ACGTbox = s 
    s = str()
print(len(ACGTbox))

### FIXED CODE ###

# -*- coding: utf-8 -*-
S = str(input())
box = ["A", "G", "C", "T"]
s = str()
ACGTbox = str()
for i in range(0, len(S)):
    for j in range(i, len(S)):
        if S[j] in box:
            s += S[j]
        else:
            break
    if len(s) > len(ACGTbox):
        
        ACGTbox = s 
    s = str()
print(len(ACGTbox))
A = int(input())
B = int(input())

OP = input(plus_minus)

if OP == -:
    print(int(A) + int(B))
elif OP == +:
    print(int(A) - int(B))


### FIXED CODE ###

A, op, B= input().split()


if op =="+":
    print(int(A) + int(B))
elif op =="-":
    print(int(A)-int(B))
import subprocess
import os
import time


import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)

input = sys.stdin.readline


mod = 10**9+7
N = 10**6 + 500000
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]


# def find_n(x, y):
#     moves = int((x+y)/3)
#     for n in range(moves+1):
#         if n + (moves-n)*2 == x and n*2 + (moves-n) == y:
#             return n % mod, (moves-n) % mod


# def cmb(n, r):
#     return math.factorial(n) % mod // ((math.factorial(r) % mod) * (math.factorial(n-r) % mod))


def cmb(n, r):
    if r < 0 or r > n:
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod


def main():
    for i in range(2, N + 1):
        g1.append((g1[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod // i)) % mod)
        g2.append((g2[-1] * inverse[-1]) % mod)

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

    if (x+y) % 3:
        print(0)
        sys.exit()

    # n, m = find_n(x, y)

    n = int(((x*2 - y) / 3)) % mod
    m = int(((y*2 - x) / 3)) % mod

    ans = cmb(n+m, n)

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import subprocess
import os
import time


import sys
import math
from copy import deepcopy
from collections import deque, defaultdict
from operator import mul
from functools import reduce
sys.setrecursionlimit(20000000)

input = sys.stdin.readline


mod = 10**9+7
N = 10**6
g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]


# def find_n(x, y):
#     moves = int((x+y)/3)
#     for n in range(moves+1):
#         if n + (moves-n)*2 == x and n*2 + (moves-n) == y:
#             return n % mod, (moves-n) % mod


# def cmb(n, r):
#     return math.factorial(n) % mod // ((math.factorial(r) % mod) * (math.factorial(n-r) % mod))


def cmb(n, r):
    if r < 0 or r > n:
        return 0
    r = min(r, n-r)

    return g1[n] * g2[r] * g2[n-r] % mod


def main():
    for i in range(2, N + 1):
        g1.append((g1[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod // i)) % mod)
        g2.append((g2[-1] * inverse[-1]) % mod)

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

    if (x+y) % 3:
        print(0)
        sys.exit()

    # n, m = find_n(x, y)

    n = int(((x*2 - y) // 3))
    m = int(((y*2 - x) // 3))

    ans = cmb(n+m, n)

    print(ans)


if __name__ == '__main__':
    main()
def f(x):
  if x<10:
    return x
  else:
    a = x%10
    x%=10
    return a+f(x)
n = int(input())
a = f(n)
if n%a==0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

def f(x):
  if x<10:
    return x
  else:
    a = x%10
    x//=10
    return a+f(x)
n = int(input())
a = f(n)
if n%a==0:
  print("Yes")
else:
  print("No")
N = int(input())
A, B = [int(_) for i in input().split()]
P =  [int(_) for i in input().split()] 
x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i <= B])

if x != 0 and y != 0 and z != 0:
    print(min([x,y,z]))
else :
    print(0)

### FIXED CODE ###

N = int(input())
A, B = [int(_) for _ in input().split()]
P =  [int(_) for _ in input().split()]
x = len([i for i in P if i <= A])
y = len([i for i in P if i <= B and i >= A+1])
z = len([i for i in P if i >= B + 1])
 
if x != 0 and y != 0 and z != 0:
    print(min([x,y,z]))
else :
    print(0)
import sys

S = input()

while S:
    prefix = S[0:5]
    if prefix == 'dream':
        if S[5:7] == 'er':
            if S[7] == 'a':
                S = S[5:]
            else:
                S = S[7:]
        else:
            S = S[5:]
    elif prefix == 'erase':
        if S[5] == 'r':
            S = S[6:]
        else:
            S = S[5:]
    else:
        print('NO')
        sys.exit(0)
    # print(S)
print('YES')


### FIXED CODE ###

import sys

S = input()

while S:
    prefix = S[0:5]
    if prefix == 'dream':
        if S[5:7] == 'er':
            if len(S) >= 8 and S[7] == 'a':
                S = S[5:]
            else:
                S = S[7:]
        else:
            S = S[5:]
    elif prefix == 'erase':
        if len(S) >= 6 and S[5] == 'r':
            S = S[6:]
        else:
            S = S[5:]
    else:
        print('NO')
        sys.exit(0)
    # print(S)
print('YES')
n,k = map(int,input().split())



for i in range(k):
    if not((n-k+2 > i)):
        print(0)

    else:
        total = 1
        total2 = 1
        total3 = 1
        for j in range(i+1):
            total *= n-k+1-j
            total2 *= j+1
            total3 = int(total/total2)
            
        ww = (i+1)**(k-i-1)
        ans = ww * total3

        ans2 = ans % 1000000007

        print(ans2)
    


### FIXED CODE ###

n,k = map(int,input().split())
mod = 10**9+7

a = [1 for i in range(2010)]

memo = 1
for i in range(1,2001):
    memo *= i
    a[i] = memo



for i in range(1,k+1):
    if not((n-k+2 > i)):
        print(0)

    else:
        memo1 = a[n-k+1]*a[k-1]
        memo2 = a[i]*a[n-k+1-i]*a[i-1]*a[k-i]

        ans2 = memo1//memo2
        print(ans2%mod)
#include<stdio.h>
#include<string.h>

int main(){
    int n,i,j,d[100],t,x[100];
    char s[100][100];
    scanf("%d",&n);
    for(i=0;i<n;++i){
        scanf("%s %d",s[i],&d[i]);
        for(j=i;j>0;--j){
            t=strcmp(s[i],s[x[j-1]]);
            if(t<0 || (t==0&&d[i]>d[x[j-1]])){
                x[j] = x[j-1];
            }else{
                break;
            }
        }
        x[j]=i;
    }
    for(i=0;i<n;++i){
        printf("%d\n",x[i]+1);
    }
    return 0;
}

### FIXED CODE ###

n=int(input())
array = []
for i in range(n):
    s,p = input().split()
    array.append([s,100-int(p),i+1])
array.sort()
for i in range(n):
    print(array[i][2])
N,M = map(int,input().split())
ans = [0 for _ in range(M)]
for _ in range(N):
  like = list(map(int,input().split()))
  like[0].pop()
  for i in like:
    ans[i-1] += 1
print(ans.count(N))

### FIXED CODE ###

N,M = map(int,input().split())
ans = [0 for _ in range(M)]
for _ in range(N):
  like = list(map(int,input().split()))
  del like[0]
  for i in like:
    ans[i-1] += 1
print(ans.count(N))
def is_sorted(l):
    for i in range(len(l)):
        if l[i] != i + 1:
            return False
    return True


def can_go(start, goal, sw, d):
    if d > M: return False
    if start == goal: return True

    for s in sw:
        if s[0] == start:
            if can_go(s[1], goal, sw, d + 1):
                return True
        elif s[1] == start:
            if can_go(s[0], goal, sw, d + 1):
                return True
    return False


def try_s(l, sw):
    count = 0
    for idx, c in enumerate(l):
        if idx == c:
            count += 1
            continue
        if can_go(idx, c, sw, 0):
            # print(str(c) + ' can go home')
            count += 1
    print(count)


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

swaps = []
for i in range(M):
    x, y = map(int, input().split())
    swaps.append((x-1, y-1))


p = list(map(lambda x: x - 1, p))
# print(p)
# print(swaps)


if is_sorted(p):
    print(len(p))
else:
    try_s(p, swaps)


### FIXED CODE ###

# https://atcoder.jp/contests/abc097/tasks/arc097_b

import itertools
from collections import Counter
from collections import defaultdict
import bisect

# Union find
class UnionFind():
    def __init__(self,size):
        self.table = [-1 for _  in range(size)]  # 負の値の場合根を表す。絶対値はツリーの高さ 正の値は次の要素を返す、根まで続く
        self.size = [1 for _  in range(size)]

    #集合の代表を求める
    def find(self,x):
        while self.table[x] >= 0:
            #根に来た時,self.table[根のindex]は負の値なのでx = 根のindexで値が返される。
            x = self.table[x]
        return x

    def is_same(self, x, y):
        return self.find(x) == self.find(y)

    #併合
    def union(self,x,y):
        s1 = self.find(x)#根のindex,table[s1]がグラフの高さ
        s2 = self.find(y)
        if s1 != s2:#根が異なる場合
            if self.table[s1] != self.table[s2]:#グラフの高さが異なる場合
                if self.table[s1] < self.table[s2]:
                    self.table[s2] = s1
                    self.size[s1] += self.size[s2]
                else:
                    self.table[s1] = s2
                    self.size[s2] += self.size[s1]
            else:
                #グラフの長さが同じ場合,どちらを根にしても変わらない
                #その際,グラフが1長くなることを考慮する
                self.table[s1] += -1
                self.table[s2] = s1
                self.size[s1] += self.size[s2]
        return

    def group_size(self, x):
        return self.size[self.find(x)]


def main():
    N, M = map(int, input().split())
    P = list(map(int, input().split()))

    uf = UnionFind(N+1)
    for _ in range(M):
        a, b = map(int, input().split())
        uf.union(a, b)

    ans = 0
    for i in range(N):
        if uf.is_same(i + 1, P[i]):
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()
A2Z="abcdefghijklmnopqrstuvwxyz"

def decode(L1,L2,msg):
    x=[]
    for c in msg:
        if 'a'<=c<='z':
            c = L2[L1.index(c)]
        x.append(c)
    return "".join(x)
        
def affine(msg, key):
    a,b = key
    L = [A2Z[(i*a+b)%26] for i in range(26)]
    L = "".join(L)
    return decode(A2Z,L,msg)

def rot(msg, a):
    if a==0: return msg
    a = a % 26
    L = A2Z[a:]+A2Z[:a]
    return decode(A2Z,L,msg)

def find(msg):
    c0=ord('t')
    for i in range(3,26,2):
        x = affine(msg,[i,0])
        a = (c0-ord(x[0]))%26
        x = rot(x,a)
        if x in['this','that']: return [i,a]

n = input()
for i in range(n):
    msg = raw_input()
    for w in msg.split():
        if len(w)==4:
            key = find(w)
            if key!=[]: break
    print affine(msg,key)

### FIXED CODE ###

A2Z="abcdefghijklmnopqrstuvwxyz"

def affine(msg, a, b):
    s=""
    for c in msg: s+=(A2Z[(A2Z.index(c)*a+b)%26] if "a"<=c<="z" else c)
    return s

def checkkey(s):
    for i in range(26):
        a = 0
        x = affine(s,i,0)
        c = A2Z.index(x[0])
        if c!=19:
            a = (19-c)%26
            x = affine(x,1,a)
        if x in['this','that']: return i,a
    return -1,-1

n = input()
while n:
    n-=1
    s = raw_input()
    for w in s.split():
        if len(w)==4:
            a,b = checkkey(w)
            if a!=-1: break
    print affine(s,a,b)
import sys,math,copy,queue,itertools,bisect,collections
from heapq import *
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(-1,0),(0,1),(0,-1))

n,a,b,c = LI()
z = [a,b,c]
s = [sys.stdin.readline().rstrip() for _ in range(n)]
ans = []
for i in range(n):
    x = s[i]
    p = -1
    if x == 'AB': j=0;k=1;l=2
    elif x == 'AC': j=0;k=2;l=1
    elif x == 'BC': j=1;k=2;l=0
    if z[j] > z[k]:
        z[j] -= 1; z[k] += 1
        p = k
    else:
        z[j] += 1; z[k] -= 1
        p = j
    if (z[j] == 0 or z[k] == 0) and z[l] == 0:
        if i < n+1:
            y = s[i+1]
            if x == 'AB': j1=0;k1=1;l1=3
            elif x == 'AC': j1=0;k1=2;l1=1
            elif x == 'BC': j1=1;k1=2;l1=0
            if z[j1] == 0 and z[k1] == 0:
                if z[j] == 0:
                    z[j] += 2; z[k] -= 2
                    p = j
                else:
                    z[j] -= 2; z[k] += 2
                    p = k
    if min(z) < 0:
        print('No')
        exit(0)
    if p==0:ans.append('A')
    elif p==1:ans.append('B')
    else: ans.append('C')
print('Yes')
print(*ans,sep='\n')






### FIXED CODE ###

import sys,math,copy,queue,itertools,bisect,collections
from heapq import *
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(-1,0),(0,1),(0,-1))

n,a,b,c = LI()
z = [a,b,c]
s = [sys.stdin.readline().rstrip() for _ in range(n)]
ans = []
for i in range(n):
    x = s[i]
    p = -1
    if x == 'AB': j=0;k=1;l=2
    elif x == 'AC': j=0;k=2;l=1
    elif x == 'BC': j=1;k=2;l=0
    if z[j] > z[k]:
        z[j] -= 1; z[k] += 1
        p = k
    else:
        z[j] += 1; z[k] -= 1
        p = j
    if (z[j] == 0 or z[k] == 0) and z[l] == 0:
        if i < n-1:
            y = s[i+1]
            if y == 'AB': j1=0;k1=1;l1=2
            elif y == 'AC': j1=0;k1=2;l1=1
            elif y == 'BC': j1=1;k1=2;l1=0
            if z[j1] == 0 and z[k1] == 0:
                if z[j] == 0:
                    z[j] += 2; z[k] -= 2
                    p = j
                else:
                    z[j] -= 2; z[k] += 2
                    p = k
    if min(z) < 0:
        print('No')
        exit(0)
    if p==0:ans.append('A')
    elif p==1:ans.append('B')
    else: ans.append('C')
print('Yes')
print(*ans,sep='\n')
s = input()
cnt1 = 0
cnt2 = 0
for i in range(len(s)):
    if i%s == 0:
        if s[i] == "0":
            cnt1 += 1
        else:
            cnt2 += 1
    else:
        if s[i] == "1":
            cnt1 += 1
        else:
            cnt2 += 1
print(min(cnt1,cnt2))

### FIXED CODE ###

s = input()
cnt1 = 0
cnt2 = 0
for i in range(len(s)):
    if i%2 == 0:
        if s[i] == "0":
            cnt1 += 1
        else:
            cnt2 += 1
    else:
        if s[i] == "1":
            cnt1 += 1
        else:
            cnt2 += 1
print(min(cnt1,cnt2))
K=int(input())
s =input()
x = len(s)

if x<=K:
    print(s)
else:
    print(s[:K]+'...')

### FIXED CODE ###

N=(input())
x = int(N[-1])
A =[2,4,5,7,9]
if x in A:
    print('hon')
elif x == 3:
    print('bon')
else:
    print('pon')
n = int(input())
num_list = list(map(int, input().split()))

Alice = 0
Bob = 0

for i in range(n):
    current_max = max(num_list)
    if i % 2 == 0:
        Alice += current_max
    else:
        Bob += current_max
    a_list.remove(current_max)

print(Alice - Bob)


### FIXED CODE ###

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

Alice = 0
Bob = 0

for i in range(n):
    current_max = max(num_list)
    if i % 2 == 0:
        Alice += current_max
    else:
        Bob += current_max
    num_list.remove(current_max)

print(Alice - Bob)
a,b,c = list(map(int,input().split()))

if b-c > 0 && c-a > 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if b-c > 0 and c-a > 0:
    print("Yes")
elif a-c > 0 and c-b > 0:
    print("Yes")
else:
    print("No")
def fact2(a, b):
    c2 = 0
    c5 = 0
    while a%2 == 0:
        a //= 2
        c2 += 1
    while a%5 == 0:
        a //= 5
        c5 += 1
    return min(c2-b, 9), min(c5-b,9)

def main():
    N = int( input())
    A2 = [0]*N
    A5 = [0]*N
    AS = [0]*N
    for i in range(N):
        a = input()
        if '.' in a:
            b, c = a.split('.')
            if int(c) == 0:
                pass
            else:
                c = chr( int(c))
                AS[i] = len(c)
                b += c
        else:
            b = a
        # A2[i], A5[i] = fact( int(b))
        # print(b)
        A2[i], A5[i] = fact2( int(b), AS[i])

    R = [ [0]*19 for _ in range(19)]
    for i in range(N):
        a, b = A5[i]+9, A2[i]+9
        R[a][b] += 1
    AR = [ [0]*19 for _ in range(19)]
    for i in range(18,-1,-1):
        for j in range(17,-1,-1):
            R[i][j] = R[i][j] + R[i][j+1]
    for j in range(18):
        for i in range(17,-1,-1):
            R[i][j] += R[i+1][j]
    ans = 0
    # print("\n".join( [" ".join( map( str, a)) for a in AR]))
    for k in range(N):
        i, j = A5[k], A2[k]
        if i <= 9 and j <= 9:
            ans += R[-i+9][-j+9]
            # print(-i+9,-j+9)
        if AS[k] == 0:
            ans -= 1
    print(ans//2)

# 2
# 10.73741824 
# 3051.7578125
# 2**30, 2**15

if __name__ == '__main__':
    main()


### FIXED CODE ###

def fact2(a, b):
    c2 = 0
    c5 = 0
    while a%2 == 0:
        a //= 2
        c2 += 1
    while a%5 == 0:
        a //= 5
        c5 += 1
    return min(c2-b, 9), min(c5-b,9)

def main():
    N = int( input())
    A2 = [0]*N
    A5 = [0]*N
    AS = [0]*N
    for i in range(N):
        a = input()
        if '.' in a:
            b, c = a.split('.')
            if int(c) == 0:
                pass
            else:
                AS[i] = len(c)
                b += c
        else:
            b = a
        # A2[i], A5[i] = fact( int(b))
        # print(b)
        A2[i], A5[i] = fact2( int(b), AS[i])

    R = [ [0]*19 for _ in range(19)]
    for i in range(N):
        a, b = A5[i]+9, A2[i]+9
        R[a][b] += 1
    AR = [ [0]*19 for _ in range(19)]
    for i in range(18,-1,-1):
        for j in range(17,-1,-1):
            R[i][j] = R[i][j] + R[i][j+1]
    for j in range(19):
        for i in range(17,-1,-1):
            R[i][j] += R[i+1][j]
    ans = 0
    # print("\n".join( [" ".join( map( str, a)) for a in AR]))
    for k in range(N):
        i, j = A5[k], A2[k]
        if i <= 9 and j <= 9:
            ans += R[-i+9][-j+9]
            # print(-i+9,-j+9)
        if AS[k] == 0:
            ans -= 1
    print(ans//2)

# 2
# 10.73741824 
# 3051.7578125
# 2**30, 2**15

if __name__ == '__main__':
    main()
N = int(input())


def ms(ps):
    n = len(ps)
    result = []
    for j in range(n):
        i = j + 1
        result.append(i % ps[j])
    return result


ps = list(range(2, N + 1))
ps.append(1)
print(sum(ms(ps)))

### FIXED CODE ###

import decimal

N = decimal.Decimal(input())
print(N * (N - 1) / 2)
while(true):
    a, op, b = input().split()

    if(op == '+'):
        print(int(a) + int(b))
    elif(op == '-'):
        print(int(a) - int(b))
    elif(op == '*'):
        print(int(a) * int(b))
    elif(op == '/'):
        print(int(a) // int(b))
    else:
        break


### FIXED CODE ###

while True:
    a, op, b = input().split()

    if(op == '+'):
        print(int(a) + int(b))
    elif(op == '-'):
        print(int(a) - int(b))
    elif(op == '*'):
        print(int(a) * int(b))
    elif(op == '/'):
        print(int(a) // int(b))
    else:
        break
def main():
  n, k, q = map(int, input().split())
  a = [ int(input()) for i in range(q) ]

  for i in range(1,n+1):
    x = a.count(i)
    if k-q+x > 0:
      print('Yes')
      else:
        print('No')

if __name__ == '__main__':
    main()

### FIXED CODE ###

n, k, q = map(int, input().split())
a = [ int(input()) for i in range(q) ]
score = [k-q]*n
for i in a:
    score[i-1] += 1
for i in score:
    print('Yes' if i > 0 else 'No')
N=int(input())
S=0
while N>=1:
    S+=N%10
    N=int(N/10)

if S%9==0:print("Yes")
else:print("No")

### FIXED CODE ###

N=int(input())
if N%9==0:print("Yes")
else:print("No")
from operator import itemgetter
n=int(input())
xl=[list(map(int,input().split()))for i in range(N)]
R=[list(xl[i][0]-xl[i][1],xl[i][0]+xl[i][1]) for i in range(n)]
r=sorted([(R[i][0],R[i][1]) for i in range(n)],key=itemgetter(1))
s=r[0][1]
ans=1
for i in range(n-1):
    if r[i+1][0]>s:
        s=r[i+1][1]
        ans+=1
print(ans)

### FIXED CODE ###

from operator import itemgetter
n=int(input())
xl=[list(map(int,input().split()))for i in range(n)]
R=[(xl[i][0]-xl[i][1],xl[i][0]+xl[i][1]) for i in range(n)]
r=sorted([(R[i][0],R[i][1]) for i in range(n)],key=itemgetter(1))
s=r[0][1]
ans=1
for i in range(n-1):
    if r[i+1][0]>=s:
        s=r[i+1][1]
        ans+=1
print(ans)
MOD = 10**9 + 7
N,M = map(int, input().split())
a = [int(input()) for _ in range(M)]

aa = [True] * (N+1)
for i in a:
    aa[i] = False

dp = [0] * (N+1)
dp[0] = 1
if aa[1]:
    dp[1] = 1

for i in range(2,N+1):
    if (aa[i] == False):
        dp[i] = 0
        continue
    dp[i] = dp[i-1] + dp[i-2]
    dp[i] =  dp[i] % MOD
print(dp[i])


### FIXED CODE ###

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

MOD = 10**9 + 7

safe = [True] * (N+1)
for i in range(len(A)):
    safe[A[i]] = False

dp = [0] * (N+1)
dp[0] = 1
if safe[1]:
    dp[1] = 1

for i in range(2, N+1):
    if(safe[i]):
        dp[i] = dp[i-1] + dp[(i-2)]
        dp[i] = dp[i] % MOD
    else:
        dp[i] = 0

print(dp[N])
N = int(input())
A = [input() for _ in [0]*N]

for i,a in enumerate(A):
    b = a.split(".")
    if len(b)==1:
        A[i] = int(a)*10**9
        continue
    c = b[1]
    n = len(c)
    c += "0"*(9-n)
    A[i] = int(b[0] + c)

cnt = [[0]*20 for _ in [0]*20]
B = [(0,0)]*N
for k,a in enumerate(A):
    i = 0
    j = 0
    while a%2==0:
        a//=2
        i+=1
    while a%5==0:
        a//=5
        j+=1
    B[k] = (min(19,i),min(19,j))
    cnt[i][j] += 1

for i in range(1,20):
    i = 19-i
    for j in range(20):
        j = 19-j
        cnt[i][j] += cnt[i+1][j]

for i in range(20):
    i = 19-i
    for j in range(1,20):
        j = 19-j
        cnt[i][j] += cnt[i][j+1]

ans = 0
for i,j in B:
    me = int(i>=9 and j>=9)
    ans += cnt[18-i][18-j]-me

print(ans//2)

### FIXED CODE ###

N = int(input())
A = [input() for _ in [0]*N]

for i,a in enumerate(A):
    b = a.split(".")
    if len(b)==1:
        A[i] = int(a)*10**9
        continue
    c = b[1]
    n = len(c)
    c += "0"*(9-n)
    A[i] = int(b[0] + c)

cnt = [[0]*40 for _ in [0]*40]
B = [(0,0)]*N
for k,a in enumerate(A):
    i = 0
    j = 0
    while a%2==0:
        a//=2
        i+=1
    while a%5==0:
        a//=5
        j+=1
    B[k] = (i,j)
    cnt[i][j] += 1

for i in range(1,40):
    i = 39-i
    for j in range(40):
        j = 39-j
        cnt[i][j] += cnt[i+1][j]

for i in range(40):
    i = 39-i
    for j in range(1,40):
        j = 39-j
        cnt[i][j] += cnt[i][j+1]

ans = 0
for i,j in B:
    me = int(i>=9 and j>=9)
    ans += cnt[max(0,18-i)][max(0,18-j)]-me

print(ans//2)
import math

N =int(input())
monster = sorted([int(i) for i in input().split()])

print(math.gcd(monster[0], monster[1]))

### FIXED CODE ###

from functools import reduce
import fractions


def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)


N =int(input())
monster = [int(i) for i in input().split()]
print(gcd_list(monster))
S = input()
N = len(S)
A = (len(S) - 1) // 2
B = (len(S) + 3) // 2
if S[0:A] == S[B - 1:N]:
  print('Yes')
elif:
  print('No')

### FIXED CODE ###

S = input()
N = len(S)
A = (len(S) - 1) // 2
B = (len(S) + 3) // 2
if S[0:A] == S[B - 1:N]:
  print('Yes')
else:
  print('No')
n,q=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
ab=[list(map(int,list(input()))) for i in range(n)]
px=[list(map(int,list(input()))) for i in range(q)]
#print(ab)
#print(px)
ans= [[0 for i in range(n)] for i in range(n)]
ans2= [0 for i in range(n)]
for i in range(n):
    ans[i][i] = 1
for i in range(len(ab)):
    ans[ab[i][0]-1][ab[i][1]-1]+=1
for i in range(n):
    for j in range(i+1,n):
        if(ans[i][j]>0):
            for k in range(j,n):
                ans[i][k]+=ans[j][k]
for i in range(q):
    for j in range(n):
        ans2[j]+=px[i][1]* 1 if ans[px[i][0]-1][j] else 0
print(ans2)

### FIXED CODE ###

import collections

N,Q=map(int,input().split())
M=[[] for i in range(N+1)]
P=[0 for i in range(N+1)]
for i in range(N-1):
  a,b=map(int,input().split())
  M[a].append(b)
  M[b].append(a)
#print("M:",M)

S=[0 for i in range(N+1)]
for i in range(Q):
  p,x=map(int,input().split())
  S[p]+=x
#print(S)
  
d=collections.deque([1])

while len(d):
  dd=d.popleft()
  if P[dd]==0:
    P[dd]=1
    for i in M[dd]:
      if P[i]==0:
        S[i]+=S[dd]
      d.append(i)
  #print(d,S)
print(*S[1:])