Harryxun/stf_run huggingface dataset:
N = int(input())
Ts = input().split()
Ts = [int(i) for i in Ts]
Tsum = sum(Ts)
M = int(input())
for i in range(M):
    P,X = map(int,input().split())
    res = Tsum - Ts[i] + X
    print(res)

### FIXED CODE ###

N = int(input())
Ts = input().split()
Ts = [int(i) for i in Ts]
Tsum = sum(Ts)
M = int(input())
res_list = []
for i in range(M):
    P,X = map(int,input().split())
    res = Tsum - Ts[P-1] + X
    print(res)
a=int(input())
b=int(input())
print(a*b)

### FIXED CODE ###

a,b=map(int,input().split(' '))
print(a*b)
X = int(input())
Y = int(input())
Z = int(input())
X,Y = Y,X
X,Z = Z,X
print(X,Y,Z)

### FIXED CODE ###

X,Y,Z = map(int,input().split())
X,Y = Y,X
X,Z = Z,X
print(X,Y,Z)
import sys
import math
from operator import mul
from functools import reduce
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

mod = 10**9+7 
N = 10**4
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 )

x,y= (int(_) for _ in input().split()) 
if (x+y)%3!=0:
    print(0)
    sys.exit()
else:
    n=(x+y)/3
    n=int(n)
    if x<n or y<n:
         print(0)
         sys.exit()
    else:
        x=x-n
        y=y-n
        ans=int(cmb(x+y, x,mod))
        print(ans%1000000007)

### FIXED CODE ###

import sys
import math
from operator import mul
from functools import reduce
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

mod = 10**9+7 
N = 10**6
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 )

x,y= (int(_) for _ in input().split()) 
if (x+y)%3!=0:
    print(0)
    sys.exit()
else:
    n=(x+y)/3
    n=int(n)
    if x<n or y<n:
         print(0)
         sys.exit()
    else:
        x=x-n
        y=y-n
        ans=int(cmb(x+y, x,mod))
        print(ans%1000000007)
import bisect

INF = 10**9 + 1

N, Q = [int(x) for x in input().split()]

data = []
for i in range(N):
    S, T, X = [int(x) for x in input().split()]
    data.append([X, S, T])
data = sorted(data, reverse=True)

D = []
for i in range(Q):
    D.append(int(input()))

dist = [INF]*Q
for i in range(N):
    print(dist)
    [X, S, T] = data[i]
    l = bisect.bisect_left(D, S - X - 0.5)
    r = bisect.bisect_right(D, T - X - 0.5)
    dist = dist[:l] + [X]*(r - l) + dist[r:]

for i in range(Q):
    if dist[i] == INF:
        print(-1)
    else:
        print(dist[i])

### FIXED CODE ###

import sys
input=sys.stdin.readline
from bisect import bisect_left
n,q=map(int,input().split())
stop=[]
for i in range(n):
	s,t,x=map(int,input().split())
	stop.append((s,t,x))
stop.sort(key=lambda x:x[2])
d=[int(input())for i in range(q)]
R=[-1]*q
ans=[-1]*q
for s,t,x in stop:
	#lからrにある区間のansをxに更新したい
	l=bisect_left(d,s-x)
	r=bisect_left(d,t-x)
	while l<r:
		if R[l]==-1:#最左がまだ確定していない場合
			ans[l]=x
			R[l]=r
			l+=1
		else:
			l=R[l]#確定しているところを飛ばす
for x in ans:
	print(x)
import math
N, X = map(int, input().split())
a = []
for i in range(N):
    a.append(input())
    
kosuu = len(a)
X = X - sum(a)

kosuu = kosuu + math.floor(X/min(a))

print(kosuu)

### FIXED CODE ###

import math
N, X = map(int, input().split())
a = []
for i in range(N):
    a.append(int(input()))
    
kosuu = len(a)
X = X - sum(a)

kosuu = kosuu + math.floor(X/min(a))

