Harryxun/stf_run huggingface dataset:
import bisect
import math
from scipy.misc import comb

N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)

mini = List[A-1]
ans = 0

if List[A-1] != List[A]:
  ans = sum(List[:A])/A
  print(ans)
  print(1)

else:
  num = List.count(List[A-1])
  List = sorted(List)
  num2 = N - bisect.bisect_right(List,List[A-1])
  List = sorted(List, reverse=True)
  
  if List[0] != List[A-1]:
    B = A
  for i in range(B-A+1):
    n = num
    kosuu = A + i
    ans  = int(ans + math.factorial(n) // (math.factorial(n - kosuu) * math.factorial(kosuu)))
  
  ave = int(sum(List[:A])/A)
  print(ave)
  print(ans)

### FIXED CODE ###

import bisect
import math
from scipy.misc import comb

N,A,B=map(int,input().split())
List=list(map(int,input().split()))
List = sorted(List, reverse=True)

mini = List[A-1]
ans = 0

if List[A-1] != List[A]:
  ans = sum(List[:A])/A
  print(ans)
  print(1)

else:
  num = List.count(List[A-1])
  List = sorted(List)
  num2 = N - bisect.bisect_right(List,mini)
  List = sorted(List, reverse=True)
  
  if List[0] != List[A-1]:
    B = A
  for i in range(B-A+1):
    n = num
    kosuu = A + i - num2
    ans  = int(ans + comb(n, kosuu, exact=True))
  
  ave = int(sum(List[:A])/A)
  print(ave)
  print(ans)
# Contest: AtCoder Beginner Contest 152 (https://atcoder.jp/contests/abc152)
# Problem: E: Flatten (https://atcoder.jp/contests/abc152/tasks/abc152_e)

def rint():
    return int(input())


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


from math import gcd
from functools import reduce
def lcm(a, b):
    return a * b // gcd(a, b)
n = rint()
a = rints()
l = reduce(lcm, a)
m = 10**9 + 7
print(sum(l // ai % m for ai in a) % m)


### FIXED CODE ###

# Contest: AtCoder Beginner Contest 152 (https://atcoder.jp/contests/abc152)
# Problem: E: Flatten (https://atcoder.jp/contests/abc152/tasks/abc152_e)

def rint():
    return int(input())


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


from fractions import gcd
from functools import reduce
m = 10**9 + 7
def inv(a):
    return pow(a, m - 2, m)
def mod_lcm(a, b):
    return a * b // gcd(a, b)
n = rint()
a = rints()
l = reduce(mod_lcm, a) % m
print(sum(l * inv(ai) % m for ai in a) % m)
N = int(input())

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

ans = []
sum = 0

for j in range(min(a), max(a)):
    for num in a:
        sum += (num - j) ** 2
    else:
        ans.append(sum)
        sum = 0

if ans == None:
    ans.appned(0)

print(min(ans))




### FIXED CODE ###

N = int(input())

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

ans = []
sum = 0

for j in range(min(a), max(a)):
    for num in a:
        sum += (num - j) ** 2
    else:
        ans.append(sum)
        sum = 0

if len(ans) == 0:
    print(0)
else:
    print(min(ans))
N, X=map(int, input().split())
L=list(map(int, input().split()))
 
l=int(0)
counter=int(0)
while l<=X:
  l+=L[counter]
  counter+=int(1)
  
print(counter)

### FIXED CODE ###

import numpy as np

temp=list(map(int, input().split()))

N=temp[0]
X=temp[1]

L=list(map(int, input().split()))

ind=1
while np.sum(L[:ind])<=X and ind<=N:
  ind+=1
  
print(ind)
import heapq
from heapq import _heappop_max, _heapify_max
n,m=map(int,input().split())
task=[[0] for _ in range(m+1)]

for i in range(n):
    a,b=map(int,input().split())
    if a<=m:
        task[a].append(b)

task=task[::-1]

tmp=[]
heapq.heapify(tmp)
ans=0

for i in range(m,-1,-1):
    cnt=0
    for j in task[i]:
        heapq.heappush(tmp,-j)
    cnt=heapq.heappop(tmp)
    ans-=cnt
print(ans)


### FIXED CODE ###

import heapq

n,m=map(int,input().split())
task=[[0] for _ in range(m+1)]

for i in range(n):
    a,b=map(int,input().split())
    if a<=m:
        task[a].append(b)

task=task[::-1]

tmp=[]
heapq.heapify(tmp)
ans=0

for i in range(m,-1,-1):
    cnt=0
    for j in task[i]:
        heapq.heappush(tmp,-j)
    cnt=heapq.heappop(tmp)
    ans-=cnt
print(ans)
N=int(input())
S=input()
if B<3200:
  print(S)
else:
  print("red")

### FIXED CODE ###

B=int(input())
S=input()
if B>=3200:
  print(S)
else:
  print("red")
a, b, c, k = [int(i) in input().split(" ")]
print(min(a, k) - max(0, k-a-b))

### FIXED CODE ###

a, b, c, k = [int(i) for i in input().split(" ")]
print(min(a, k) - max(0, k-a-b))
import collections
N = int(input())
a = list(map(int, input().split()))
A = set()
table = collections.defaultdict(int)
for i in range(1, N):
    table[a[i]] += 2
a.sort()
prev = a[0]
now = a[0]
last = a[0]
for i in range(1, N):
    if (a[0] ^ a[i]) in table and table[a[0] ^ a[i]] > 0:
        table[a[0] ^ a[i]] -= 1
        last = a[i]
        now = a[0] | a[i]
        break
	if i == N-1:
      print("No")
      exit(0)
for i in range(2, N-2):
    if prev ^ now in table and table[now ^ prev] > 0:
        prev = now
        now = now ^ prev
        table[now ^ prev] -= 1
    else:
        print("No")
        exit(0)
if (last ^ now) == a[0]:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

import collections
N = int(input())
a = list(map(int, input().split()))
A = set()
table = collections.defaultdict(int)

for i in range(1, N):
    table[a[i]] += 1

ans = [-1]*N
ans[0] = a[0]
for i in range(1, N):
    if (a[0] ^ a[i]) in table and table[a[0] ^ a[i]] >= 1:
        if a[0] == 0:
            if table[a[i]] == 1:
                continue
        ans[1] = (a[0] ^ a[i])
        ans[2] = a[i]
        table[ans[1]] -= 1
        table[ans[2]] -= 1
        break

if ans[1] == -1:
    print("No")
    exit(0)

for i in range(3, N):
    if (ans[i-1] ^ ans[i-2]) in table and table[ans[i-1] ^ ans[i-2]] >= 1 and table[ans[i-1] ^ ans[i-2]] >= 1:

        ans[i] = ans[i-1] ^ ans[i-2]
        table[ans[i]] -= 1
    else:
        print("No")
        exit(0)
print("Yes")
A, B = map(str, input().split())
 
B = str(int(float(B)*100+0.00001))
 
#print(B)
ans = []
p = [[]for k in range(len(B))]
for k in range(len(B)):
    for j in range(k):
        p[k].append(0)
for k in range(1, len(B)+1):
    a = 0
    for j in range(1, len(A)+1):
        if a > 9:
            a = int(str(a)[0]) + int(B[-k])*int(A[-j])
        else:
            a = int(B[-k])*int(A[-j])
        #print(a)
 
        p[k-1].append(int(str(a)[-1]))
        if j == len(A) and a >9:
            p[k-1].append(int(str(a)[0]))
 
for k in range(len(B)):
    for j in range(len(p[-1]) - len(p[k])):
        p[k].append(0)
 
#print(p)
a = 0
for k in range(len(p[0])): 
    if int(a) > 9: 
        a = int(str(a)[0])
    else:
        a =0
    for j in range(len(p)):
        a += p[j][k]
    ans.append(str(a)[-1])
    if k ==  len(p[0]-1) and a >9:
        ans.append(str(a)[0])

 
#print(ans)
op = ""
for k in range(1, len(ans)-1):
    op += ans[-k]
if len(ans)<3:
    print("0")
else:
    print(op)


### FIXED CODE ###

A, B = map(str, input().split())
 
B = str(int(float(B)*100+0.00001))
 
#print(B)
ans = []
p = [[]for k in range(len(B))]
for k in range(len(B)):
    for j in range(k):
        p[k].append(0)
for k in range(1, len(B)+1):
    a = 0
    for j in range(1, len(A)+1):
        if a > 9:
            a = int(str(a)[0]) + int(B[-k])*int(A[-j])
        else:
            a = int(B[-k])*int(A[-j])
        #print(a)
 
        p[k-1].append(int(str(a)[-1]))
        if j == len(A) and a >9:
            p[k-1].append(int(str(a)[0]))
 
for k in range(len(B)):
    for j in range(len(p[-1]) - len(p[k])):
        p[k].append(0)
 
#print(p)
a = 0
for k in range(len(p[0])): 
    if int(a) > 9: 
        a = int(str(a)[0])
    else:
        a =0
    for j in range(len(p)):
        a += p[j][k]
    ans.append(str(a)[-1])
    if k ==  len(p[0])-1 and a >9:
        ans.append(str(a)[0])

 
#print(ans)
op = ""
for k in range(1, len(ans)-1):
    op += ans[-k]
if len(ans)<3 or int(op) < 1:
    print("0")
else:
    print(op)
from sys import stdin
#d=日数, c=満足低下度, s=満足上昇度, t=コンテストの日程 
d = int(stdin.readline().rstrip())
c = list(map(int, stdin.readline().rstrip().split()))
#print(c)
s = [list(map(int, stdin.readline().rstrip().split())) for i in range(d)]
t = [int(stdin.readline().rstrip()) for j in range(d)]
m = int(stdin.readline().rstrip())
#dq = [list(map(int, input().split())) for i in range(m)]
for j in range(m):
  dq = list(map(int, stdin.readline().rstrip().split()))
  res = 0
  last = [0 for i in range(26)]
  #old = t[dq[j][0] - 1]
  t[dq[0] - 1] = dq[1]
  for day in range(d):
    res += s[day][t[day]-1]
    last[t[day]-1] = day+1
    #for i in range(26):
      #res -= c[i] * (day + 1 - last[i])
    combined1 = [x * (day + 1 - y) for (x, y) in zip(c, last)]
    res -= sum(combined1)
  #t[dq[j][0] - 1] = old
  print(res)

### FIXED CODE ###

#d=日数, c=満足低下度, s=満足上昇度, t=コンテストの日程 
d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for i in range(d)]


res = 0
last = [0 for i in range(26)]
#old = t[dq[j][0] - 1]
#t[dq[0] - 1] = dq[1]
for day in range(d):
  t = s[day].index(max(s[day])) + 1
  m = s[day].index(max(s[day]))
  res += max(s[day])
  last[m] = day + 1
  #for i in range(26):
    #res -= c[i] * (day + 1 - last[i])
  combined1 = [x * (day + 1 - y) for (x, y) in zip(c, last)]
  res -= sum(combined1)
  #t[dq[j][0] - 1] = old
  print(t)
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

anc = 0
for i in range(N):
  if V[i] > C[i]:
    anc = anc + (V[i]-C[i])

print(ans)

### FIXED CODE ###

N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

ans = 0
for i in range(N):
  if V[i] > C[i]:
    ans = ans + (V[i]-C[i])

print(ans)
A,B,C,D=map(int, input().split())
if A+B>C+D:
  print('Left')
elif A+B>C+D::
  print('Right')
else:
  print('Balanced')

### FIXED CODE ###

A,B,C,D=map(int, input().split())
if A+B>C+D:
  print('Left')
elif A+B<C+D:
  print('Right')
else:
  print('Balanced')
#from functools import lru_cache
import sys
import numpy as np
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

n=int(reader()[0][0])
a=[]
for i in range(200001):
    a.append(n%10)
    n//=10
print('Yes' if sum(a)%9==0 else 'No')

### FIXED CODE ###

#from functools import lru_cache
import sys
def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

n=reader()[0][0]
i=vfunc(lambda n:int(n))(n)
print('Yes' if sum(i)%9==0 else 'No')
#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def solve(A: int, B: int):
    h = 100
    w = 100
    print(h, w)

    grid = [["." if row < 50 else "#" for _ in range(w)] for row in range(h)]

    for i in range(B-1):
        grid[2*(i//50)][(i % 50)*2] = "#"

    for k in range(A-1):
        grid[2*(i//50)+51][(i % 50)*2] = "."

    for i in range(h):
        r = "".join(grid[i])
        print(r)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def solve(A: int, B: int):
    h = 100
    w = 99
    print(h, w)

    grid = [["."]*w for row in range(h)]

    for i in range(h//2, h):
        grid[i] = ["#"]*w

    def ij_k(k):
        row = (w-1)//2
        i = (k//row)*2+1
        j = (k % row)*2+1
        return i, j

    for k in range(B-1):
        i, j = ij_k(k)
        grid[i][j] = "#"

    for k in range(A-1):
        i, j = ij_k(k)
        grid[i+h//2][j] = "."

    for i in range(h):
        r = "".join(grid[i])
        print(r)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()
global visited,num,graph

def dfs(subtree):
    global visited,num,graph
    if visited[subtree] != 0:
        return

    visited[subtree] = num
    for node in graph[subtree]:
        if visited[node] != 0:
            continue
        dfs(node)

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

starting = list(map(int,input().split()))
graph = [[] for x in range(N+1)]
for i in range(M):
    a,b = map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

visited = [0 for x in range(N+1)]
num = 1
for i in range(1,N+1):
    if visited[i] == 0:
        dfs(i)
        num += 1

ans = 0
for i in range(1,N+1):
    if visited[i] == visited[starting[i-1]]:
        ans += 1

print(ans)
        


    





### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(100000)

global visited,num,graph

def dfs(subtree):
    global visited,num,graph
    if visited[subtree] != 0:
        return

    visited[subtree] = num
    for node in graph[subtree]:
        if visited[node] != 0:
            continue
        dfs(node)

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

starting = list(map(int,input().split()))
graph = [[] for x in range(N+1)]
for i in range(M):
    a,b = map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)

visited = [0 for x in range(N+1)]
num = 1
for i in range(1,N+1):
    if visited[i] == 0:
        dfs(i)
        num += 1

ans = 0
for i in range(1,N+1):
    if visited[i] == visited[starting[i-1]]:
        ans += 1

print(ans)
#!/usr/bin/python

import sys


def main():
  length = int(raw_input())
  elements = list(map(int, raw_input().split()))
  print(" ".join(str(i) for i in elements))

  sorted_list = [elements[0]]
  for i in range(1, length):
    element = elements[i]
    for j in range(0, len(sorted_list) + 1):
      if j == len(sorted_list):
        sorted_list.append(element)
        break
      elif element < sorted_list[j]:
        sorted_list.insert(j, element)
        break
    output_list = sorted_list[0:i+1] + elements[i+1:]
    print(" ".join([str(i) for i in output_list]))

    return 0

if __name__ == '__main__':
  main()

### FIXED CODE ###

#!/usr/bin/python

import sys


def main():
  length = int(input())
  elements = list(map(int, input().split()))
  print(" ".join(str(i) for i in elements))

  sorted_list = [elements[0]]
  for i in range(1, length):
    element = elements[i]
    for j in range(0, len(sorted_list) + 1):
      if j == len(sorted_list):
        sorted_list.append(element)
      elif element < sorted_list[j]:
        sorted_list.insert(j, element)
        break
    output_list = sorted_list[0:i+1] + elements[i+1:]
    print(" ".join([str(i) for i in output_list]))

  return 0

if __name__ == '__main__':
  main()
a = 0
b = 0
c = 0
for i in range(len(ss)):
    if s[i] == ss[i]:
        continue
    else:
        a = i
        break
else:
    print('YES')
    exit()


sss = ss[a:]
print(sss)
for i in range(len(sss)):
    if sss[len(sss)-i-1] == s[len(s)-i-1]:
        continue
    else:
        print('NO')
        break
else:
    print('YES')
    

### FIXED CODE ###

s = list(input())
ss = ['k','e','y','e','n','c','e']
a = 0
b = 0
c = 0
for i in range(len(ss)):
    if s[i] == ss[i]:
        continue
    else:
        a = i
        break
else:
    print('YES')
    exit()


sss = ss[a:]
for i in range(len(sss)):
    if sss[len(sss)-i-1] == s[len(s)-i-1]:
        continue
    else:
        print('NO')
        break
else:
    print('YES')
N, M = map(int,input().split())
G = [[0] * N for i in range(N)]

edgeset  = []
for i in range(M):
    a,b = map(int,input().split())
    G[a-1][b-1] = 1
    G[b-1][a-1] = 1
    edgeset.append([a,b])
    
visited = None
def dfs(v):
    visited[v] = 1
    for u, e in enumerate(G[v]):
        if e == 0 or visited[u] == 1:
            continue
        dfs(u)
ans = 0

for j in edgeset:
    G[j[0] - 1][j[1] - 1]= 0
    G[j[1] - 1][j[0] - 1]= 0
    visited = [[0] * N]
    dfs(0)   
    G[j[0] - 1][j[1] - 1]= 1
    G[j[1] - 1][j[0] - 1]= 1
    if 0 in visited:
        ans+= 1
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())

H = [[0 for _ in range(n)] for _ in range(n) ]
edge_list = []

for _ in range(m):
    a, b = map(int,input().split())
    edge_list.append([a,b])
    H[a-1][b-1] = 1
    H[b-1][a-1] = 1
    
visited = [0 for _ in range(n)]

def dfs(node):
    visited[node] = 1
    for node_,edge_ in enumerate(H[node]):
        if edge_ == 1:
            if visited[node_] == 1:
                continue
            dfs(node_)
ans = 0
for _ in edge_list:
    H[_[0] -1][_[1] - 1] = 0
    H[_[1] -1][_[0] - 1] = 0
    
    dfs(1)
    if 0 in visited:
        ans += 1
    H[_[0] -1][_[1] - 1] = 1
    H[_[1] -1][_[0] - 1] = 1
    visited = [0 for _ in range(n)]
print(ans)
n,k=[int(i) for i in input().split()]
h=[int(i) for i in input().split()]

import numpy as np

a=np.array(h)
b=[[0 for i in range(n)] for j in range(n)]
b=np.array(b)

for j in range(n):
    for i in range(n):
        if j>i:
            b[j][i]=abs(a[j]-a[i])
#print(b)

dp=[int(0) for i in range(n)]
dp0=[[100000000000 for i in range(n)] for j in range(n)]

dp0[0]=0
dp[0]=0

dp0[1]=b[1][0]
dp[1]=dp0[1]

if k==1:
    for i in range(2,n):
        dp[i]=dp[i-1]+b[i][i-1]
    
if k > 1:
    for j in range(2,n):
        if j <=k:
            for i in range(j):
                dp0[j][i]=dp[i]+b[j][i]
            dp[j]=min(dp0[j])
        else:
            for i in range(k):
                dp0[j][i+j-k]=dp[i+j-k]+b[j][i+j-k]
            dp[j]=min(dp0[j])

#print(dp0)
print(dp[n-1])

### FIXED CODE ###

n,k=[int(i) for i in input().split()]
h=[int(i) for i in input().split()]
#print(n,k,h)
dp=[float('inf') for i in range(n)]
dp[0]=0
dp[1]=abs(h[1]-h[0])

if k > 1 and n > 2:
  for y in range(2,k):
    dp[y]=abs(h[y]-h[0])
    x=1
    while x < k:
      tmp=dp[x]+abs(h[y]-h[x])
      if tmp < dp[y]:
        dp[y]=tmp
      x+=1
  for y in range(k,n):    
    dp[y]=dp[y-1]+abs(h[y]-h[y-1])
    for x in range(2,k+1):
      tmp=dp[y-x]+abs(h[y]-h[y-x])
      if tmp < dp[y]:
        dp[y]=tmp
        
if k == 1 and n > 2:
  for y in range(2,n):
    dp[y]=dp[y-1]+abs(h[y]-h[y-1])

print(dp[-1])
A,B,K = [int(i) for i in input().split(" ")]

def check(A,B,K):
    if A > K:
        A=-K
    else:
        result = K-A
        A = 0
        K = result
    B-=K
    return "{0} {1}".format(A,B)

print(check(A,B,K))

### FIXED CODE ###

N=input().split(" ");print(N[1]+N[0])
#include <stdio.h>
#include <math.h>

int main(void){
	int n;
	double x1,y1,x2,y2,x3,y3,a,b,c,s,ss,sina,r,px,py;
	scanf("%d",&n);
	while (n--){
		scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
		a = sqrt(pow(x1-x2,2)+pow(y1-y2,2));
		b = sqrt(pow(x1-x3,2)+pow(y1-y3,2));
		c = sqrt(pow(x2-x3,2)+pow(y2-y3,2));
		s = (a+b+c)/2;
		ss = sqrt(s*(s-a)*(s-b)*(s-c));
		sina = 2*ss/b/c;
		r = a/sina/2;
		a = a*a; b = b*b; c = c*c;
		px = (a*(b+c-a)*x3 + b*(a+c-b)*x2+c*(a+b-c)*x1)/16/pow(ss,2);
		py = (a*(b+c-a)*y3 + b*(a+c-b)*y2+c*(a+b-c)*y1)/16/pow(ss,2);
		printf("%.3f %.3f %.3f\n",px, py, r);
	}
}

### FIXED CODE ###

import math
n = int(raw_input())
for i in range(n):
    x1, y1, x2, y2, x3, y3 = map(float, raw_input().split())
    a = math.sqrt((x1-x2)**2+(y1-y2)**2)
    b = math.sqrt((x1-x3)**2+(y1-y3)**2)
    c = math.sqrt((x2-x3)**2+(y2-y3)**2)
    s = (a+b+c)/2
    ss = math.sqrt(s*(s-a)*(s-b)*(s-c))
    sina = 2*ss/b/c
 
    r = a/sina/2

    a = a*a
    b = b*b
    c = c*c
    px = (a*(b+c-a)*x3 + b*(a+c-b)*x2+c*(a+b-c)*x1)/16/ss**2
    py =(a*(b+c-a)*y3 + b*(a+c-b)*y2+c*(a+b-c)*y1)/16/ss**2

    print "%.3f %.3f %.3f" % (px, py, r)
import numpy as np

def get_nearest_val(l, n, side='left'):
    l = sorted(l)
    i = np.searchsorted(l, n, side=side)
    return l[i]

def comb(n, r):
    if n < 0 or r < 0 or n < r: return 0
    elif n == 0 or r == 0: return 1
    return comb(n-1, r-1) + comb(n-1, r)

n = int(input())
A = list(map(int, input().split(' ')))

max_n = max(A)
key_r = (max_n + 1) / 2
# key_r = int((max_n + 1) / 2)
# print(key_r)

left_r = get_nearest_val(A, key_r, side='left')
# print(left_r)
right_r = get_nearest_val(A, key_r, side='right')
# print(right_r)

left_comb = comb(max_n, left_r)
# print(left_comb)
right_comb = comb(max_n, right_r)
# print(right_comb)

if left_comb >= right_comb:
    print(str(max_n) + ' ' + str(left_r))
else:
    print(str(max_n) + ' ' + str(right_r))

### FIXED CODE ###


import numpy as np
import math

def get_nearest_val(l, n):
    i = np.abs(np.asarray(l) - n).argmin()
    return l[i]

n = int(input())
A = list(map(int, input().split(' ')))

max_n = max(A)
A = sorted(A)
max_n = A[-1]
# A = A.pop
A.pop(-1)
key_r = (max_n + 1) / 2
# key_r = int((max_n + 1) / 2)
# print(key_r)

# left_r = get_nearest_val(A, key_r, side='left')
# # print(left_r)
# right_r = get_nearest_val(A, key_r, side='right')
# # print(right_r)

# left_comb = comb(max_n, left_r)
# # print(left_comb)
# right_comb = comb(max_n, right_r)
# # print(right_comb)

# if left_comb >= right_comb:
#     print(str(max_n) + ' ' + str(left_r))
# else:
#     print(str(max_n) + ' ' + str(right_r))

r = get_nearest_val(A, key_r)
# r = get_nearest_val(A[:len(A)-1], key_r)
print(str(max_n) + ' ' + str(r))
import math

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

m = c*d//math.gcd(c, d)
print(b- a + 1 - (b//c - (a-1)//c + b//d - (a-1)//d - b//m + (a-1)//m))

### FIXED CODE ###

import fractions

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

m = c*d//fractions.gcd(c, d)
print(b- a + 1 - (b//c - (a-1)//c + b//d - (a-1)//d - b//m + (a-1)//m))
a , b, c  = map(int, input().split
if c >= (a-b):
    print(c-(a-b))
else:
    print(0)

### FIXED CODE ###

a , b, c  = map(int, input().split())
if c >= (a-b):
    print(c-(a-b))
else:
    print(0)
s=input()
print(x*len(s))

### FIXED CODE ###

s=input()
print('x'*len(s))
n = int(input())
if n mod 2 == 0 or n < 10:
    print(0)
else:
    k = n // 5
    print(k * (k + 1) / 2)

### FIXED CODE ###

n = int(input())
if n % 2 == 1:
    print(0)
else:
    print(sum(n // (2 * 5 ** d) for d in range(1, 25 + 1)))
n, t = map(int, input().split())
costs, times = [map(int, input().split()) for i in range(n)]

min_cost = 1001  # 最小コストを入れる変数。初期値は制約上のMAX + 1 にしておく
for cost, time in zip(costs, times):
    if time <= t and cost < min_cost:
        min_cost = cost

if min_cost < 1000:
    print(min_cost)
else:
    print('TLE')

### FIXED CODE ###

n, t = map(int, input().split())
_list = [input() for i in range(n)]
costs, times = [], []
for elem in _list:
    # print(elem)  # debug
    cost, time = map(int, elem.split())
    costs.append(cost)
    times.append(time)

min_cost = 1001  # 最小コストを入れる変数。初期値は制約上のMAX + 1 にしておく
for cost, time in zip(costs, times):
    if time <= t and cost < min_cost:
        min_cost = cost  # 時間内 and costがこれまでの最小コストより小さければ更新

if min_cost <= 1000:
    print(min_cost)
else:
    print('TLE')
N = int(input())
nums = [int(i) for i in input().split()]
from math import gcd
from functools import reduce
def compute_gcd(numbers):
    return reduce(gcd, numbers)
from copy import copy
gcds = []
for i in range(len(nums)):
    n = copy(nums)
    n.pop(i)
    gcds.append(compute_gcd(n))
gcds = list(set(gcds))
print(gcds[-1])

### FIXED CODE ###

N = int(input())
nums = [int(i) for i in input().split()]
nums_sorted = sorted(list((set(nums))), reverse=True)
def compute_divs(n):
    divs = []
    if n == 1: return [1]
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            divs.append(i)
            if i != n // i:
                divs.append(n//i)
    divs.append(n)
    return divs
ans = 1
if len(nums_sorted) == 1: ans = nums[0]
else:
    divs1 = compute_divs(nums_sorted[0])
    divs2 = compute_divs(nums_sorted[1])
    divs = sorted(list(set(divs1+divs2)))
    for i in reversed(divs):
        c= 0
        for j in nums:
            if j % i != 0:
                c += 1
                if c == 2:
                    break
        if c <= 1:
            ans = i
            break
print(ans)
S=input()
print(':'.join(map(str,[S/3600,S%3600/60,S%60])))

### FIXED CODE ###

S=int(input())
print(S//3600,(S%3600)//60,S%60,sep=":")