Harryxun/stf_run huggingface dataset:
import itertools
N=int(input())
A=list(map(int, input().split()))
ans=0
for any_pair in itertools.combinations(A, 3):
    pair=sorted(any_pair)#新しいリストを作成
    #print(type(pair))
    if pair[0]+pair[1]>pair[2] and pair[0]!=pair[1] and pair[1]!=pair[2]:
        ans+=1
        #print(pair)
print(ans)

### FIXED CODE ###

X,K,D=map(int, input().split())
n=(K*D-X)//(2*D)
#print(n)
if n<0:
    ans=abs(X-K*D)
elif n>=K:
    ans=abs(X+K*D)
else:
    ans1=abs(X+(2*n-K)*D)
    ans2=abs(X+(2*(n+1)-K)*D)
    ans=min(ans1,ans2)
    #print(n,ans1,ans2)
print(ans)
import time


def main():

    N, Q = map(int, input().split())
    S = input()

    sum = [0]

    for i in range(0, N):
        if S[i] == 'A' and S[i+1] == 'C': sum.append(sum[i] + 1)
        else: sum.append(sum[i])

    for i in range(0, Q):
        l, r = map(int, input().split())
        print(sum[r-1] - sum[l-1])


if __name__ == '__main__':
    start = time.perf_counter()

    main()

    end = time.perf_counter()
    # print(end - start)


### FIXED CODE ###

import time


def main():

    N, Q = map(int, input().split())
    S = input()

    sum = [0] * (N + 1)

    for i in range(1, N):
        if S[i-1] == 'A' and S[i] == 'C': sum[i] = sum[i-1] + 1
        else: sum[i] = sum[i-1]

    for i in range(Q):
        l, r = map(int, input().split())
        print(sum[r-1] - sum[l-1])


if __name__ == '__main__':
    start = time.perf_counter()

    main()

    end = time.perf_counter()
    # print(end - start)
a=int(input())
b=list(map(int,input().split()))
total=0
total2=0
i=1
while True:
    if b[i-1]>=b[i]:
        total+=1
    else:
        if total2<=total:
            total2=total
        total=0
    i+=1
    if i==a:
        break
print(max(total2,total))

### FIXED CODE ###

a=int(input())
b=list(map(int,input().split()))
total=0
total2=0
i=1
for i in range(a-1):
    if b[i+1]<=b[i]:
        total+=1
    else:
        if total2<=total:
            total2=total
        total=0
print(max(total2,total))
k = int(input())
a, b = [int(x) for x in input()]
res = a//k < b//k or not a%k or not b%k
print('OK' if res else 'NG')

### FIXED CODE ###

k = int(input())
a, b = [int(x) for x in input().split()]
res = (a//k < b//k) or (not a%k) or (not b%k)
print('OK' if res else 'NG')
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

A, B, C, D = map(int, input().split())
ans = B // C + B // D - B // (C * D // gcd(C, D))
ans -= (A - 1) // C + (A - 1) // D - (A - 1) // (C * D // gcd(C, D))
print(B - A + 1 - ans)


### FIXED CODE ###

import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

A, B, C, D = map(int, input().split())
ans = B // C + B // D - B // (C * D // gcd(C, D))
ans -= (A - 1) // C + (A - 1) // D - (A - 1) // (C * D // gcd(C, D))
print(B - A + 1 - ans)
for word in word_list:
    #同じワード確認
    if word in word_stock:
        print('No')
    #最後の文字確認
    try:
        if word_stock[-1][-1] != word[0]:
            print('No')
    except:
        pass
    word_stock.append(word)

print('Yes')

### FIXED CODE ###

N = int(input())
W = [input() for i in range(N)]

stock = []
last = W[0][0]

for i in range(0,len(W)):
    #過去の発言に含まれない
    if W[i] in stock:
        print('No')
        break
    #前の単語の最後と次の単語の最初が一致する
    if W[i][0] != last:
        print('No')
        break
    stock.append(W[i])
    last = W[i][-1]
    #最後まで回り切ったらyesを表示
    if i+1 == len(W):
        print('Yes')
N, W = map(int, input().split())
wv = [[0 for i in range(2)] for j in range(N)]

for i in range(N):
    w, v = map(int, input().split())
    wv[i] = [w, v]

dp = [[0 for i in range(2*N)] for j in range(2*W)]

for i in range(N):
    for j in range(W+1):
        if (j - wv[i][0] >= 0):
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-wv[i][0]] + wv[i][1])
        
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])