print(kosuu)
A,B,N=map(int,input().split())

def f(t):
    return int(t)

Max_x=0

for i in range(N):
    if f(A*i/B)-A*f(i/B)<f(A*(i+1)/B)-A*f((i+1)/B):
        Max_x=i+1
        
print(f(A*Max_x/B)-A*f(Max_x/B))

### FIXED CODE ###

K=int(input())
A,B=map(int,input().split())

Ans='NG'

for i in range(A,B+1):
    if i%K==0:
        Ans='OK'
        break
        
print(Ans)
N = int(input())
if N%2 = 0:
  print(N)
else:
  print(2*N)

### FIXED CODE ###

N = int(input())
if N%2 == 0:
    print(N)
else:
    print(2*N)
a, b = map(int, input().split())
print('Draw' if a==b else 'Alice' if (a==1)or(b!=1 and a>b)) else 'Bob')

### FIXED CODE ###

a, b = map(int, input().split())
print('Draw' if a==b else 'Alice' if (a==1)or(b!=1 and a>b) else 'Bob')
a=input()
b=int(a[-1])

if b=0or b=1 or b=6 or b=8:
    print("pon")

elif b=3:
    print("bon")
else:
    print("hon")

### FIXED CODE ###

#a,b,c=map(int,input().split())
a=input()
b=int(a[-1])

if b==0 or b==1 or b==6 or b==8:
    print("pon")

elif b==3:
    print("bon")
else:
    print("hon")
import sys
input = sys.stdin.readline
N = int(input())
if N > 1:
  print(N)
  res = [N] * N
  print(*res)
elif N == 0:
  print(2)
  print(1, 1)
elif N == 1:
  print(2)
  print(2, 0)

### FIXED CODE ###

import sys
input = sys.stdin.readline
N = int(input())
if 50 >= N > 1:
  print(N)
  res = [N] * N
  print(*res)
elif N > 50:
  print(50)
  res = [49] * 50
  t = N // 50
  for i in range(50):
    res[i] += t
  u = N % 50
  if u:
    for i in range(u):
      res[i] += 50 - u + 1
    for i in range(u, 50):
      res[i] -= u
  print(*res)
elif N == 0:
  print(2)
  print(1, 1)
elif N == 1:
  print(2)
  print(2, 0)
n, k = map(int, input().split()) 
a_list = list(map(int, input().split())) 

rireki = [0] * (n+10)
curr_c = 1
rireki[1] = 0

no_loop_count = k
loop_cnt = 0

end = False
for i in range(n):
    next_c = a_list[curr_c-1]
    # print(i, curr_c, next_c)
    if next_c == curr_c:
        print(next_c)
        end = True
    if next_c == 1:
        no_loop_count = 0
        loop_cnt = i + 1
        break
    elif rireki[next_c] == 0:
        rireki[next_c] = i+1
    else:
        # print(next_c)
        no_loop_count = rireki[next_c] -1
        loop_cnt = i - no_loop_count
        break
    curr_c = next_c


if not end:
    if k <= no_loop_count:
        ans = rireki.index(k)
    else:
        # print('k',k)
        # print('no', no_loop_count)
        # print('lo', loop_cnt)
        ind = (k-1-no_loop_count)%loop_cnt +1
        rireki_fix = [i-no_loop_count for i in rireki]
        # print(ind, 'ind')
        ans = rireki_fix.index(ind)
        # print(rireki_fix)

        print(ans)

### FIXED CODE ###

def main():
    n, k = map(int, input().split()) 
    al = list(map(int, input().split())) 
    city_l = [1]
    city_s = set([1])
    loop_city_l = []
    curr_city = 1
    cnt = 0
    for i in range(1,k+1):
        next_c = al[curr_city-1]
        if next_c in city_s:
            cnt = i
            first_city = city_l.index(next_c)
            loop_city_l = city_l[first_city:]
            break
        else:
            city_s.add(next_c)
            city_l.append(next_c)
        curr_city = next_c
    else:
        print(curr_city)
        return

    # print(loop_city_l)
    remained = k-cnt
    last_pos = remained%len(loop_city_l)
    print(loop_city_l[last_pos])

