Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10**6)
n,m = map(int,input().split())
e = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    e[a].append(b)
    e[b].append(a)
qv = int(input())
Q = [list(map(int,input().split())) for i in range(qv)]
Q = Q[::-1]
l = [[0]*(11) for i in range(n+1)]
for v,d,c in Q:
    if l[v][d] > 0:
        continue
    l[v][d] = c
dic = {}
color = [0]*(n+1)

left = [i for i in range(1,n+1)]
num = 0
while num < qv and left:
    v,d,c = Q[num]
    if v not in dic:
        for i in range(10,-1,-1):
            if l[v][i] > 0:
                M = i
                break
        dic[v] = [set() for i in range(n+1)]
        s = set()
        s.add(v)
        dist = [float("INF")]*(n+1)
        dist[v] = 0
        q = [v]
        for i in range(1,M+1):
            nq = []
            for now in q:
                for nex in e[now]:
                    if dist[nex]<= i:
                        continue
                    nq.append(nex)
                    dist[nex] = i
                    s.add(nex)
            dic[v][i] |= s
            q = nq
    nl = []
    
    for i in left:
        if i in dic[v][d]:
            color[i] = c
        else:
            nl.append(i) 
    num += 1
    
    left = nl
    
for i in color[1:]:
    print(i)

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(10**6)
n,m = map(int,input().split())
e = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    e[a].append(b)
    e[b].append(a)
qv = int(input())
Q = [list(map(int,input().split())) for i in range(qv)]

color = [0]*(n+1)
used = [-1]*(n+1)

for v,d,c in Q[::-1]:
    if used[v] > d:
        continue
    
    q = deque([[v,d]])
    while q:
        now, dis = q.popleft()
        if dis < 0:
            continue
        if color[now] == 0:
            color[now] = c
        for nex in e[now]:
            if used[nex] < dis-1:
                used[nex] = dis-1
                q.append([nex,dis-1])
    
for i in color[1:]:
    print(i)
# 12-Structured_Program_II-How_many_ways.py

# ????????????????????°
# 1 ?????? n ?????§?????°?????????????????????????????§???????????°?????????????????????????¨???? x ??¨??????
# ????????????????????°????±???????????????°?????????????????????????????????
# ????????°???1 ?????? 5 ?????§?????°???????????????????????§????????????????¨???? 9 ??¨???????????????????????????

# 1 + 3 + 5 = 9
# 2 + 3 + 4 = 9
# ??????????????????????????????

# Input
# ?????°??????????????????????????\?????¨???????????????????????????
# ???????????????????????§??????????????§??????????????? n???x ??? 1 ???????????????????????????

# n???x ?????¨?????? 0 ?????¨?????\?????????????????¨????????????
# n ??? 3 ??\??? 100?????\?????¨????????????

# Output
# ????????????????????????????????????????????????????????°????????????????????????????????????

# Sample Input
# 5 9
# 0 0
# Sample Output
# 2

result = []
n=[]
x=[]

while 1:
	temp = input().split() 
	if temp[0]=="0" and temp[1]=="0":
		break;
	else:
		n.append( int( temp[0] ))
		x.append( int( temp[1] ))

for i in range( len(n) ):
	count =0
	for n1 in range(1,n[i]+1-2):
		for n2 in range(n1+1, n[i]+1-1):
			for n3 in range(n2+1, n[i]+1):
				sum = n1+n2+n3
				if sum == x[i]:
					count+=1
	result.append(count)

for i in range( len(result)-1 ):
	print("{0} ".format(result[i]), end="")

print(result[i+1])

### FIXED CODE ###

# 12-Structured_Program_II-How_many_ways.py

# ????????????????????°
# 1 ?????? n ?????§?????°?????????????????????????????§???????????°?????????????????????????¨???? x ??¨??????
# ????????????????????°????±???????????????°?????????????????????????????????
# ????????°???1 ?????? 5 ?????§?????°???????????????????????§????????????????¨???? 9 ??¨???????????????????????????

# 1 + 3 + 5 = 9
# 2 + 3 + 4 = 9
# ??????????????????????????????

# Input
# ?????°??????????????????????????\?????¨???????????????????????????
# ???????????????????????§??????????????§??????????????? n???x ??? 1 ???????????????????????????

# n???x ?????¨?????? 0 ?????¨?????\?????????????????¨????????????
# n ??? 3 ??\??? 100?????\?????¨????????????

# Output
# ????????????????????????????????????????????????????????°????????????????????????????????????