print(dp[N][W])

### FIXED CODE ###

N, W = map(int, input().split())
wv = [[0 for i in range(2)] for j in range(N)]

for i in range(N):
    w, v = map(int, input().split())
    wv[i] = [w, v]

dp = [[0 for i in range(2*W)] for j in range(2*N)]

for i in range(N):
    for j in range(W+1):
        if (j - wv[i][0] >= 0):
            dp[i+1][j] = max(dp[i+1][j], dp[i][j-wv[i][0]] + wv[i][1])
        dp[i+1][j] = max(dp[i+1][j], dp[i][j])

print(dp[N][W])
s=input()
c=0
for i in range(len(s)):
	if s[i]==7:
    	c=c+1
    
if c>0:
  print('Yes')
else:
  print('No')
  

### FIXED CODE ###

n=input()
 
if n[0]=='7' or n[1]=='7' or n[2]=='7':
  print('Yes')
else:
  print('No')
n,m = map(int,input().split())
lst = [[] for _ in range(m+1)]
lst2 = []
for i in range(m):
  p,y = map(int,input().split())
  lst[p].append(y)
  lst2.append([p,y])
for i in range(1,m+1):
  lst[i].sort()
for l in lst2:
  num = lst[l[0]].index(l[1])+1
  print("0"*(6-len(str(l[0])))+str(l[0])+"0"*(6-len(str(num)))+str(num))

### FIXED CODE ###

n,m = map(int,input().split())
py = [list(map(int,input().split()))+[i] for i in range(m)]
py.sort(key=lambda x:(x[0],x[1]))
cnt = 1
ans = [""]*m
for i in range(m-1):
  ans[py[i][2]] = "0"*(6-len(str(py[i][0])))+str(py[i][0]) + "0"*(6-len(str(cnt)))+str(cnt)
  if py[i][0] == py[i+1][0]:
    cnt += 1
  else:
    cnt = 1
ans[py[m-1][2]]="0"*(6-len(str(py[m-1][0])))+str(py[m-1][0]) + "0"*(6-len(str(cnt)))+str(cnt)
for i in range(m):
  print(ans[i])
n = int(input())
i = 1

while True:
    x = i
    if  x % 3 == 0:
        print(" %d" ,i)
        i+=1
        if i > n:
            print()
            break
    if x % 10 == 3:
        print(" %d" ,i)
        i+=1
        if i > n:
            print()
            break
    else:
        x /= 10
        if x != 0:
        continue


### FIXED CODE ###

#
# 5d
#

def main():
    n = int(input())
    s = ""
    for i in range(1, n+1):
        x = i
        if x % 3 == 0 or x % 10 == 3:
            s += " " + str(i)
        else:
            x //= 10
            while x:
                if x % 10 == 3:
                    s += " " + str(i)
                    break
                x //= 10
    print(s)


if __name__ == '__main__':
    main()
a,b,k=map(int,input().split())
if a <= k:
  print(0,end=' ')
else:
  print(a-k,end=' ')
s = a+b
if s > k:
  print(s-k)
else:
  print(0)


### FIXED CODE ###

s,t=input().split()
print(t+s)
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))

N = int(input())
A = LI()
B = LI()

A_c = copy.deepcopy(A)

A.sort()
B.sort()

ans = "Yes"
for i in range(N):
    if A[i] <= B[i]:
        pass
    else:
        ans = "No"
        break

if ans == "Yes"
    si2i = sorted(range(len(A_c)), key=lambda x:A_c[x])
    a = 0
    count = 0
    while True:
        a = si2i[a]
        if a == 0:
            break
        count += 1

    if count <= N - 2:
        print("Yes")
    else:
        print("No")
else:
    print(ans)









print(ans)


### FIXED CODE ###

import sys; readline = sys.stdin.readline
from collections import deque
from collections import Counter
 
N = int(readline())
A = list(map(int, readline().split()))
B = list(map(int, readline().split()))
 