if __name__ == "__main__":
    main()
n=raw_input()
n*(n-1)/2

### FIXED CODE ###

n=input()
print n*(n+1)/2
N, Q = map(int, input().split())

nodes = [[] for _ in range(N)]
values = [0 for _ in range(N)]

for _ in range(N-1):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  nodes[a].append(b)
  nodes[b].append(a)

for _ in range(Q):
  p, x = map(int, input().split())
  p = p-1
  values[p] += x

marked = []
def dfs(i):
  marked.append(i)
  for c in nodes[i]:
    if c not in marked:
      values[c] += values[i]
      dfs(c)

dfs(0)
print(*values)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)

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

nodes = [[] for _ in range(N)]
values = [0 for _ in range(N)]

for _ in range(N-1):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  nodes[a].append(b)
  nodes[b].append(a)

for _ in range(Q):
  p, x = map(int, input().split())
  p = p-1
  values[p] += x

def dfs(i, p):
  for c in nodes[i]:
    if c != p:
      values[c] += values[i]
      dfs(c, i)

dfs(0, None)
print(*values)
d, t, s = map(int, input().split())
if d/s <= t:
    print(Yes)
else:
    print(No) 


### FIXED CODE ###

d, t, s = map(int, input().split( ))
if d/s <= t:
    print('Yes')
else:
    print('No')
n, m = map(int, input().split())
stu = []
check = []
for i in range(n):
    stu.append(list(map(int, input().split())))
for i in range(m):
    check.append(list(map(int, input().split())))
for i in stu:
    min_dis = 2 * 10 ** 8 + 1
    for j, k in enumerate(check):
        dis = abs(i[0] - k[0]) + abs(i[1] - k[1])
        if dis < min_dis:
            ans = j + 1
            min_dis = dis
    print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
stu = []
check = []
for i in range(n):
    stu.append(list(map(int, input().split())))
for i in range(m):
    check.append(list(map(int, input().split())))
for i in stu:
    min_dis = 4 * 10 ** 8 + 1
    for j, k in enumerate(check):
        dis = abs(i[0] - k[0]) + abs(i[1] - k[1])
        if dis < min_dis:
            ans = j + 1
            min_dis = dis
    print(ans)
n = int(input())
if n % 4 == 0: print('Yes')
elif n >= 7 && n % 4 == 3: print('Yes')
elif n >= 14 && n % 4 == 2: print('Yes')
elif n >= 21 && n % 4 == 1: print('Yes')
else: print('No')

### FIXED CODE ###

n = int(input())
if n % 4 == 0: print('Yes')
elif n >= 7 and n % 4 == 3: print('Yes')
elif n >= 14 and n % 4 == 2: print('Yes')
elif n >= 21 and n % 4 == 1: print('Yes')
else: print('No')
n,k=map(int,input().split())
a=list(map(int,input().split()))
num=0
ans=[0]*n
if
def abs_1(num1):
    return(abs(num1))
for i in range(k):
    ans=[0]*n
    for j in range(n):
        for l in range(n):
            if abs_1(j-l)<=a[l]:
                ans[j]+=1
    a=ans
    if sum(a)==n**2:
        break
print(*a)


### FIXED CODE ###

import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
ans=[0]*n
num=[]
if k>41:
    ans=[n]*n
    print(*ans)
else:
    def c(num1,num2,num3):
        num[max(0,num1-num2)]+=1
        num[min(num3,num1+num2+1)]-=1
    for i in range(k):
        num=[0]*(n+1)
        for j in range(n):
            c(j,a[j],n)
        num5=0
        for j in range(n):
            num5+=num[j]
            a[j]=num5
        if sum(a)==n*n:
            break
    print(*a)