# Sample Input
# 5 9
# 0 0
# Sample Output
# 2

result = []
n=[]
x=[]

while 1:
	temp = input().split() 
	if temp[0]=="0" and temp[1]=="0":
		break;
	else:
		n.append( int( temp[0] ))
		x.append( int( temp[1] ))

for i in range( len(n) ):
	count =0
	for n1 in range(1,n[i]+1-2):
		for n2 in range(n1+1, n[i]+1-1):
			for n3 in range(n2+1, n[i]+1):
				sum = n1+n2+n3
				if sum == x[i]:
					count+=1
	result.append(count)

for i in range( len(result) ):
	print(result[i])
	# if i == len(result)-1:
	# 	print(result[i])
	# else:
	# 	print("{0} ".format(result[i]), end="")
# def popcount(x):
#     bitx = bin(x)
#     cnt = bitx.count('1')
#     return cnt

n = int(input())
x = list(input())
popcount = x.count('1')
stock = [1] * (n + 1)

for i in range(1, n + 1):
    stock[i] = stock[i - 1] * 2


for i in range(n):
    tmp = x.copy()
    tmp2 = popcount
    if tmp[i] == '1':
        tmp[i] = '0'
        tmp2 -= 1
    else:
        tmp[i] = '1'
        tmp2 += 1
    num = 0
    if tmp[i] == '0':
        for i in range(n):
            num += tmp[i] * stock[i]
    
    if tmp2 == 0:
        print(0)
    elif num>0 and num % tmp2 == 0:
        print(1)
    elif tmp[n - 1] == '1' and tmp2 % 2 == 0 and tmp2 > 2:
        print(3)
    else:
        print(2)

### FIXED CODE ###

import sys
# import math
# import bisect
# import numpy as np
# from decimal import Decimal
# from numba import njit, i8, u1, b1 #JIT compiler
# from itertools import combinations, product
# from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_ints2(x):   return map(lambda num: int(num) - x, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def GCD(a: int, b: int) -> int: return b if a%b==0 else GCD(b, a%b)
def LCM(a: int, b: int) -> int: return (a * b) // GCD(a, b)

def popcount(num):
    cnt = 0
    while num > 0:
        num %= bin(num).count('1')
        cnt += 1
    return cnt

def Main():
    n = read_int()
    x = read_str()
    x_int = int(x, 2)

    cnt = x.count('1')
    minus_cnt = cnt - 1
    plus_cnt = cnt + 1
    
    minus_mod = x_int % minus_cnt if minus_cnt != 0 else 0
    plus_mod = x_int % plus_cnt

    for i in range(n):
        if x[i] == '0':
            print(popcount((plus_mod + pow(2, n - 1 - i, plus_cnt)) % plus_cnt) + 1)
        elif minus_cnt != 0:
            print(popcount((minus_mod - pow(2, n - 1 - i, minus_cnt)) % minus_cnt) + 1)
        else:
            print(0)

if __name__ == '__main__':
    Main()
from math import gcd
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


class SegmentTree:
    # セグ木は 1-indexed
    def __init__(self, n, initial=0):
        """
        n: 配列の大きさ
        initial: 単位元 (RMQでは大きな値)
        """
        self.offset = 2**(n-1).bit_length()  # 2進数表記の長さ
        self.initial = initial
        self.seg = [self.initial] * (2 * self.offset)
        

    def build(self, A):
        """
        A: 処理したい配列
        """
        for i, a in enumerate(A, start=self.offset):
            self.seg[i] = a
        for i in range(self.offset-1,0,-1):
            self.seg[i] = gcd(self.seg[i<<1] ,self.seg[(i<<1)+1])

            
    def update(self, k, a):
        """
        k番目の値をaに変更
        """
        k += self.offset
        self.seg[k] = a
        while k:
            k >>= 1
            self.seg[k] = gcd(self.seg[k<<1], self.seg[(k<<1)+1])

            
    def query(self, a, b):
        """
        区間[a, b)に対して最小公倍数を求める
        """
        a += self.offset
        b += self.offset - 1 
        res = self.initial
        while a < b:
            if a & 1:  # 兄弟の右なら
                res = gcd(res, self.seg[a])
                a += 1
            if not b & 1:  # 兄弟の左なら
                res = gcd(res, self.seg[b])
                b -= 1
            a >>= 1
            b >>= 1
        
        if a == b:
            res = gcd(res, self.seg[a])
        
        return res