A, B = zip(*sorted(zip(A, B), key=lambda x:x[1]))
 
A_s = sorted(A)
B_s = sorted(B)
 
no = "No"
yes = "Yes"
 
for i in range(len(A_s)):
    if A_s[i] > B_s[i]:
        print(no)
        exit(0)
 
for i in range(1, len(A_s)):
    if A_s[i] < B_s[i - 1]:
        print(yes)
        exit(0)
 
si2i = sorted(range(len(A)), key=lambda x:A[x])
 
a = 0
count = 0
while True:
    a = si2i[a]
    if a == 0:
        break
    count += 1
 
if count <= N - 2:
    print(yes)
else:
    print(no)
a,op,b=raw_input().split()
if op=='+':
    print a+b
else op=='-':
    print a-b

### FIXED CODE ###

a,op,b=map(str,raw_input().split())
a=int(a)
b=int(b)
#op = str(op)
if op=='+':
    print a+b
elif op=='-':
    print a-b
A, B, C, D, E, F = map(int, input().split())
ans = []
water = []
for i in range(31):
    for j in range(31):
        tmp = 100*i*A + 100*j*B
        if tmp <= F:
            water.append(tmp)
water = list(set(water))
water.remove(0)

sugar = []
for i in range(101):
    for j in range(101):
        tmp = i*C + j*D
        if tmp <= F:
            sugar.append(tmp)
sugar = list(set(sugar))
sugar.remove(0)

            
for miz in water:
    for sato in sugar:
        if miz + sato <= F and (miz * sato) / (miz + sato) <= (100 * E) / (100 + E):
            ans.append([miz, sato, (miz * sato) / (miz + sato)])
            
ans.sort(key=lambda x:x[2], reverse = True)
print(ans[0][0]+ans[0][1], ans[0][1])

### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())
ans = []
water = []
for i in range(31):
    for j in range(31):
        tmp = 100*i*A + 100*j*B
        if tmp <= F:
            water.append(tmp)
water = list(set(water))
water.remove(0)

sugar = []
for i in range(101):
    for j in range(101):
        tmp = i*C + j*D
        if tmp <= F:
            sugar.append(tmp)
sugar = list(set(sugar))
sugar.remove(0)

            
for miz in water:
    for sato in sugar:
        if miz + sato <= F and sato / (miz + sato) <= E / (100 + E):
            ans.append([miz, sato, sato / (miz + sato)])
            
if ans:
    ans.sort(key=lambda x:x[2], reverse = True)
    print(ans[0][0]+ans[0][1], ans[0][1])
else:
    print(water[0], 0)
import math
A,B,C,D=map(int ,input().split())
a = B//C-A//C
b = B//D-A//D
c  = math.gcd(C,D)
d = B//c-A//c
e = B - A - a -b + d 
print(e)

### FIXED CODE ###

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

def lcm(x, y):
    return (x * y) // gcd(x, y)

A,B,C,D=map(int ,input().split())
a = B//C-(A-1)//C
b = B//D-(A-1)//D
c  =lcm(C,D)
d = B//c-(A-1)//c
e = B - A +1 - a -b + d 
print(e)
N, M = map(int, input().split())


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])
    return(arr)


mod = 10**9 + 7


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


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

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)


primes = factorization(M)
# 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））

ans = 1
for p, cnt in primes:
    tmp = 0
    for i in range(1, min(cnt, N)+1):
        tmp += cmb(N, i, mod) * cmb(cnt-i + i-1, i-1, mod)
        #print(tmp, p, cnt, i)
        tmp %= mod
    ans *= tmp
    ans %= mod

print(ans)


### FIXED CODE ###

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


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])
    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


mod = 10**9 + 7


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


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

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)


primes = factorization(M)
# 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））

if N == 1 or M == 1:
    print(1)
    exit(0)
ans = 1
for p, cnt in primes:
    tmp = 0
    for i in range(1, min(cnt, N)+1):
        tmp += cmb(N, i, mod) * cmb(cnt-1, i-1, mod)
        #print(tmp, p, cnt, i)
        tmp %= mod
    ans *= tmp
    ans %= mod

print(ans)
a, b, x = map(int, input().split())

def f(n, x):
    if n >= 0:
        return int(n/x) + 1
    else:
        return 0

