Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
import  math
from statistics import *
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
aaa = na()
bbb = na()
ccc = na()
aaa.sort()
bbb.sort()
ccc.sort()
l = 0
r = 0
ct = 0
for i in range(n):
    r = 0
    for j in range(l, n):
        if aaa[i] < bbb[j]:
            for k in range(r, n):
                if bbb[j] < ccc[k]:
                    ct += (n - k)
                    r = k
                    break
print(ct)

### FIXED CODE ###

import sys
import  math
import bisect
from statistics import *
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
aaa = na()
bbb = na()
ccc = na()
aaa.sort()
ccc.sort()
l = 0
r = 0
ct = 0
ct = 0
for i in range(n):
    l = bisect.bisect_left(aaa, bbb[i])
    r = bisect.bisect_right(ccc, bbb[i])
    ct += l * (n - r)

print(ct)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
H, W, M = map(int, input().split())#slow,行数H、列数W、爆弾数M
hcnt = [0] * H#何行目に何個あるか
wcnt = [0] * W#何列目に何個あるか
bomb = []
cnt = 0

for i in range(M):
    bh, bw = map(int, input().split())
    hcnt[bh - 1] += 1#行方向
    wcnt[bw - 1] += 1#列方向
    bomb.append([bh - 1,bw - 1])
#hcnt [2,1]
#wcnt[1,1,1]
hmax = max(set(hcnt))
wmax = max(set(wcnt))
for i in range(H):
    for j in range(W):
        if hcnt[i] == hmax and wcnt[j] == wmax and bomb.count([i, j]) == 0:
            cnt += 1

if cnt > 0:
    print(hmax + wmax)
else:
    print(hmax + wmax - 1)


### FIXED CODE ###


import sys
from collections import Counter

H, W, M = map(int, sys.stdin.readline().rstrip().split())#行数H、列数W、爆弾数M
hcnt = [0] * H#何行目に何個あるか
wcnt = [0] * W#何列目に何個あるか
bomb = []

for i in range(M):
    bh,bw=map(int,sys.stdin.readline().rstrip().split())
    hcnt[bh - 1] += 1#行方向
    wcnt[bw - 1] += 1#列方向
    bomb.append((bh - 1,bw - 1))
#hcnt [2,1]
#wcnt[1,1,1]
#bomb[[1,1],[0,0],[0,2]]
hmax = max(hcnt)#2
wmax = max(wcnt)#1

crs = 0#hmax and wmax crosspoint
for (i, j) in bomb:
    if hcnt[i] == hmax and wcnt[j] == wmax:
        crs += 1
#all crosspoint has bomb
if crs == Counter(hcnt)[hmax] * Counter(wcnt)[wmax]:
    print(hmax + wmax - 1)
#more than one crosspoint has no bomb
else:
    print(hmax + wmax)
### BUGGY CODE ###

import itertools

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [i for i in range(n)]

def add(k, x):
  while k <= n:
    data[k] += x
    k += k & -k
def get(k):
  s = 0
  while k:
    s += data[k]
    k -= k & -k
  return s