if __name__ == "__main__":
    N = int(readline())
    A = [int(i) for i in readline().split()]
    seg = SegmentTree(N)
    seg.build(A)

    ans = seg.query(1, N)
    for i in range(N-2):
        tmp = gcd(seg.query(0, i+1), seg.query(i+2, N))
        ans = max(ans, tmp)
    ans = max(ans, seg.query(0, N-1))

    print(ans)

### FIXED CODE ###

from fractions import gcd

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

L = []
R = []
L.append(a[0])
R.append(a[-1])

for i in range(N-2):
    L.append(gcd(L[-1], a[i+1]))
    R.append(gcd(R[-1], a[-(i+2)]))

ans = max(L[-1], R[-1])
for i in range(N-2):
    tmp = gcd(L[i], R[-(i+2)])
    if tmp > ans:
        ans = tmp

print(ans)
a = map(int,input().split(" "))
b = map(int,input().split(" "))
c = map(int,input().split(" "))
bs = sorted(b)
cs = sorted(c)

x = 0

f = range(a[0])
g = range(a[1])

for i in range(a[0]):
    for ii in range(i,a[0]):
        for j in range(a[1]):
            for jj in range(j,a[1]):
                x = x + ((bs[ii] - bs[i]) * (cs[jj] - cs[j]))
                if x > (10**9 + 7):
                    x = x % (10**9 + 7)

ans = x

print(ans)

### FIXED CODE ###

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

x = 0
y = 0

for i in range(1,a[0]):
    x = x + b[i] - b[0]
    
xx = x
for i in range(1,a[0]-1):
    xx = xx - ((b[i] - b[i - 1]) * (a[0] - i))
    x = x + xx

for i in range(1,a[1]):
    y = y + c[i] - c[0]
    
yy = y
for i in range(1,a[1]-1):
    yy = yy - ((c[i] - c[i - 1]) * (a[1] - i))
    y = y + yy

ans = x * y
ans = ans % (10**9 + 7)

print(ans)
from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall
N,K,Q = map(int,input().split())
A=[]*Q
score = [K] * N

for i in range(Q):
    win = int(input())
    score[win] += 1

for i in range(Q):
    if score[i]-Q > 0:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

from enum import Enum
from queue import Queue

import numpy as np

import collections
import bisect
import sys
import math

from scipy.sparse.csgraph import floyd_warshall
N,K,Q = map(int,input().split())
score = [K] * N

for i in range(Q):
    win = int(input())
    score[win-1] += 1

for i in range(N):
    if score[i]-Q > 0:
        print('Yes')
    else:
        print('No')
input()
A=list(map(int,input().split()))
cnt=0
while all(a%2==0 for a in A):
  A=[a/2 for a in A]
  cnt++
print(cnt)

### FIXED CODE ###

input()
A=list(map(int,input().split()))
cnt=0
while all(a%2==0 for a in A):
  A=[a/2 for a in A]
  cnt+=1
print(cnt)
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = 0

if A > B:
	E += B
elif :
	E += A
	if C > D:
		E += D
	elif :
		E += C
print(E)


### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
sum = 0

if A > B:
	sum += B
else:
	sum += A
if C > D:
	sum += D
else :
	sum += C
	
print(sum)
a,p= map(int,input().split())
if a>=13:
  print(b)
elif 6<=a<=12:
  print(b/2)
else:
  print(0)

### FIXED CODE ###

a,p= map(int,input().split())
if a>=13:
  print(p)
elif 6<=a<=12:
  print(int(p/2))
else:
  print(0)
#r+p = 2*a -> p = 2*a-r
r, a = map(int, input().split())
print(2*a-r)

### FIXED CODE ###

r = int(input())
a = int(input())
print(a*2-r)
def GCD(x,y):

    if(x >= y):
        z = y
        w = x%y
    else:
        z = x
        w = y%x

    if(not(w == 0)):
        return GCD(z,w)
    else:
        return z

a = int(input())
b = int(input())
print(GCD(a,b))


### FIXED CODE ###

def GCD(x,y):

    if(x >= y):
        z = y
        w = x%y
    else:
        z = x
        w = y%x

    if(not(w == 0)):
        return GCD(z,w)
    else:
        return z

A = [int(i) for i in input().split()]
print(GCD(A[0],A[1]))

"""実行結果

100 55
5



66 77
11

"""
#coding:UTF-8

a,op,b = map(raw_input().split())
a = int(a)
b = int(b)

