Harryxun/stf_run huggingface dataset:
edges, vertices = map(int, input().split())
dp = [None for _ in range(100000)]

nodes = [[] for _ in range(100000)]

for i in range(vertices):
    start, end = map(int, input().split())
    nodes[end -1].append(start-1)


def find(arr):
    if not len(arr):
        return 0
    for x in arr:
        if dp[x] is None:
            dp[x] = find(nodes[x])
    return 1 + max(dp[x] for x in arr)



print(nodes) 
for i in range(edges):
    dp[i] = find(nodes[i])

print(max(dp))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
edges, vertices = map(int, input().split())
dp = [None for _ in range(edges)]

nodes = [[] for _ in range(edges)]

for i in range(vertices):
    start, end = map(int, input().split())
    nodes[end -1].append(start-1)

def find(arr):
    if not len(arr):
        return 0
    for x in arr:
        if dp[x] is None:
            dp[x] = find(nodes[x])
    return 1 + max(dp[x] for x in arr)

for i in range(edges):
    dp[i] = find(nodes[i])

print(max(dp))
import sys
import numpy as np

n = int(input())

a = []
b = []

for i in range(n):
    x, y = map(int, input().split())
    a.append(x)
    b.append(y)

a = np.array(a)
b = np.array(b)

diff = b - a

li = []
for x, y, z in zip(diff, a, b):
    li.append((x, y, z))

li = sort()
li = li[::-1]

stack = 0
for _, a, b in li:
    stack += a
    if stack > b:
        print("No")
        sys.exit()

print("Yes")

### FIXED CODE ###

import sys

n = int(input())
ab = [list(map(int, input().split())) for _ in range(n)]

ab.sort(key=lambda x: x[1])

now = 0

for a, b in ab:
    now += a
    if now > b:
        print("No")
        sys.exit()

print("Yes")
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
begin = sum(a)
c = 0
for i in range(n):
  a[i] = a[i]-c[i] if a[i]>c[i] else 0
  c = 0
  a[i] = a[i]-b[i] if a[i]>b[i] else 0
  c = b[i] - a[i] if b[i]>a[i] else 0
a[n] = a[n]-c if a[n]>c else 0
after = sum(a)
print(begin-after)


### FIXED CODE ###

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

c = [0]*(n+1)
ans = 0
for i in range(n):
  if b[i]+c[i] > a[i]:
    if c[i]>=a[i]:
      ans = ans + a[i]
      c[i+1] = b[i]
    else:
      ans = ans + a[i]
      c[i+1] = b[i]+c[i]-a[i]
  else:
    ans = ans + b[i] + c[i]
if c[n]>a[n]:
  ans = ans + a[n]
else:
  ans = ans + c[n]
print(ans)
# D
N = int(input())
a_list = [0]*N
for i in range(N):
    a_list[i] = int(input())

L = 90001
LARGE = 998244353

DP = np.zeros(L, dtype="int")
DP[0] = 1
for i in range(N):
    for j in range(L-1, a_list[i]-1, -1):
        DP[j] = (2*DP[j] + DP[j - a_list[i]]) % LARGE
    for j in range(a_list[i]-1, -1, -1):
        DP[j] = (2*DP[j]) % LARGE

DP2 = np.zeros(L, dtype="int")
DP2[0] = 1
for i in range(N):
    for j in range(L-1, a_list[i]-1, -1):
        DP2[j] = (DP2[j] + DP2[j - a_list[i]]) % LARGE
    for j in range(a_list[i]-1, -1, -1):
        DP2[j] = (DP2[j]) % LARGE
S = sum(a_list)
if S % 2 == 0:
    h = S // 2
    res = ((3**N % LARGE) - (3*sum(DP[(h):]) % LARGE) + 3*DP2[h]) % LARGE
else:
    h = S // 2 + 1
    res = ((3**N % LARGE) - (3*sum(DP[(h):]) % LARGE)) % LARGE
print(res)

### FIXED CODE ###

# D
N = int(input())
a_list = [0]*N
for i in range(N):
    a_list[i] = int(input())

L = 90001
LARGE = 998244353

DP = [0]*L
DP[0] = 1
for i in range(N):
    for j in range(L-1, a_list[i]-1, -1):
        DP[j] = (2*DP[j] + DP[j - a_list[i]]) % LARGE
    for j in range(a_list[i]-1, -1, -1):
        DP[j] = (2*DP[j]) % LARGE