while 1:
    n,p = map(int,input().split())
    if n==0:break
    man =  [0]*n
    ball,a = p,0
    while 1:
        if ball >0:ball,man[a%n] =ball-1, man[a%n]+1
        elif ball == 0:ball,man[a%n] = man[a%n],ball
        a+=1
        if p in man:break
    print(man.index(max(man)))        )            

### FIXED CODE ###

while 1:
    n,p = map(int,input().split())
    if n==0:break
    man =  [0]*n
    ball,a = p,0
    while 1:
        a%=n
        if ball >0:
            ball-=1
            man[a]+=1
        elif ball == 0:ball,man[a] = man[a],ball
        if man[a]==p:break
        a+=1
    print(a)
n=int(input())
d=[int(i) for i in input().split()]
d.sort()
print(d[n//2+1]-d[n//2])


### FIXED CODE ###

n=int(input())
d=[int(i) for i in input().split()]
d.sort()
print(d[n//2]-d[n//2-1])
N,A,B=mnap(int,input().split())

C=A*N
if C<B:
  print(B)
elif C>B:
  print(C)

### FIXED CODE ###

N,A,B=map(int,input().split())

C=A*N
if C<=B:
  print(C)
elif C>B:
  print(B)
N,A,B=map(int,input().split())
train=N*A
taxi=B
if train<=taxi:
    print(train)
else print(taxi)

### FIXED CODE ###

N,A,B=map(int,input().split())
train=N*A
taxi=B
if train<=taxi:
    print(train)
else: print(taxi)
k,s = map(int,input().split())
ans = 0
debug = []
for i in range(k+1):
    for l in range(k+1):
        if (s-i-l) >= 0 and (s-i-l) <= k:
            if i+l+(s-i-l) == s:
                ans += 1
                debug.append(str(i)+"+"+str(l)+"+"+str(s-i-l))
                print(debug)
print(ans)

### FIXED CODE ###

k,s = map(int,input().split())
ans = 0
for i in range(k+1):
    for l in range(k+1):
        if (s-i-l) >= 0 and (s-i-l) <= k:
            ans += 1
print(ans)
N, K = map(int, input().split())
H = map(int, input().split())

H.sorted(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[i]
    print(sum(H))


### FIXED CODE ###

H, A = map(int, input().split(" "))

print(-(-H//A))
#!/usr/bin/env pypy3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import math

n = int(sys.stdin.readline())
a = tuple(map(int,sys.stdin.readline().split()))
#n = int(input())
#a = list(map(int,input().split()))
g = math.gcd(a[0],a[1])
for i in range(2,n):
    g = math.gcd(g,a[i])
M = max(a)
acc = a[0]
for i in range(N):
    acc = math.gcd(acc,a[i])
if acc != 1:
    print("not coprime")
    exit()

LIMIT=max(a)
minPrime = [0]*(LIMIT+1)
minPrime[1] = 1
def make():
    for i in range(2,LIMIT+1):
        if minPrime[i] == 0:
            minPrime[i] = i
            #print(i)
            for j in range(i+i,LIMIT+1,i):
                #print(i,j)
                if minPrime[j] == 0:
                    minPrime[j] = i
make()
def factrial(N):
     ret = []
     while minPrime[N] != N:
         ret.append(minPrime[N])
         N = N//minPrime[N]
     if N != 1:
         ret.append(N)
     return ret

judge = set([])
pc = True

for i in a:
    if not pc:
        break
    asf = set(factrial(i))

    if judge & asf != set():
        pc = False
    judge |= asf
if pc:
    print("pairwise coprime")
elif g == 1:
    print("setwise coprime")
else:
    print("not coprime")


### FIXED CODE ###

import math
from collections import defaultdict
pc = True
n = int(input())
a = list(map(int,input().split()))
g = math.gcd(a[0],a[1])
for i in range(2,n):
    g = math.gcd(g,a[i])
M = max(a)
class Sieve_of_Eratosthenes:
    def __init__(self, N):
        self.sieve = [-1] * (N+1)
 
        for i in range(2,N+1):
            if self.sieve[i] == -1:
                for j in range(1,1+N//i):
                    self.sieve[i*j] = i
 
    def isprime(self, num):
        if num <= 1:
            return False
        else:
            return self.sieve[num] == num
 
    def factorization(self, num):
        ret = set([])
        while num != 1:
            div = self.sieve[num]
            ret.add(div)
            num //= div
        return ret
 
sofe = Sieve_of_Eratosthenes(M)
ddic = defaultdict()
judge = set([])
 
for i in a:
    if not pc:
        break
    asf = sofe.factorization(i)
    
    if judge & asf != set():
        pc = False
    judge |= asf
if pc:
    print("pairwise coprime")
elif g == 1:
    print("setwise coprime")
else:
    print("not coprime")
N, M = map(int, input().split())
mod_ = 10 ** 9 + 7

nA = 1

for i in range(N):
  nA *= M - i
  nA %= mod_

dp = [0 for i in range(N+1)]
dp[1] = M - N
dp[2] = M - N + 1 + (M - N)*(M - N)
dp[1] %= mod_
dp[2] %= mod_
for i in range(3, N+1):
  dp[i] = dp[i-1] * (M - N + i - 1) + dp[i-2] * (i-1)
  dp[i] %= mod_
  
print( nA * dp[N] % mod_ )

### FIXED CODE ###

N, M = map(int, input().split())
mod_ = 10 ** 9 + 7

nA = 1

for i in range(N):
  nA *= M - i
  nA %= mod_

dp = [0 for i in range(N+1)]
dp[1] = M-N
if N == 1:
  print( nA * dp[N] % mod_ )  
else:
  dp[2] = M - N + 1 + (M - N)*(M - N)
  dp[1] %= mod_
  dp[2] %= mod_
  for i in range(3, N+1):
    dp[i] = dp[i-1] * (M - N + i - 1) + dp[i-2] * (i-1)
    dp[i] %= mod_
  print( nA * dp[N] % mod_ )
K = int(input())
num = list(range(1, 10))
for i in range(K):
  a = num[i]
  b = 10 * a + a % 10
  if a % 10 != 0:
    num.append(b - 1)
  num.append(b)
  if a % 10 != 9:
    num.append(b + 1)
print(num[K - 1])

### FIXED CODE ###

A, B, C = map(int, input().split()) 
print(C, A, B)
def solve():
    n = int(input())
    print(n+1)//2

solve()

### FIXED CODE ###

def solve(n):
    return (n+1)//2

n = int(input())
print(solve(n))
from functools import reduce

x,y=list(map(int,input().split()))
mod = 10 ** 9 + 7

if (2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0:
  print("0")
  exit()
  
a,b = (2 * y - x) // 3, (2 * x - y) // 3 

r = min(a,b)

numerator = reduce(lambda x, y: x * y % mod, [a + b - r + k + 1 for k in range(r)])
denominator = reduce(lambda x, y: x * y % mod, [k + 1 for k in range(r)])
print(numerator * pow(denominator, mod - 2, mod) % mod)

### FIXED CODE ###

from functools import reduce

x,y=list(map(int,input().split()))
mod = 10 ** 9 + 7

if (2 * y - x) % 3 != 0 or (2 * x - y) % 3 != 0:
  print("0")
  exit()
  
a,b = (2 * y - x) // 3, (2 * x - y) // 3 

r = min(a,b)

if r == 0:
  print("1")
elif r < 0:
  print("0")
else:
  numerator = reduce(lambda x, y: x * y % mod, range(a + b - r + 1, a + b + 1))
  denominator = reduce(lambda x, y: x * y % mod, range(1,r + 1))
  print(numerator * pow(denominator, mod - 2, mod) % mod)
import sys
import math

a,b,c,d = [int(x) for x in sys.stdin.readline().rstrip().split(" ")]
e = b - a + 1
f = int(b / c) - int((a - 1) / c)
g = int(b / d) - int((a - 1) / d)
cd = math.lcm(c, d)
h = int(b / cd) - int((a - 1) / cd)
n = e - f - g + h
print(n)


### FIXED CODE ###

import sys
import math

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

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

  
a,b,c,d = [int(x) for x in sys.stdin.readline().rstrip().split(" ")]
e = b - a + 1
if c == d:
  fgh = (b // c) - ((a - 1) // c)
  n = e - fgh
  print(n) 
else:
  f = (b // c) - ((a - 1) // c)
  g = (b // d) - ((a - 1) // d)
  cd = lcm(c, d) 
  h = (b // cd) - ((a - 1) // cd)
  n = e - f - g + h
  print(n)
import numpy as np
from fractions import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N,M=map(int,input().split())
a=[i//2 for i in map(int,input().split())]
b=np.array(a)
cnt=0
while all(b%2==0):
  b//=2
if any(b%2==0):
  print(0)
  exit()
ans=1
for i in a:
  ans=lcm(ans,i)
print((M//ans+1)//2)


### FIXED CODE ###

import numpy as np
from fractions import gcd
def lcm(a,b):
  return a*b//gcd(a,b)
N,M=map(int,input().split())
a=[i//2 for i in map(int,input().split())]
b=np.array(a)
cnt=0
while all(b%2==0):
  b//=2
if any(b%2==0):
  print(0)
  exit()
ans=1
for i in a:
  ans=lcm(ans,i)
print((M//ans+1)//2)
import sympy
def gcd(LIST):
    ans=LIST[0]
    for member in LIST[1:]:
        ans=sympy.gcd(ans,member)
    return ans
N=int(input())
A=list(map(int,input().split()))
print(gcd(A))

### FIXED CODE ###

def gcd(LIST):
    ans=LIST[0]
    for member in LIST[1:]:
        x=max(ans,member)
        y=min(ans,member)
        if x%y==0:
            ans=y
        else:
            while x%y!=0:
                z=x%y
                x=y
                y=z
            ans=z
    return ans
N=int(input())
A=list(map(int,input().split()))
print(gcd(A))
K=38
K=int(input())
N=K**2-K+1

print(N,K)
_res=[[-1 for j in range(K-1)] for i in range((K-1)**2)]
rest=[[-1 for j in range(K-1)] for i in range(K-1)]

id=K
start=0
while N>id:
    for j in range(K-1):
        _res[(K-1)*j+(start+j*((id-1)//(K-1)))%(K-1)][(id-1)//(K-1)-1]=id
    id+=1
    start=(start+1)%(K-1)

rest=[[_res[j][i] for j in range(K-1)] for i in range(K-1)]

ans=[[i for i in range(K)]]
for i in range(K-1):
    for j in range(K-1):
        tmp=[i]+_res[(K-1)*i+j]
        ans.append(tmp)
for i in range(K-1):
    tmp=[K-1]+rest[i]
    ans.append(tmp)

for i in range(N):
    ans[i]=[ans[i][j]+1 for j in range(K)]

for i in range(N):
    print(*ans[i])

def check():
    ids=[[] for i in range(N)]
    for i in range(N):
        ans[i].sort()
        if ans[i][0]<0 or ans[i][-1]>N-1:
            exit(print("WA1"))
        for j in range(1,K):
            if ans[i][j]==ans[i][j-1]:
                exit(print("WA2"))
        for j in range(K):
            ids[ans[i][j]].append(i)
    for i in range(N):
        if len(ids[i])!=K:
            exit(print("WA3"))
    p=set([])
    for i in range(N):
        for j in range(len(ids[i])):
            for k in range(j):
                a,b=ids[i][j],ids[i][k]
                if (a,b) in p:
                    print("WA4")
                    print(ans[a])
                    print(ans[b])
                    exit()

                p.add((a,b))

#check()


### FIXED CODE ###

K=38
#K=int(input())
N=K**2-K+1

print(N,K)
_res=[[-1 for j in range(K-1)] for i in range((K-1)**2)]
rest=[[-1 for j in range(K-1)] for i in range(K-1)]

id=K
start=0
while N>id:
    for j in range(K-1):
        _res[(K-1)*j+(start+j*((id-1)//(K-1)))%(K-1)][(id-1)//(K-1)-1]=id
    id+=1
    start=(start+1)%(K-1)

rest=[[_res[j][i] for j in range(K-1)] for i in range(K-1)]

ans=[[i for i in range(K)]]
for i in range(K-1):
    for j in range(K-1):
        tmp=[i]+_res[(K-1)*i+j]
        ans.append(tmp)
for i in range(K-1):
    tmp=[K-1]+rest[i]
    ans.append(tmp)

for i in range(N):
    ans[i]=[ans[i][j]+1 for j in range(K)]

for i in range(N):
    print(*ans[i])

def check():
    ids=[[] for i in range(N)]
    for i in range(N):
        ans[i].sort()
        if ans[i][0]<0 or ans[i][-1]>N-1:
            exit(print("WA1"))
        for j in range(1,K):
            if ans[i][j]==ans[i][j-1]:
                exit(print("WA2"))
        for j in range(K):
            ids[ans[i][j]].append(i)
    for i in range(N):
        if len(ids[i])!=K:
            exit(print("WA3"))
    p=set([])
    for i in range(N):
        for j in range(len(ids[i])):
            for k in range(j):
                a,b=ids[i][j],ids[i][k]
                if (a,b) in p:
                    print("WA4")
                    print(ans[a])
                    print(ans[b])
                    exit()

                p.add((a,b))

#check()
N=input()

if N%2==0:
  print((N/2)/N)
  
else:
  print((N//2+1)/N)

### FIXED CODE ###

N=int(input())

if N%2==0:
  print((N/2)/N)
  
else:
  print((N//2+1)/N)
n, m = map(int, input().split())
a = [0]
b = [0]
for i in range(1, m+1):
    ta, tb = map(int, input().split())
    a.append(ta)
    b.append(tb)
dir = [[] for _ in range(m+1)]
for i in range(1, m+1):
    dir[a[i]].append(b[i])
    dir[b[i]].append(a[i])
ans = [0 for i in range(n+1)]
flag = [0 for i in range(n+1)]
flag[1] = 1
que = [1]
while len(que) != 0:
    print('que: ', len(que), que)
    now = que.pop()
    flag[now] = 1
    for to in dir[now]:
        if flag[to] != 1 and not (to in que):
            que.append(to)
            flag[to] != 1
            ans[to] = now
"""         print(to)
        ans[to] = now
        flag[to] = 1
        for toto in dir[to]:
            if flag[toto] != 1:
                que.append(toto) """
print('Yes')
for i in range(2,n+1):
    print(ans[i])

### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
dir = [[] for _ in range(n+1)]

for i in range(m):
    ta, tb = map(int, input().split())
    dir[ta].append(tb)
    dir[tb].append(ta)

ans = [0]*(n+1)
flag = [False]*(n+1)
flag[1] = True
que = deque([1])
while que:
    #print('que: ', len(que), que)
    now = que.popleft()
    for to in dir[now]:
        if flag[to]:
            continue
        que.append(to)
        flag[to] = True
        ans[to] = now

print('Yes')
for i in range(2,n+1):
    print(ans[i])
n = int(input())
a = []
for i in range(n):
  x = int(input())
  a.append(x)
print(len(set(a))

### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
  x = int(input())
  a.append(x)

print(len(set(a)))