while True:
    if op == '+':
        print a + b
    elif op == '-':
        print a - b
    elif op == '*':
        print a * b
    elif op == '/':
        print a / b
    else:
        break

### FIXED CODE ###

#coding:UTF-8

while True:
    a,op,b = map(str,raw_input().split())
    a = int(a)
    b = int(b)
    if op == '+':
        print a + b
    elif op == '-':
        print a - b
    elif op == '*':
        print a * b
    elif op == '/':
        print a / b
    else:
        break
import math
n,k = map(int,input().split())
a_list = [i for i in map(int,input().split())]
a_list.sort()
maxi = 0
if k == 0:
    maxi = sum(a_list)
else:
    max_keta = math.floor(math.log(a_list[-1],2))+1
    k_keta = math.floor(math.log(k,2))+1
    cnt_list = [0 for i in range(k_keta)]
    for i in a_list:
        tmp = i
        keta = -1
        while tmp != 0:
            a = tmp % 2
            tmp = int(tmp/2)
            if a == 1:
                cnt_list[keta] += 1
            keta = keta -1

    goukei = 0
    for i in range(k_keta-1,-1,-1):
        if cnt_list[-1*(i+1)] <= n / 2 and (goukei + 2**i) <= k:
            goukei +=  2**i
            maxi += (2**i) * (n - cnt_list[-1*(i+1)])

        else:
            maxi += (2**i) * (cnt_list[-1*(i+1)])
print(maxi)


### FIXED CODE ###

import math
n,k = map(int,input().split())
a_list = [i for i in map(int,input().split())]
cnt_list = [0 for i in range(40)]
maxi = 0
if k == 0:
    maxi = sum(a_list)
else:
    for i in a_list:
        b = bin(i)[2:]
        b = b[::-1]
        for index,j in enumerate(b):
            cnt_list[-(index+1)] += int(j)
    goukei = 0
    for i in range(40):
        if cnt_list[i] <= n/2 and (goukei + 2**(39-i)) <= k:
            goukei += 2**(39-i)
            maxi += (2**(39-i)) * (n - cnt_list[i])
        else:
            maxi += (2**(39-i)) * (cnt_list[i])

print(maxi)
V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]+1] += 1

for i in range(N):
    if P[i] - Q <=0:
        print("No")
    if P[i] - Q > 0:
        print("Yes")

### FIXED CODE ###

V = input().split()
N = int(V[0])
K = int(V[1])
Q = int(V[2])
A = [0 for i in range(Q)]
P = [K for i in range(N)]
for i in range(Q):
    A[i] = int(input())

for i in range(Q):
    P[A[i]-1] += 1

for i in range(N):
    if P[i] - Q <=0:
        print("No")
    if P[i] - Q > 0:
        print("Yes")
n,k= map(int, input().split())
a= list(map(int, input().split()))
a.sort()

if k==0:
    print(a[-1])
    exit()


# めぐる式二部探索
l=-1
r=pow(10,11)
while r-l>1:
    # rは常にOK、lは常にNG。
    mid=l+(r-l)//2
    cnt=k
    flag=True
    for i in range(n):
        if a[i]>mid:
            x=a[i]//mid
            cnt-=x

    # なんらかの判定
    if cnt>=0:
        r = mid  # 判定がOKのとき→範囲を左に狭める
    else:
        l = mid  # 判定がNGのとき→範囲を右に狭める

print(r)

### FIXED CODE ###

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

if k==0:
    print(a[-1])
    exit()