DP2 = [0]*L
DP2[0] = 1
for i in range(N):
    for j in range(L-1, a_list[i]-1, -1):
        DP2[j] = (DP2[j] + DP2[j - a_list[i]]) % LARGE
    for j in range(a_list[i]-1, -1, -1):
        DP2[j] = (DP2[j]) % LARGE
S = sum(a_list)
if S % 2 == 0:
    h = S // 2
    res = ((3**N % LARGE) - (3*sum(DP[(h):]) % LARGE) + 3*DP2[h]) % LARGE
else:
    h = S // 2 + 1
    res = ((3**N % LARGE) - (3*sum(DP[(h):]) % LARGE)) % LARGE
print(res)
n=int(input())
x=1000000000000000000
res=1
for i in range(n):
	res=res*int(input())
if(res>x):
	print("-1")
else:
	print(res)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
res=1
if 0 in a:
  print("0")
else:
  for x in a:
    res=res*x
    if(res>1000000000000000000):
      res=-1
      break
  print(res)
while True:
    x = input().split()
    x_int = [int(i) for i in x]
    if x_int[0] == 0 and x_int[1] == 0:
        break
    else:
        print('{} {}'.format(x_int[1],x_int[0]))

### FIXED CODE ###

while True:
    x = input().split()
    x_int = [int(i) for i in x]
    if x_int[0] == 0 and x_int[1] == 0:
        break
    else:
        x_int.sort()
        print('{} {}'.format(x_int[0],x_int[1]))
li_a = list(map(int,input().split()))
li_b = list(map(int,input().split()))
li_c = list(map(int,input().split()))
n = int(input())
li_num=[int(input()) for i in range(n)]
 
li_card = [li_a, li_b, li_c]
 
ans = False
 
#print(li_card)
#print(li_b)
#print(li_c)
#print(n)
#print(li_num)
 
for m in li_num:
    for i in range(3):
        for j in range(3):
          if li_card[i][j] == m:
              li_card[i][j] = 0
 
for i in range(3):
    if li_card[i][0] == li_card[i][1] == li_card[i][2]:
        ans = True
        break
    elif li_card[0][i] == li_card[1][i] == li_card[2][i]:
        ans = True
        break
 
if not ans:
  if li_card[0][0] == li_card[1][1] == li_card[2][2]:
      ans = True
  elif li_card[0][2] == li_card[1][1] == licard[2][0]:
      ans = True
 
if ans:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

li_a = list(map(int,input().split()))
li_b = list(map(int,input().split()))
li_c = list(map(int,input().split()))
n = int(input())
li_num=[int(input()) for i in range(n)]
 
li_card = [li_a, li_b, li_c]
 
ans = False
 
#print(li_card)
#print(li_b)
#print(li_c)
#print(n)
#print(li_num)
 
for m in li_num:
    for i in range(3):
        for j in range(3):
          if li_card[i][j] == m:
              li_card[i][j] = 0
 
for i in range(3):
    if li_card[i][0] == li_card[i][1] == li_card[i][2] == 0:
        ans = True
        break
    elif li_card[0][i] == li_card[1][i] == li_card[2][i] == 0:
        ans = True
        break
 
if not ans:
  if li_card[0][0] == li_card[1][1] == li_card[2][2] == 0:
      ans = True
  elif li_card[0][2] == li_card[1][1] == li_card[2][0] == 0:
      ans = True
 
if ans:
  print("Yes")
else:
  print("No")
from sys import stdin
def main():
    n = int(stdin.readline())
    e = [[] for _ in xrange(n)]
    for line in stdin:
        x, y = map(int, line.split())
        x -= 1
        y -= 1
        e[x].append(y)
        e[y].append(x)
    d = [None] * n
    st = []
    pu = st.append
    po = st.pop
    pu(0)
    d[0] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    y = 0
    for i, x in enumerate(d):
        if y < x:
            y = x
            j = i
    d = [None] * n
    pu(j)
    d[j] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    x = max(d)
    print 'Second' if x % 3 == 1 else 'First'
main()


### FIXED CODE ###

from sys import stdin
def main():
    n = int(stdin.readline())
    e = [[] for _ in xrange(n)]
    for line in stdin:
        x, y = map(int, line.split())
        x -= 1
        y -= 1
        e[x].append(y)
        e[y].append(x)
    d = [None] * n
    st = []
    pu = st.append
    po = st.pop
    pu(0)
    d[0] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    y = -1
    for i, x in enumerate(d):
        if y < x:
            y = x
            j = i
    d = [None] * n
    pu(j)
    d[j] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    x = max(d)
    print 'Second' if x % 3 == 1 else 'First'