ans = 10 ** 18
for i in itertools.combinations(c,n//2):
  j = list(set(c)-set(i))
  even = sorted([(a[k],k+1) if k % 2 else (b[k],k+1) for k in i])
  odd = sorted([(b[k],k+1) if k % 2 else (a[k],k+1) for k in j])
  prev = -1
  A = []
  for x in range(n):
    if x % 2:
      now = even[x//2][0]
      if prev > now:
        break
      else:
        A.append(even[x//2][1])
    else:
      now = odd[x//2][0]
      if prev > now:
        break
      else:
        A.append(odd[x//2][1])
    prev = now
  else:
    data = [0]*(n+1)
    tmp = 0
    for i,z in enumerate(A):
      tmp += (n-1-i) - get(z)
      add(z,1)
    ans = min(ans,tmp)
if ans == 10 ** 18:
  print(-1)
else:
  print(ans)

### FIXED CODE ###

import itertools

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [i for i in range(n)]

def add(k, x):
  while k <= n:
    data[k] += x
    k += k & -k
def get(k):
  s = 0
  while k:
    s += data[k]
    k -= k & -k
  return s
ans = 10 ** 18
for i in itertools.combinations(c,n//2):
  j = list(set(c)-set(i))
  even = sorted([(a[k],k+1) if k % 2 else (b[k],k+1) for k in i])
  odd = sorted([(b[k],k+1) if k % 2 else (a[k],k+1) for k in j])
  prev = -1
  A = []
  for x in range(n):
    Y,X = divmod(x,2)
    if X % 2:
      now0,now1 = even[Y][0],even[Y][1]
    else:
      now0,now1 = odd[Y][0],odd[Y][1]
    if prev > now0:
      break
    else:
      A.append(now1)
    prev = now0
  else:
    data = [0]*(n+1)
    tmp = 0
    for i,z in enumerate(A):
      tmp += (n-1-i) - get(z)
      add(z,1)
    ans = min(ans,tmp)
if ans == 10 ** 18:
  print(-1)
else:
  print(ans)
### BUGGY CODE ###

d=[0]*13
d[0]=1
mul=1
mulmod=1
t=input()[::-1]

zero=[0]*13
l=len(t)
modlist=[10**i%13 for i in range(l)]
for n,c in enumerate(t):
    e=zero[:]

    for i in (range(10) if c=="?" else[int(c)]):
        for j in range(13):
            #e[(i*mul+j)%13]+=d[j]
            k=(i*modlist[n]+j)%13
            e[k]+=d[j]
            e[k]%=1000000007
    d,e=e,d
    mul*=10
    #mulmod=mul%13
print(d[5])



### FIXED CODE ###

# coding: utf-8
# Your code here!
 
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意
 
s = input()
l = len(s)
MOD = 10**9+7
 
dp = [0]*13
dp[0] = 1
for i in s:
    new = [0]*13
    if i == "?":
        for i in range(10):
            for j in range(13):
                new[(10*j+i)%13] += dp[j]
    else:
        i = int(i)
        for j in range(13):
            new[(i+10*j)%13] += dp[j]
    
    for i in range(13):
        new[i] %= MOD
    dp,new = new,dp
#    print(dp)
 
print(dp[5]%MOD)
### BUGGY CODE ###

def resolve():
    S = str(input())
    ans = 0

    while True:
        tmp1 = S.count('01')
        ans += tmp1 * 2
        S = S.replace('01', '')

        tmp2 = S.count('10')
        ans += tmp2*2
        S = S.replace('10', '')

        if tmp1 == 0 and tmp2 == 0:
            break

    print(ans)
    return
resolve()

### FIXED CODE ###

def resolve():
    S = str(input())
    ans = 2 * min(S.count('1'), S.count('0'))

    print(ans)
    return
resolve()
### BUGGY CODE ###

n=int(input())

def f_count(j):
    count=0
    rt=int(j**0.5)
    for x in range(1,rt):
        for y in range(1,rt):
            for z in range(1,rt):
                if x**2+y**2+z**2+x*y+y*z+z*x==j:
                    count+=1
    return count
    
for i in range(1,n+1):
    print(f_count(i))
    
                    

### FIXED CODE ###

N=int(input())

#f(N)を入れるリスト。f(1)=ans_list[0], f(N)=ans_list[N-1]
ans_list=[0]*N

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            s=x**2+y**2+z**2+x*y+y*z+z*x
            if s<=N:
                ans_list[s-1]+=1
            
   
for i in range(N):
   print(ans_list[i])
### BUGGY CODE ###

a = list(input())
ans = 0
i = 0
while i < len(a)-2:
    box = a[i]+a[i+1]+a[i+2]
    if box == "ABC":
        ans += 1
        a[i], a[i+1], a[i+2] = a[i+1], a[i+2], a[i]
        i -= 2
    i += 1
    if i < 0:
        i = 0
    # print(a, i, ans)
print(ans)


### FIXED CODE ###

a = list(input())
ans = 0
i = 0

a_count = 0  # 連続ででたAの個数
# BC_count = 0  # BC出てきたらそれまでのAの数分

while i < len(a)-1:
    if a[i] == "A":
        count = "A"
        a_count += 1
    elif a[i]+a[i+1] == "BC":
        count = "BC"
        ans += a_count
        i += 1
    else:
        count = "VBNM"
        a_count = 0
    # print(a_count, ans, i, count)
    i += 1

print(ans)
### BUGGY CODE ###

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

import sys

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N = INT()
A = [[]]
for i in range(N):
    A.append(LIST()[::-1])

def check(li, cnt):
    prev = cnt
    skip = [False] * (N+1)
    # 前回変更があった場所のみでループを回す
    nxtli = set()
    for i in li:
        if len(A[i]) and not skip[i]:
            a = A[i][-1]
            if len(A[a]) and not skip[a]:
                b = A[a][-1]
                if i == b:
                    A[i].pop()
                    A[a].pop()
                    # 変更があった場所をセットに入れておく
                    if len(A[i]):
                        nxtli.add(i)
                    if len(A[a]):
                        nxtli.add(a)
                    cnt -= 1
                    skip[i] = skip[a] = True
    if prev == cnt:
        print(-1)
        exit()
    return nxtli, cnt

cnt = N*(N-1)//2
li = set(range(1, N+1))
day = 0
while cnt > 0:
    li, cnt = check(li, cnt)
    day += 1
print(day)


### FIXED CODE ###

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

import sys
import time
from collections import deque

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
A = [deque()]
for i in range(N):
    A.append(deque(LIST()))

start = time.time()

cnt = N*(N-1)//2
day = 0
while cnt > 0:
    prev = cnt
    skip = [False] * (N+1)
    for i in range(1, N+1):
        if len(A[i]) and not skip[i]:
            a = A[i][0]
            if len(A[a]) and not skip[a]:
                b = A[a][0]
                if i == b:
                    A[i].popleft()
                    A[a].popleft()
                    cnt -= 1
                    skip[i] = skip[a] = True
    if prev == cnt:
        print(-1)
        exit()
    day += 1

    elapsed_time = time.time() - start
    if elapsed_time > 1:
        print(N*(N-1)//2)
        exit()
print(day)
### BUGGY CODE ###

import sys
n = int(sys.stdin.readline())
S = sys.stdin.readline().rstrip()

#動的計画法 dp
dp =[[0 for j in range(n+1)] for i in range(n+1)]

ans = 0
for i in range(n-1, -1, -1):
    for j in range(i-1, -1, -1):
        if S[i] == S[j]:
            dp[i][j] = 1 + dp[i+1][j+1]
            if dp[i][j] >=n/2:
                dp[i][j] = 0
            if ans < dp[i][j]:
                ans = dp[i][j]

print(ans)

### FIXED CODE ###

import sys
n = int(sys.stdin.readline())
S = sys.stdin.readline().rstrip()


dp = [[0 for i in range(n)] for j in range(n)]
#初期条件
for j in range(1, n):
    if S[0] == S[j]:
        dp[0][j] = 1

#print(dp)

for i in range(1, n-1):
    for j in range(i+1, n):
        if S[i] ==S[j]:
            dp[i][j] = min(dp[i-1][j-1] +1, j-i)

maxp = 0
for i in range(n-1):
    for j in range(i+1, n):
        if maxp < dp[i][j]:
            maxp = dp[i][j]
#print(dp)
print(maxp)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def checker(n):
    ans = 0
    for a in range(1, 101):
        if a ** 2 + 2 * a > n:
            continue
        for b in range(1, 101-a):
            if a * 2 + b * 2 > n:
                continue
            for c in range(1, 101-a-b):
                if a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a == n:
                    ans += 1
                elif a ** 2 + b ** 2 + c ** 2 + a * b + b * c + c * a > n:
                    break
    return ans


def main():
    N = int(input().strip())
    for n in range(1, N+1):
        print(checker(n))
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def checker():
    ans = [0] * 10001
    for a in range(1, 101):
        for b in range(1, 101):
            for c in range(1, 101):
                n = a * a + b * b + c * c + a * b + b * c + c * a
                if n > 10000:
                    continue
                else:
                    ans[n] += 1
    return ans


def main():
    N = int(input().strip())
    ans = checker()
    for n in range(1, N + 1):
        print(ans[n])
    return


if __name__ == "__main__":
    main()
### BUGGY CODE ###

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

aset = set(a)
count = []
n = len(aset)
for i in aset:
    count.append([i,a.count(i)])
if n <= k:
    print(0)
else:
    c = n - k
    count.sort(key=lambda x: x[1])
    ans = 0
    for i in range(c):
        ans += count[i][1]
    print(ans)

### FIXED CODE ###

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

a.sort()
count = []
c = 1
for i in range(n-1):
    if a[i] != a[i+1]:
        count.append(c)
        c = 1
    else:
        c += 1
    if i == n - 2:
        count.append(c)

l = len(count)
#print(a)
#print(count)
c = 0
if l <= k:
    print(0)
else:
    count.sort()
    for i in range(l):
        l -= 1
        c += count[i]
        if l <= k:
            print(c)
            quit()
### BUGGY CODE ###

K = int(input())


def gcd(a, b, c):
    mi = min(a, b, c)
    for k in range(mi, 0, -1):
        if a % k == 0 and b % k == 0 and c % k == 0:
            return k


ans = 0
for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            ans += gcd(a, b, c)

print(ans)


### FIXED CODE ###

from fractions import gcd
K = int(input())


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


ans = 0
for a in range(1, K + 1):
    for b in range(1, K + 1):
        for c in range(1, K + 1):
            ans += gcd(gcd(a, b), c)

print(ans)
### BUGGY CODE ###

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

import sys
from bisect import insort_left

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

Q=INT()

li=[]
A=B=fx=cost=cnt=l=r=0
for _ in range(Q):
    instr=input()
    if instr[0]=='1':
        _,a,b=map(int, instr.split())
        B+=b
        insort_left(li, a)
        if cnt==0:
            l=r=A=a
        else:
            if not (l<=a<=r):
                cost+=min(abs(l-a), abs(r-a))
            # 偶数回目
            if cnt%2==1:
                A=l=li[len(li)//2-1]
                r=li[len(li)//2]
            # 奇数回目
            else:
                A=l=r=li[len(li)//2]
        fx=cost+B
        cnt+=1
    else:
        print(A, fx)


### FIXED CODE ###

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

import sys
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

Q = INT()
_, a, b = MAP()
mid = a
asm = 0
bsm = b
ln = 1
que1, que2 = [-a], [INF]
for _ in range(Q-1):
    li = LIST()
    if li[0] == 1:
        a, b = li[1:]
        bsm += b
        l = -que1[0]
        r = que2[0]
        if ln % 2 == 1:
            asm += abs(a - l)
            if a < mid:
                heappush(que1, -a)
                heappush(que2, -que1[0])
                heappop(que1)
            else:
                heappush(que2, a)
        else:
            if a < l:
                asm += abs(a - l)
            elif a > r:
                asm += abs(a - r)
            if a > mid:
                heappush(que2, a)
                heappush(que1, -que2[0])
                heappop(que2)
            else:
                heappush(que1, -a)
        ln += 1
        mid = -que1[0]
    else:
        print(mid, asm + bsm)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n, m = [int(x) for x in input().strip().split()]
a = sorted(list(set([int(x)//2 for x in input().strip().split()])), reverse=True)
lcm_d = {}
gcd_d = {}
def lcm(a, b, d, dd):
    if (a, b) in d:
        return d[(a, b)]
    ret = a * b // gcd(a, b, dd)
    ret_ = ret
    if gcd(a, b, dd) != 1:
        while (ret // a) % 2 == 0 or (ret // b) % 2 == 0:
            ret += ret_
    d[(a, b)] = ret
    return ret

def gcd(a, b, d):
    if (a, b) in d:
        return d[(a, b)]
    if b == 0:
        return a
    d[(a, b)] = gcd(b, a % b, d)
    return d[(a, b)]

lcm_ = a[0]
for aa in a[1:]:
    lcm_ = lcm(aa, lcm_, lcm_d, gcd_d)

print((m // lcm_ + 1) // 2)

### FIXED CODE ###

import sys
input = sys.stdin.readline
n, m = [int(x) for x in input().strip().split()]
a = list(set([int(x)//2 for x in input().strip().split()]))

def lcm(a, b):
    return a * b // gcd(a, b)

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

def div2cnt(x):
    ret = 0
    while x % 2 == 0:
        ret += 1
        x //= 2
    return ret

cnt = div2cnt(a[0])

for i, aa in enumerate(a):
    if div2cnt(aa) != cnt:
        print(0)
        exit()
    a[i] >>= cnt
else:
    m >>= cnt

lcm_ = 1
for aa in a:
    lcm_ = lcm(lcm_, aa)
    if lcm_ > m:
        print(0)
        exit()

print((m // lcm_ + 1) // 2)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

import math
from collections import deque
    
n,d,a = l_in()
xh = []
for _ in range(n):
    x,h=l_in()
    xh.append((x,math.ceil(h/a)))

xh.sort()
res = 0
currentX = -1
currentH = 0
q=deque()

for x,h in xh:
    while len(q) > 0:
        bx, bh = q[0]
        if bx < x:
            q.popleft()
        else:
            break
    for bx, bh in q:    
        h -= bh
    if h > 0:
        q.append((x+2*d, h))
        res += h

print(res)



### FIXED CODE ###

import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

import math
from collections import deque
    
n,d,a = l_in()
xh = []
for _ in range(n):
    x,h=l_in()
    xh.append((x,math.ceil(h/a)))

xh.sort()
res = 0
currentX = -1
currentH = 0
q=deque()
q_sum = 0

for x,h in xh:
    while len(q) > 0:
        bx, bh = q[0]
        if bx < x:
            q.popleft()
            q_sum -= bh
        else:
            break
    h -= q_sum
    if h > 0:
        q.append((x+2*d, h))
        q_sum += h
        res += h

print(res)
### BUGGY CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
x = [1]
y = 1

while y != 2:
    y = a[y-1]
    x.append(y)
    if x.count(y) == 2:
        print(-1)
        exit()

print(len(x)-1)

### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)] #ボタンの仕様
x = [1] #遷移
 
for i in range(n):
    y = x[-1] #今の場所
    z = a[y-1]
    x.append(z)
    if z == 2:
        print(len(x)-1)
        exit()

print(-1)
### BUGGY CODE ###

n = int(input())
s = tuple(input() for i in range(n))
MOD = n

def solve(add):
    for i in range(n):
        for j in range(n):
            if s[(i+add) % MOD][j] != s[(j+add) % MOD][i]:
                return False
    return True

ans = 0
for i in range(n):
    if solve(i):
        ans += n
print(ans)

### FIXED CODE ###

n = int(input())
s = [input() for i in range(n)]
MOD = n

def solve(add):
    for i in range(n):
        for j in range(n):
            if s[(i+add) % MOD][j] != s[(j+add) % MOD][i]:
                return False
    return True

ans = 0
for i in range(n):
    if solve(i):
        ans += n
print(ans)
### BUGGY CODE ###

#n=int(input())
n,k=map(int,input().split())
l=list(map(int,input().split()))
mul=1
for i in range(k):
  mul=mul*l[i]
z=mul
j=0
for i in range(k,n):
  z=z//l[j]
  z=z*l[i]
  if z>mul:
    print('Yes')
  else:
    print('No')
  j+=1
  mul=z

### FIXED CODE ###

#n=int(input())
n,k=map(int,input().split())
l=list(map(int,input().split()))
mul=1
for i in range(k):
  mul=mul+l[i]
z=mul
j=0
for i in range(k,n):
  z=z-l[j]
  z=z+l[i]
  if z>mul:
    print('Yes')
  else:
    print('No')
  j+=1
  mul=z
### BUGGY CODE ###

from collections import deque
n,q=map(int,input().split())
A=[[] for i in range(n)] #繋がっている頂点
for i in range(n-1):
  a,b=map(int,input().split())
  a=a-1
  b=b-1
  A[a].append(b)
  A[b].append(a)
B=[0]*n #コスト
for i in range(q):
  p,q=map(int,input().split())
  p=p-1
  B[p]=B[p]+q
#BFSの時間じゃああああ!!!!!!
C=deque([0])
D=[] #visited枠
while len(C)>0:
  c=C[0]
  C.popleft()
  D.append(c)
  for i in range(len(A[c])):
    if A[c][i] not in D:
      C.append(A[c][i])
      B[A[c][i]]+=B[c]
for i in range(n):
  print(B[i],end=" ")
print()

### FIXED CODE ###

n,m=map(int,input().split())
graph=[[]for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  a=a-1
  b=b-1
  graph[a].append(b)
  graph[b].append(a)
cost=[0]*n
visited=[False]*n
for i in range (m):
  p,x=map(int,input().split())
  p=p-1
  cost[p]=cost[p]+x
from collections import deque
quest=deque([0])
visited[0]=True
while len(quest)!=0:
  a=quest.popleft()
  for i in graph[a]:
    if visited[i]==True:
      continue
    quest.append(i)
    visited[i]=True
    cost[i]=cost[i]+cost[a]
print(*cost)
### BUGGY CODE ###

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




count_WA=0

AC=[]
x=[]
for i in range(M):
    a=input().split()
    x.append(a)
    if a[1]=="AC" and not(a[0] in AC):
        AC.append(a[0])

count_AC=len(AC)

for i in x:
    if i[0] in AC:
        if i[1]=="AC":

            AC.remove(i[0])
        else:
            count_WA+=1




print(count_AC,count_WA,sep=" ")


### FIXED CODE ###

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


ac = 0
wa = 0
aclist = {}
walist = {}

count_WA=0
for i in range(N):
    aclist[i + 1] = 0
    walist[i + 1] = 0

for i in range(M):
    a,b=input().split()
    a=int(a)
    if aclist[a] == 1:
        continue
    elif b == 'WA':
        walist[a] += 1
    elif b == 'AC':
        aclist[a] += 1
        ac += 1
        wa += walist[a]




print(ac,wa,sep=" ")
### BUGGY CODE ###

def dist(a,b):
    return ((a[0]-b[0])**2+(a[1]-b[1])**2)**0.5


n=int(input())
data=[]
for i in range(n):
    x,y=map(float,input().split())
    data.append((x,y))

now=(500.,500.)
move=1
for i in range(200000):
    max_dist=0
    max_dist_point=-1
    for j in range(len(data)):
        d=dist(now,data[j])
        if d>max_dist:
            max_dist=d
            max_dist_point=j
    target=data[max_dist_point]
    now=(now[0]+(target[0]-now[0])*move,now[1]+(target[1]-now[1])*move)
    move*=0.999
max_dist=0
for j in range(len(data)):
    d=dist(now,data[j])
    if d>max_dist:
        max_dist=d
print(max_dist)





### FIXED CODE ###

def dist(a,b):
    return ((a[0]-b[0])**2+(a[1]-b[1])**2)**0.5


n=int(input())
data=[]
for i in range(n):
    x,y=map(float,input().split())
    data.append((x,y))

now=(500.,500.)
move=1
for i in range(200000):
    max_dist=0
    max_dist_point=-1
    for j in range(len(data)):
        d=dist(now,data[j])
        if d>max_dist:
            max_dist=d
            max_dist_point=j
    target=data[max_dist_point]
    now=(now[0]+(target[0]-now[0])*move,now[1]+(target[1]-now[1])*move)
    move*=0.999
max_dist=0
for j in range(len(data)):
    d=dist(now,data[j])
    if d>max_dist:
        max_dist=d
print(max_dist)