# めぐる式二部探索
l=0
r=pow(10,11)
while r-l>1:
    # rは常にOK、lは常にNG。
    mid=l+(r-l)//2
    cnt=k
    flag=True
    for i in range(n):
        if a[i]>mid:
            x=-(-a[i]//mid)-1
            cnt-=x

    # なんらかの判定
    if cnt>=0:
        r = mid  # 判定がOKのとき→範囲を左に狭める
    else:
        l = mid  # 判定がNGのとき→範囲を右に狭める

print(r)
import bisect

s = list(input())
t = list(input())

# 辞書を作る
dictionary = {}

tt = t[:]
ss = s * 2

i = 0
while len(ss):
    _s = ss.pop(0)
    if _s not in dictionary:
        dictionary[_s] = [i]
    else:
        dictionary[_s].append(i)
    i += 1

result = 0
before = 0
sLen = len(s)
while len(t) > 0:
    _t = t.pop(0)
    next = dictionary[_t][bisect.bisect_left(dictionary[_t], before)] + 1
    result += next - before
    before = next
    if next >= sLen:
        before -= sLen

print(result)




### FIXED CODE ###

import bisect

s = list(input())
t = list(input())

# 辞書を作る
dictionary = {}

tt = t[:]
ss = dict(zip(list(range(len(s * 2))), s * 2))

for i in range(len(ss)):
    c = ss[i]
    if c not in dictionary:
        dictionary[c] = []
    dictionary[c].append(i)

result = 0
current_idx = 0
sLen = len(s)

for c in t:
    if c not in dictionary:
        print(-1)
        exit(0)
    indexes = dictionary[c]
    next = dictionary[c][bisect.bisect_left(indexes, current_idx)] + 1
    result += next - current_idx
    current_idx = next
    if next >= sLen:
        current_idx -= sLen

print(result)
N = int(input())
A = list(map(int, input().split()))
syoji = 1000
kabu = 0
kai = 0
uri = 0
if N ==1:
  print(syoji)
  exit()
sw = 0
for i in range(N):
  if kabu == 0 and A[i] < A [i+1]:
    for j in range(i+1,N):
      if sw ==1 and uri >= A[j]:
        break

      elif  A[i] < A[j]:
        uri = A[j]
        sw = 1

    if sw ==1:
      for num in range (1000000000):
        if syoji < num*A[i]:
          kabu = num-1
          syoji = syoji - (num-1)*A[i]
          kai = A[i]
          sw = 0
          break
  elif kabu > 0 and A[i]==uri:
    syoji = syoji + kabu*A[i]
    kabu = 0
    uri = 0

        
print(syoji)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
syoji = 1000
kabu = 0
kai = 0
uri = 0
if N ==1:
  print(syoji)
  exit()
sw = 0
for i in range(N):
  if i<N-1 and kabu == 0 and A[i] < A [i+1]:
    for j in range(i+1,N):
      if sw ==1 and uri >= A[j]:
        break
 
      elif  A[i] < A[j]:
        uri = A[j]
        sw = 1
    if sw ==1:
      kabu = syoji // A[i]
      syoji = syoji - kabu*A[i]
      kai = A[i]
      sw = 0
  elif kabu > 0 and A[i]==uri:
    syoji = syoji + kabu*A[i]
    kabu = 0
    uri = 0
 
        
print(syoji)
n,k=map(int,input().split())
a=list(map(int,input().split()))
one_p=a.index(1)
ans=0
if n!=k:
  ans=ans+(one_p)//(k-1) if (one_p)%(k-1)==0 else ans+(one_p)//(k-1)+1
  ans=ans+(n-one_p)//(k-1) if (n-one_p)%(k-1)==0: else ans+(n-one_p)//(k-1)+1
else:
  ans=1
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
ans=1
while n>ans*(k-1)+1:
  ans=ans+1
print(ans)
import sys

sys.setrecursionlimit(10**9)
n,m=map(int,input().split())

g=[[] for i in range(n)]
for i in range(m):
  v1,v2=map(int,input().split())
  v1-=1;v2-=1
  g[v1].append(v2)

dp=[-1]*n  
  
def dfs(i):
  temp=0
  for nv in g[i]:
    if dp(nv)!=-1:
      temp=max(temp, dp[nv])
    else:  
    	temp=max(temp,dfs(nv)+1)
    
  return temp  
    
res=0
for i in range(n):
  res=max(res,dfs(i))
print(res)

### FIXED CODE ###

import sys

sys.setrecursionlimit(10**9)
n,m=map(int,input().split())

g=[[] for i in range(n)]
for i in range(m):
  v1,v2=map(int,input().split())
  v1-=1;v2-=1
  g[v1].append(v2)

dp=[-1]*n  
  
def dfs(i):
  if dp[i]!=-1:
    return dp[i]
  temp=0
  for nv in g[i]:
    temp=max(temp,dfs(nv)+1)
  dp[i]=temp  
  return temp  
    
res=0
for i in range(n):
  res=max(res,dfs(i))
print(res)
N, M = map(int, input().split())
N = int(N)
M = int(M)

ab = []
for _ in range(M):
  ab.append(list(map(int, input().split()))
           
bridges = [0] * N
            
for c in range(N):
  for i in range(M):
    if c+1==ab[i][0] or c+1==ab[i][1]:
      bridges[c] += 1
            
 
for _ in range(N):
  print(bridges[_] ) 

### FIXED CODE ###

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


ab = []
for _ in range(M):
  ab.append(list(map(int, input().split())))
  
           
bridges = [0] * N
            
for c in range(N):
  for i in range(M):
    if c+1==ab[i][0] or c+1==ab[i][1]:
      bridges[c] += 1
            
 
for _ in range(N):
  print(bridges[_] )
a=map(int,input().split())
a.sort()
print(a[0]+a[1])

### FIXED CODE ###

a=list(map(int,input().split()))
a.sort()
print(a[0]+a[1])
import itertools
N = int(input())
item = []
for i in range(N):
    A = int(input())
    s = []
    for ii in range(A):
        x, y = map(int, input().split())
        s.append((x, y))
        item.append(s)

Ps = itertools.product([0, 1], repeat=N)
ans = 0
for P in Ps:
    right = True
    for i, p in enumerate(P):
        if p == 1:
            for x, y in item[i]:
                if (y == 1 and P[x - 1] == 0) or (y == 0 and P[x - 1] == 1):
                    right = False
    if right:
        ans = max(ans, sum(P))

print(ans)

### FIXED CODE ###

import itertools
N = int(input())
item = []
for i in range(N):
    A = int(input())
    s = []
    for ii in range(A):
        x, y = map(int, input().split())
        s.append((x, y))
    item.append(s)

Ps = itertools.product([0, 1], repeat=N)
ans = 0
for P in Ps:
    right = True
    for i, p in enumerate(P):
        if p == 1:
            for x, y in item[i]:
                if (y == 1 and P[x - 1] == 0) or (y == 0 and P[x - 1] == 1):
                    right = False
    if right:
        ans = max(ans, sum(P))

print(ans)
def main():
    N=input()
    A=list(map(int, input().split()))

    mod_value = 10**9 + 7
    sum_ = 0
    for i in range(len(A)-1):
        sum_ = sum_ + A[i]*sum(A[i+1:]) % mod_value
    print(sum_ % mod_value)
main()

### FIXED CODE ###

def main():
    D, T, S = map(int, input().split())
    if float(T) < float(D) /float(S) :
        print("No")
    else:
        print("Yes")
    #N = int(input())
    #A = [int(s) for s in input().split()]
    #

main()
k = int(input())
a, b = int(input())
if k <= b-a+1:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

def main():
  k = int(input())
  a, b = map(int,input().split())
  for i in range(a, b+1):
    if i%k ==0:
      print('OK')
      return
  print('NG')
  return
 
main()
l,k = map(int,input().split())
print(sum(sorted(map(int,input().split())[:k]))

### FIXED CODE ###

n,k = map(int,input().split())
print(sum(sorted(map(int,input().split()))[n-k:]))
import sys
F = sys.stdin
N, M = map(int, F.readline().strip("\n").split())
Edge = [[] for _ in range(N)]
for _ in range(M):
    A, B = map(int, F.readline().strip("\n").split())
    Edge[A-1].append(B-1)
    Edge[B-1].append(A-1)

Color = [0] * N


def dfs(v, c):
    Color[v] = c
    for next in Edge[v]:
        if Color[next] == c: return False
        if Color[next] == 0:
            if not dfs(next, -c): return False
    return True

Bipartite = dfs(0, 1)
if Bipartite:
    black = Color.count(1)
    print(black * (N-black) - M)
else:
    print(N * (N - 1)//2 - M)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
F = sys.stdin
N, M = map(int, F.readline().strip("\n").split())
Edge = [[] for _ in range(N)]
for _ in range(M):
    A, B = map(int, F.readline().strip("\n").split())
    Edge[A-1].append(B-1)
    Edge[B-1].append(A-1)

Color = [0] * N


def dfs(v, c):
    Color[v] = c
    for next in Edge[v]:
        if Color[next] == c: return False
        if Color[next] == 0:
            if not dfs(next, -c): return False
    return True

Bipartite = dfs(0, 1)
if Bipartite:
    black = Color.count(1)
    print(black * (N-black) - M)
else:
    print(N * (N - 1)//2 - M)
s = input()
S = len(s)

print(x*S)

### FIXED CODE ###

s = input()
S = len(s)

print("x"*S)
N = int(input())
K = int(input())
ans = 0
for i in range(N):
  if int(input()) >= K:
    ans += 1
    
print(ans)

### FIXED CODE ###

NK = [int(a) for a in input().split()]
h = [int(a) for a in input().split()]
ans = 0
for i in range(NK[0]):
  if h[i] >= NK[1]:
    ans += 1
    
print(ans)