main()
X, K, D = input().split()
X = abs(X)
Q, mod = divmod(X, D)
if K < Q:
    ans = X - K*D
else:
    Rest = (K - Q)%2
    if Rest == 0:
         ans = mod
    else:
         ans = D - mod
print(ans)

### FIXED CODE ###

s = input().split()
X=int(s[0])
K=int(s[1])
D=int(s[2])
q, mod = divmod(X, D)
if q < 0:
  q = -q
if 2*mod < D:
   if K < q:
      if X > 0:
         m = X - D*K
      else:
         m = X + D*K
   else:
       restmovement = (K-q)%2
       if restmovement==0:
          m = mod
       else:
          m = D - mod
else:
   if X > 0:
      if K < q+1:
         m = X - D*K
      else:
         restmovement = (K - q - 1)%2
         if restmovement==0:
                    m = D - mod
         else:
                    m = mod
   else:
       if K < q-1:
          m=X - D*K
       else:
          restmovement = (K+1-q)%2
          if restmovement==0:
                m = D-mod
          else:
                m = mod
if m < 0:
   print(-m)
else:
   print(m)
n=int(input())
kei = 0.0
for i in range(n):
    x=list(input().split())
    u=list(map(str,input().split()))
    if u[i]=="JPY":
        kei += float(x[i])
    else:
        kei += float(x[i])*380000.0
print(kei)

### FIXED CODE ###

n=int(input())
kei = 0.0
for i in range(n):
    x,u=map(str,input().split())
    if u=="JPY":
        kei += float(x)
    else:
        kei += float(x)*380000.0
print(kei)
N,W = map(int, input().split())
ws = []
vs = []
for i in range(N):
    w,v = map(int, input().split())
    ws.append(w)
    vs.append(v)
ws_m = [w-ws[0] for w in ws]

"""
i番目まで見て、n個選んでいて、重さがwのときのvの最大値
ただし、wはN個選んだときにW-N*[w[0]]となっているので、そこをmaxとする
dp[i][n][w] 
"""
dp = [[[-1]*(3*N+1) for i in range(N+1)] for j in range(N+1)]
dp[0][0][0] = 0
for i,(w,v)  in enumerate(zip(ws_m,vs)):
    for n in range(i+1):
        for j in range(W-n*ws[0]+1):
            if dp[i][n][j] == -1: continue
            if dp[i][n][j]+v >= dp[i][n][j+w]:
                # print("aa",i,n,j,v)
                dp[i+1][n+1][j+w] = dp[i][n][j] + v
            # else:
                # dp[i+1][n][j+w] = dp[i][n][j+w]
            dp[i+1][n][j] = max(dp[i+1][n][j], dp[i][n][j])
ans= 0
for i,As in enumerate(dp[N]):
    w = W - i*ws[0]
    if w > 0:
        ans = max(ans,max(As[:w+1]))
print(ans)   

### FIXED CODE ###

N,W = map(int, input().split())
ws = []
vs = []
for i in range(N):
    w,v = map(int, input().split())
    ws.append(w)
    vs.append(v)
ws_m = [w-ws[0] for w in ws]

"""
i番目まで見て、n個選んでいて、重さがwのときのvの最大値
ただし、wはN個選んだときにW-N*[w[0]]となっているので、そこをmaxとする
dp[i][n][w] 
"""
dp = [[[-1]*(3*N+10) for i in range(N+1)] for j in range(N+1)]
dp[0][0][0] = 0
for i,(w,v)  in enumerate(zip(ws_m,vs)):
    for n in range(i+1):
        for j in range(3*N):
            dp[i+1][n][j] = max(dp[i+1][n][j], dp[i][n][j])
            # if dp[i][n][j] == -1: continue
            if j + (n+1)*ws[0] + w <= W:
                dp[i+1][n+1][j+w] = max(dp[i][n][j+w], dp[i][n][j] + v)

ans= 0
for i,As in enumerate(dp[N]):
    w = min(W - i*ws[0], sum(ws_m))
    if w >= 0:
        ans = max(ans,max(As[:w+1]))
print(ans)
input = raw_input().split(" ")
output = 0;
if input[1] == "+":
    output = input[0] + input[2]