print(f(b, x) - f(a, n))

### FIXED CODE ###

a, b, x = map(int, input().split())

def f(n, x):
    if n >= 0:
        return (n//x) + 1
    else:
        return 0

print(f(b, x) - f(a-1, x))
s = input()
t = input()

print(s+t)

### FIXED CODE ###

s,t = input().split()
 
print(t+s)
A = list(input())
for i in range(len(A)//2):
  if A[i] != A[len(A)-1-i]:
    ans += 1
print(ans)

### FIXED CODE ###

S = list(input())
ans = 0
for i in range(len(S)//2):
 if S[i] == S[len(S)-1-i]:
   continue
 else:
   ans += 1
print(ans)
n,y=map(int,input().split())
for i in range(n-1):
  a10000=i+1
  for i2 in range(n-1-a10000):
    a5000=i2+1
      for i3 in range(n-1-a10000-a5000):
        a1000=i3+1
        if a10000*10000+a5000*5000+a1000*1000==y:
          print(a10000,a5000,a1000)
          exit()
print("-1 -1 -1")

### FIXED CODE ###

N,Y = map(int,input().split())
Y = Y/1000
torf = False
for numoft in range(N+1):
    for numof5t in range(N-numoft+1):
        numof10t = (N)-(numoft+numof5t)
        if Y == numoft + 5*numof5t + 10*numof10t:
            print(numof10t,numof5t,numoft)
            exit()
print("-1 -1 -1")
def gcd(a,b):
    if a>b:
        return gcd(b,a)
    if a==0:
        return b
    return gcd(b-a*(b//a),a)
def lcm(x,y):
    return (x*y)//gcd(x,y)
N=int(input())
A=list(map(input().split()))
s=1
for a in A:
    s=lcm(s,a)
ans=0
for a in A:
    ans+=s//a
print(ans%(10**9+7))

### FIXED CODE ###

def gcd(a,b):
    if a>b:
        return gcd(b,a)
    if a==0:
        return b
    return gcd(b-a*(b//a),a)
def lcm(x,y):
    return (x*y)//gcd(x,y)
N=int(input())
A=list(map(int,input().split()))
s=1
for a in A:
    s=lcm(s,a)
ans=0
for a in A:
    ans+=s//a
print(ans%(10**9+7))
N = int(input())
nump = input().split()
nump = [int(i) for i in nump]

count = 0
for i in range(1,8):
  p = nump[i]
  tmp = sorted([nump[i-1],nump[i],nump[i+1]])
  if tmp[1] == p:
    count+=1
print(count)


### FIXED CODE ###

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

count = 0
for i in range(1,N-1):
  p = nump[i]
  tmp = nump[i-1:i+2]
  tmp.sort()
  if tmp[1] == p:
    count+=1
print(count)
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

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


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

for _ in range(M):
    A,B=map(int,input().split())
    UF.union(A-1,B-1)

ans=0

for i in range(N):
    ans = max(ans, UF.size(i));
 
 print(ans)





### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

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


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

for _ in range(M):
    A, B = map(int, input().split())
    UF.union(A - 1, B - 1)

ans = 0

for i in range(N):
    ans = max(ans, UF.size(i))

print(ans)
a,b,x=map(int,input().split())
ans=0
for i in range(a,b+1):
    if i%x == 0:
        ans+=1
    else:
        ans=ans
print(ans)


### FIXED CODE ###

# -*- coding utf-8 -*-

x,y,z =list(map(str,input().split()))

print(x[0].upper() + y[0].upper() + z[0].upper())
from itertools import combinations
while True:
    n, x = map(int, input().split())
    if n == x == 0:
        break
    print(sum(a + b + c == x for a, b, c in combinations(range(1, n + 1), 3))



### FIXED CODE ###

from itertools import combinations
while True:
    n, x = map(int, input().split())
    if n == x == 0:
        break
    print(len([1 for a, b, c in combinations(range(1, n + 1), 3) if a + b + c == x]))
a, b = (int(i) for i in input().split())

res = a+b
if res > 23
    print(res-24)
else:
    print(res)

### FIXED CODE ###

a, b = (int(i) for i in input().split())
 
res = a+b
if res > 23:
    print(res-24)
else:
    print(res)
N=int(input().strip())
A=list(map(int,input().split()))
nns=[2**i for i in range(31)]
def func(n,x):
    return n%nns[x]==0
def binsearch_int(func, min_x, max_x):
    """func(x) == Trueとなる最大のxを返す
    """
    if func(max_x):
        return max_x
    if not func(min_x):
        return None
    left,right=min_x,max_x
    while left+1<right:
        mid=(left+right)//2
        if func(mid):
            left=mid
        else:
            right=mid
    return left
sum(binsearch_int(lambda x: func(i,x),0,int(math.log2(i))+1) for i in A)

### FIXED CODE ###

import math
N=int(input().strip())
A=list(map(int,input().split()))
nns=[2**i for i in range(31)]
def func(n,x):
    return n%nns[x]==0
def binsearch_int(func, min_x, max_x):
    """func(x) == Trueとなる最大のxを返す
    """
    if func(max_x):
        return max_x
    if not func(min_x):
        return None
    left,right=min_x,max_x
    while left+1<right:
        mid=(left+right)//2
        if func(mid):
            left=mid
        else:
            right=mid
    return left
print(sum(binsearch_int(lambda x: func(i,x),0,int(math.log2(i))+1) for i in A))
#EDP-F
import sys

S = sys.stdin.readline().rstrip()
T = sys.stdin.readline().rstrip()
sn, tn = len(S), len(T)
dp = [[0 for j in range(tn)] for i in range(sn)]

#方針:その時点での最長数を入れる
for j in range(tn):
    dp[0][j] = dp[0][j-1]
    if S[0]==T[j]:
        dp[0][j] = 1
for i in range(sn):
    dp[i][0] = dp[i-1][0]
    if S[i]==T[0]:
        dp[i][0] = 1
        

for i in range(1, sn):
    for j in range(1, tn):
        if S[i] == T[j]:
            dp[i][j] = dp[i-1][j-1]+1
        else:
            dp[i][j] = max(dp[i-1][j], dp[i][j-1])

#pprint.pprint(dp)

i,j= sn-1, tn-1
ans =''
while True:
    if i ==0:
        if dp[i][j]==1:
            ans+= S[0]
        print(ans[::-1])
        break
    if dp[i-1][j] == dp[i][j]:
        i-=1
    elif dp[i][j-1] == dp[i][j]:
        j-=1
    elif dp[i-1][j-1] +1 == dp[i][j]:
        ans += S[i]
        i-=1
        j-=1

### FIXED CODE ###

import sys
s = sys.stdin.readline().rstrip()
t = sys.stdin.readline().rstrip()

sn = len(s)
tn = len(t)

dp =[[0 for _ in range(tn+1)] for _ in range(sn+1)]

for i in range(sn):
    for j in range(tn):
        if s[i]==t[j]:
            dp[i+1][j+1] =dp[i][j]+1
        else:
            dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])
#print(dp)

L =[]
while sn>0 and tn>0:
    if dp[sn][tn] == dp[sn-1][tn]: #縦優先
        sn-=1
    elif dp[sn][tn] == dp[sn][tn-1]:
        tn-=1
    elif dp[sn][tn] == dp[sn-1][tn-1]+1:
        L.append(s[sn-1])
        sn-=1
        tn-=1
        
print(''.join(L[::-1]))
5 1
1
2
3
4
5

### FIXED CODE ###

import math
n,d = map(int,input().split())
x = []
for i in range(0,n):
    x.append(list(map(int,input().split())))
def f(a,b):
    s = 0
    for l in range(0,d):
        s+=(a[l]-b[l])**2
    return math.sqrt(s)
count = 0
for j in range(0,n):
    for k in range(0,n):
        if not (j==k):
            if f(x[j],x[k])%1==0:
                count = count + 1

print(int(count/2))
n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if ord(t[0]) > ord(h[0]):
        st += 3
    elif ord(t[0]) < ord(h[1]):
        sh += 3
    else:
        m = h if len(t) > len(h) else t
        l = 1
        for j in range(m):
            if ord(t[j]) > ord(h[j]):
                st += 3
                j = m
                l = 0
            else:
                sh += 3
                j = m
                l = 0
        if l:
            st += 1
            sh += 1
print(st, sh)

### FIXED CODE ###

n = int(input())
st, sh = 0, 0
for i in range(n):
    t, h = map(str, input().split())
    if t > h:
        st += 3
    elif t < h:
        sh += 3
    else:
        st += 1
        sh += 1
print(st, sh)
n=int(inout())
i = list(map(int, input().split()))
ans=0
for i in range(n-2):
    for j in range(i+1,n-1):
        if n[i]==n[j]:
            pass
        else:
            for k in range(j+1,n):
                if n[i]==n[k] and n[j]==n[k]:
                    pass
                else:
                    z=max(n[i],n[j],n[k])
                    if n[i]+n[k]+n[j]-z>z:
                        ans+=1
pint(ans)

### FIXED CODE ###

l=int(input())
n= list(map(int, input().split()))
ans=0
for i in range(l-2):
    for j in range(i+1,l-1):
        if n[i]==n[j]:
            pass
        else:
            for k in range(j+1,l):
                if n[i]==n[k] or n[j]==n[k]:
                    pass
                else:
                    z=max(n[i],n[j],n[k])
                    if n[i]+n[k]+n[j]-z>z:
                        ans+=1
print(ans)
def FOA(a, count):
	b = a
	for i in range(len(b)):
		b[i] = a.count(a[i])
	if  b == a:
		print(count)
		print(" ".join(map(str, b)))
		break
	else:
		return FOA(b, count + 1)

while True:
	n = int(input())
	if n == 0:
		break
	a = map(int, input().split())
	FOA(a, 0)

### FIXED CODE ###

def FOA(a, count):
	b = [a.count(a[i]) for i in range(len(a))]
	if  b == a:
		print(count)
		print(" ".join(map(str, b)))
	else:
		return FOA(b, count+1)

while True:
	n = int(input())
	if n == 0:
		break
	a = list(map(int, input().split()))
	FOA(a, 0)
a,b,c,d = map(int,input.split())
print(max([a *c, a*d, b* c, b* d]))

### FIXED CODE ###

a,b,c,d = map(int,input().split())
print(max([a *c, a*d, b* c, b* d]))
n = int(input())
a = list(map(int, input().list()))

a.sort(reverse=True)
ans1 = a[0]
count = 0

if ans1 % 2 == 0:
    mid = int(ans1 / 2)
    if mid in a:
        j = mid

    elif:
        while 1:
            count += 1
            if (mid + count) in a:
                j = mid + count
                break
            elif:
                (mid - count) in a:
                j = mid + count
                break

else:
    while 1:
        count += 1
        if (mid + count) in a:
            j = mid + count
            break
        elif:
            (mid - count) in a:
            j = mid + count
            break

print(ans1, j)


### FIXED CODE ###

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

left = a[-1]
sa = 199999999999999999999999999
for i in range(n):
  if sa > abs((left/2) -a[i]):
    right = a[i]
    sa = abs((left/2) - a[i])
    
print(left, right)
from bisect import bisect_left

n = int(input())
l = list(map(int, input()))
ans = 0

l.sort()
for i in range(n-2):
  for j in range(i+1, n-1):
    ans += bisect_left(l, l[i]+l[j]) - j - 1
print(ans)

### FIXED CODE ###

from  bisect import bisect_left

n = int(input())
l = list(map(int, input().split()))
ans = 0

l.sort()
for i in range(n-2):
  for j in range(i+1, n-1):
    ans += bisect_left(l, l[i]+l[j]) - j - 1
print(ans)
X,N = map(int,input().split())
if N >0:
  p = list(map(int,input().split()))
a = 100
ans = []
for i in range(1,101):
  if N == 0:
    ans = X
    break
  if p.count(i) == 0 and a >= abs(X - i):
    a = abs(X - i)
    ans = i
for i in range(1,101):
  if abs(X-i) == abs(X-ans) and p.count(i) == 0:
    ans = i
    break
print(ans)

### FIXED CODE ###

X,N = map(int,input().split())
if N > 0:
  p = list(map(int,input().split()))
a = 102
ans = 0
for i in range(-1,200):
  if N == 0:
    ans = X
    break
  if p.count(i) == 0 and a > abs(X - i):
    a = abs(X - i)
    ans = i
print(ans)