else:
    output = input[0] - input[2]

print(output)

### FIXED CODE ###

input = input().split(" ")
output = 0;
if input[1] == "+":
    output = int(input[0]) + int(input[2])
else:
    output = int(input[0]) - int(input[2])

print(output)
N,K = map(int,input().split())
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
l = len(ROOP)

num = (K-l-roopstart) % (l)
print(ROOP[num])

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
adj_list=[0]*N
for i in range(N):
    adj_list[i]=(A[i])
k=0
node = 1
c=[0]*N
count=1
flag=0
ROOP=[]
roopstart=0
while k<K:
    k+=1
    c[node-1]+=1
    node = adj_list[node-1]
    if c[node-1] ==1:
        if flag ==0:
            roopstart = k
            flag=1
        ROOP.append(node)
    if c[node-1] ==2:
        break
l = len(ROOP)
if l != 0:
    num = (K-l-roopstart) % (l)
    print(ROOP[num])
else:
    print(node)
#!/usr/bin/python3
import sys
from functools import reduce
from operator import mul
input = lambda: sys.stdin.readline().strip()
n, k = [int(x) for x in input().split()]
a = sorted((int(x) for x in input().split()), key=abs)
sgn = [x // abs(x) for x in a]
M = 10**9 + 7
def modmul(x, y):
    return x * y % M
if reduce(mul, sgn[-k:]) >= 0:
    print(reduce(modmul, a[-k:]))
elif any(x > 0 for x in a[:n-k]):
    rem = next(i for i, x in enumerate(a[-k:]) if x < 0)
    print(next(x for x in reversed(a[:n-k]) if x > 0) * reduce(modmul, (x for i, x in enumerate(a[-k:]) if i != rem), default=1) % M)
else:
    print(reduce(modmul, a[:k]))

### FIXED CODE ###

#!/usr/bin/python3
import sys
from functools import reduce
from operator import mul
input = lambda: sys.stdin.readline().strip()
n, k = [int(x) for x in input().split()]
a = sorted((int(x) for x in input().split()), key=abs)
sgn = [0 if x == 0 else x // abs(x) for x in a]
M = 10**9 + 7
def modmul(x, y):
    return x * y % M
if reduce(mul, sgn[-k:]) >= 0:
    print(reduce(modmul, a[-k:], 1))
else:
    largest_unselected_neg = next(i for i, x in enumerate(reversed(a[:-k])) if x < 0) if any(x < 0 for x in a[:-k]) else None
    largest_unselected_pos = next(i for i, x in enumerate(reversed(a[:-k])) if x > 0) if any(x > 0 for x in a[:-k]) else None
    smallest_selected_neg = next(i for i, x in enumerate(a[-k:]) if x < 0) if any(x < 0 for x in a[-k:]) else None
    smallest_selected_pos = next(i for i, x in enumerate(a[-k:]) if x > 0) if any(x > 0 for x in a[-k:]) else None
    can1 = largest_unselected_neg is not None and smallest_selected_pos is not None
    can2 = largest_unselected_pos is not None and smallest_selected_neg is not None
    def ans1():
        return list(reversed(a[:-k]))[largest_unselected_neg] * reduce(modmul, (x for i, x in enumerate(a[-k:]) if i != smallest_selected_pos), 1) % M 
    def ans2():
        return list(reversed(a[:-k]))[largest_unselected_pos] * reduce(modmul, (x for i, x in enumerate(a[-k:]) if i != smallest_selected_neg), 1) % M
    if can1 and not can2:
        print(ans1())
    elif can2 and not can1:
        print(ans2())
    elif can1 and can2:
        if list(reversed(a[:-k]))[largest_unselected_neg] * a[-k:][smallest_selected_neg] > list(reversed(a[:-k]))[largest_unselected_pos] *  a[-k:][smallest_selected_pos]:
            print(ans1())
        else:
            print(ans2())
    else:
        print(reduce(modmul, a[:k], 1))
N, Q = map(int, input().split())
S = str(input())
position = []
for i in range(N):
    if S[i] == "A" and S[i + 1] == "C":
        position.append(i)

answers = []

for i in range(Q):
    l, r = map(int, input().split())
    l -= 1
    r -= 2
    
    low = 0
    high = len(position)
    t = (low + high)//2
   
    while low<=high:
        
        if l == position[t]:
            break
        elif l > position[t]:
            if l < position[t-1]:
                break
            else:
                low = t + 1
        elif l < position[t]:
            high = t - 1
        
        tmp = (low + high) // 2
        if 0 <= tmp <= len(position) - 1:
            t = tmp
        else:
            break
    
     
    low = 0
    high = len(position)
    s = (low + high)//2
    while low<=high:
       
        if r == position[s]:
            break
        elif r > position[s]:
            low = s + 1
        elif r < position[s]:
            if r > position[s+1]:
                break
            else:
                high = s - 1
        tmp = (low + high) // 2
        if 0 <= tmp <= len(position) - 1:
            s = tmp
        else:
            break
    
    answer = s - t + 1
    if s == t:
        if not l <= position[s] <= r:
            answer = 0
    
        
    answers.append(answer)
    
for x in answers:
    print(x)

### FIXED CODE ###

N, Q = map(int, input().split())
S = str(input())
position = [0] * N
count = 0
for i in range(N-1):
    if S[i] == "A" and S[i + 1] == "C":
        count += 1
    position[i+1] = count
answers = []
for i in range(Q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    answer = position[r] - position[l]
    answers.append(answer)
for i in range(Q):
    print(answers[i])
n, a, b, c, d = map(int, input().split())
a -= 1
b -= 1
c -= 1
d -= 1
s = input()

if c < d:
    # ふぬけ君を動かす
    for i in range(b, d):
        if s[i] == s[i+1] and s[i] == "#":
            print("No")
            exit()
    # すぬけ君を動かす
    for i in range(a, c):
        if s[i] == s[i+1] and s[i] == "#":
            print("No")
            exit()
    print("Yes")
    exit()

if d < c:
    for i in range(b, d-1):
        if s[i] == s[i+1] and s[i+1] == s[i+2] and s[i] == ".":
            break
    else:
        a = []
        print(a[3])
        print("No")
        exit()
    for i in range(b, d):
        if s[i] == s[i+1] and s[i] == "#":
            print("No")
            exit()
    print("Yes")
    exit()

### FIXED CODE ###

n, a, b, c, d = map(int, input().split())
s = input()

def is_possible(start, goal):
    for i in range(start, goal - 1):
        if s[i] == "#" and s[i + 1] == "#":
            return False
    return True
  
def is_possible2(start, goal):
    for i in range(start, goal):
        if s[i - 1] == "." and s[i] == "." and s[i + 1] == ".":
            return True
    return False

if c < d:
    if is_possible(a - 1, c) and is_possible(b - 1, d):
        print("Yes")
    else:
        print("No")
else:
    if is_possible(a - 1, c) and is_possible(b - 1, d) and is_possible2(b - 1, d):
        print("Yes")
    else:
        print("No")
def abc():
    from math import ceil
    _a, _b, c, d = map(int, input().split())

    a = min(_a, _b)
    b = max(_a, _b)

    cnt_all = b - a + 1

    l = ceil(a / c)
    r = b // c
    cnt_c = r - l + 1

    l = ceil(a / d)
    r = b // d
    cnt_d = r - l + 1

    cd = lcm(c, d)
    l = ceil(a / cd)
    r = b // cd
    cnt_cd = r - l + 1

    print(cnt_all - (cnt_c + cnt_d - cnt_cd))


abc()


### FIXED CODE ###

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def abc():
    from math import ceil
    a, b, c, d = map(int, input().split())

    cnt_all = b - a + 1

    l = ceil(a / c)
    r = b // c
    cnt_c = r - l + 1

    l = ceil(a / d)
    r = b // d
    cnt_d = r - l + 1

    cd = lcm(c, d)
    l = ceil(a / cd)
    r = b // cd
    cnt_cd = r - l + 1

    ans = cnt_all - (cnt_c + cnt_d - cnt_cd)
    if ans < 0:
        ans = 0
    print(ans)


abc()
N = int(input())
A = [int(x) for x in input().split()]
r = [0]*(N+1)
for i in range(N):
  r[i+1] = A[i]-r[i]
x = r[N]
r[1::2] = r[1::,2]-x
r[0::2] = r[1::,2]+x
r = list(map(str,r))
print(" ".join(r))


### FIXED CODE ###

import numpy as np
N = int(input())
A = [int(x) for x in input().split()]
r = np.array([0]*(N+1))
for i in range(N):
  r[i+1] = A[i]-r[i]
x = r[N]
#print(r)
r[1::2] = r[1::2]*2-x
r[0::2] = r[0::2]*2+x
r = r[:N]
r = list(map(str,r))
print(" ".join(r))
from functools import reduce
from fractions import gcd
mod = 10**9 + 7
n, *A = map(int, open(0).read().split())

l = reduce(lambda x, y: x*y // gcd(x, y)) % mod
s = 0
for a in A:
    s += l * pow(a, mod-2, mod)
    s %= mod
print(s)

### FIXED CODE ###

from functools import reduce
def reduce_wrapper(func, *args):
    if len(args) == 1:
        return reduce(func, args[0])
    return reduce(func, args)

from fractions import gcd
def lcm(*args):
    return reduce_wrapper(lambda x, y: x*y // gcd(x, y), *args)

def xgcd(a, b):
    ''' return (g, x, y) such that a*x + b*y = g = gcd(a, b) '''
    x0, x1, y0, y1 = 0, 1, 1, 0
    while a != 0:
        (q, a), b = divmod(b, a), a
        y0, y1 = y1, y0 - q * y1
        x0, x1 = x1, x0 - q * x1
    return b, x0, y0

def modinv(n):
    g, x, _ = xgcd(n, mod)
    if g != 1:
        raise ValueError('Modinv is not exist! arg={}'.format(n))
    return x % mod

mod = 10**9 + 7
n, *A = map(int, open(0).read().split())

l = lcm(A) % mod
s = 0
for a in A:
    s += l * modinv(a)
    s %= mod
print(s)
i = 0

while True:
n = int(input())
if n == 0:break

print("Case {}: {}".format(i, n))
i += 1

### FIXED CODE ###

i = 0

while True:
 n = int(input())
 i += 1
 if n == 0:
  break
 print("Case {}: {}".format(i, n))
vn = int(input())
ll = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            a,b,c = ll[i], ll[j], ll[k]
            if a == b or b == c or c == a:
                continue
            vs = [a,b,c]
            vs.sort()
            if vs[0] + vs[1] > vs[2]: 
                cnt += 1
                # print(vs)

print(cnt)


### FIXED CODE ###

n = int(input())
ll = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            a,b,c = ll[i], ll[j], ll[k]
            if a == b or b == c or c == a:
                continue
            vs = [a,b,c]
            vs.sort()
            if vs[0] + vs[1] > vs[2]: 
                cnt += 1
                # print(vs)

print(cnt)
import math

#print(math.floor(math.sqrt(4)))
sosu = [2]
for i in range(3,2020):
    root_i = math.sqrt(i)
    cand = True
    for j in sosu:
        if j > root_i : break
        if i % j == 0:
            cand = False
            break
    if cand :
        sosu.append(i)
#print(sosu)    
N = int(input())
print(*sosu[:N])

### FIXED CODE ###

[a,b] = list(map(int,input().split(" ")))
if a > b :
  print(a-1)
else:
  print(a)
import sys

n, m = map(int, input().rstrip().split())
dist = [[float('inf') for i in range(n)]for j in range(n)]

for i in range(1, n):
    for j in range(1, n):
        if (i==j):
            dist[i][j]=0

a = []
b = []
c = []

for i in range(m):
    x, y, z = map(int, input().rstrip().split())
    dist[x-1][y-1] =  min(dist[x-1][y-1], z)
    dist[y-1][x-1] =  min(dist[x-1][y-1], z)
    a.append(x-1)
    b.append(y-1)
    c.append(z)
    
for i in range(n):
    for j in range(n):
        for k in range(n):
            dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j])
#print(dist)
result = m

for i in range(m):
    for j in range(m):
        if dist[j][a[i]] + c[i] == dist[j][b[i]]:
            result -= 1

print(result)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000001)

n, m = map(int, input().rstrip().split())
dist = [[500000 for i in range(n)]for j in range(n)]

for i in range(n):
    for j in range(n):
        if (i==j):
            dist[i][j]=0

a = []
b = []
c = []

for i in range(m):
    x, y, z = map(int, input().rstrip().split())
    dist[x-1][y-1] =  min(dist[x-1][y-1], z)
    dist[y-1][x-1] =  min(dist[x-1][y-1], z)
    a.append(x-1)
    b.append(y-1)
    c.append(z)
    
for k in range(n):
    for i in range(n):
        for j in range(n):
            dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j])
#print(dist)
result = m

for i in range(m):
    for j in range(n):
        if dist[j][a[i]] + c[i] == dist[j][b[i]]:
            result -= 1
            break

print(result)