Harryxun/stf_run huggingface dataset:
import numpy as np

A,B,H,M = map(int,input().split())

th_a = 30*H
th_b = 6*M

theta = th_a -th_b

if theta == 0:
  if A >= B:
    print(A-B)
  else:
    print(B-A)

elif theta == 180:
  print(A+B)

else:
  print(np.sqrt(A**2 + B**2 - 2*A*B*cos(theta)))

### FIXED CODE ###

import numpy as np

A,B,H,M = map(int,input().split())

th_a = 30*H + 0.5 * M
th_b = 6*M

theta = th_a -th_b

if theta <= 0:
  theta = -theta
if theta >= 180:
  theta = 360 - theta

if theta == 0:
  if A >= B:
    print(A-B)
  else:
    print(B-A)

elif theta == 180:
  print(A+B)

else:
  print(np.sqrt(A**2 + B**2 - 2*A*B*np.cos(theta*np.pi/180)))
m=input()
print(m*m)

### FIXED CODE ###

m=int(input())
print(m * m)
N=int(input())
arr=[0]*N
for i in range(1,N):
    A=int(input())
    arr[A-1]+=1
for i in range(0,N):
    print(arr[i])

### FIXED CODE ###

N=int(input())
L=[0]*N
A=list(map(int,input().split()))
for i in range(0,len(A)):
    L[A[i]-1]+=1
for i in range(0,N):
    print(L[i])
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

n,m,q=MI()
strs=[[[] for i in range(m)] for i in range(n)]
for i in range(m):
    strs[0][i].append(str(i))
#print(strs)
for i in range(n-1):
    for j in range(m):
        for k in range(j,m):
            for s in strs[i][k]:
                strs[i+1][j].append(str(j)+s)
#print(strs)

L=strs[n-1]
#print(L)
lis=[]
for i in range(m):
    for s in L[i]:
        lis.append(s)
#print(lis)
mx=0
zyou=[LI() for i in range(q)]
for u in lis:
    po=0
    for k in range(q):
        a,b,c,d=zyou[k]
        if int(u[b-1])-int(u[a-1])==c:
            po+=d
    if po>mx:
        mx=po
print(mx)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

a,b,n=MI()
s=min(n,b-1)
ans=floor(a*s/b)-a*floor(s/b)
print(ans)
a = input()
if int(a[0]) * int(a[1]) % 2 == 0:
    print("Even")
else:
    print("Odd")

### FIXED CODE ###

a,b = map(int,input().split())
if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
def i1():
  return int(input())
def i2():
  return [int(i) for i in input().split()]
[n,m]=i2()
e=[[] for i in range(n+100)]
for i in range(m):
  [a,b]=i2()
  e[a].append(b)
  e[b].append(a)

import sys
sys.setrecursionlimit(10000)
d=[0 for i in range(n+100)]
dd=[]
def dfs1(v):
    d[v]=1
    for i in e[v]:
      if d[i]==0:
          dd.append(i)
          dfs1(i)
          break
ddd=[]
def dfs2(v):
    d[v]=1
    for i in e[v]:
      if d[i]==0:
          ddd.append(i)
          dfs2(i)
          break
dfs1(1)
dfs2(1)
l=ddd[::-1]+[1]+dd
print(len(l))
print(*l)


### FIXED CODE ###

def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
[n,m]=i2()
e=[[] for i in range(n+100)]
for i in range(m):
 [a,b]=i2()
 e[a].append(b)
 e[b].append(a)

import sys
sys.setrecursionlimit(10**6)
d=[0 for i in range(n+100)]
dd=[]
def dfs1(v):
   d[v]=1
   for i in e[v]:
      if d[i]==0:
         dd.append(i)
         dfs1(i)
         break
ddd=[]
def dfs2(v):
   d[v]=1
   for i in e[v]:
      if d[i]==0:
         ddd.append(i)
         dfs2(i)
         break
dfs1(1)
dfs2(1)
l=ddd[::-1]+[1]+dd
print(len(l))
print(*l)
x = int(input())
if x = 7:
     print('YES')
 elif x = 5:
     print('YES')
 elif x =3:
     print('YES')
 else:
     print('NO')

### FIXED CODE ###

x = int(input())
if x == 7:
     print('YES')
elif x == 5:
     print('YES')
elif x == 3:
     print('YES')
else:
     print('NO')
a,b = map(int,input().split())
if a+b==15:
  print("+")
else if a*b==15:
  print("*")
else:
  print("x")


### FIXED CODE ###

a,b = map(int,input().split(" "))
if a+b==15:
  print("+")
elif a*b==15:
  print("*")
else:
  print("x")
whether=input(str())
if whether[1]==whether[2]==whether[3]=="R":
    print ("3")
elif whether[1]==whether[2]==whether[3]=="S":
    print ("0")
elif whether[1]==whether[2]=="R" or whether[2]==whether[3]=="R":
    print ("2")
else:
    print ("1")


### FIXED CODE ###

whether=str(input())
if whether[0]==whether[1]==whether[2]=="R":
    print ("3")
elif whether[0]==whether[1]==whether[2]=="S":
    print ("0")
elif whether[0]==whether[1]=="R" or whether[1]==whether[2]=="R":
    print ("2")
else:
    print ("1")
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n=int(input())
    aa=LI()
    pp=[]
    mm=[]
    for a in aa:
        if a<0:mm.append(a)
        else:pp.append(a)
    if len(mm)%2:
        m=max(mm)
        p=min(pp)
        if p+m>=0:print(sum(pp)-sum(mm)+2*m)
        else:print(sum(pp)-2*p-sum(mm))
    else:
        print(sum(pp)-sum(mm))

main()


### FIXED CODE ###

import numpy as np

n = int(input())
a = np.array(list(map(int, input().split())),dtype="i8")
cm = np.sum(a < 0)
a = np.abs(a)
s = np.sum(a)
if cm % 2:
    s -= np.min(a) * 2
print(s)
N = int(input())
G = [[] for i in range(N)]
for i in range(N - 1):
    a, b, c = map(int, input().split())
    a, b = a - 1, b - 1
    G[a].append([b, c])
    G[b].append([a, c])

Q, K = map(int, input().split())
K -= 1
dist = [-1] * N
dist[K] = 0


def dfs(n):
    for v, c in G[n]:
        if dist[v] < 0:
            dist[v] = dist[n] + c
            dfs(v)


dfs(K)
for q in range(Q):
    x, y = map(int, input().split())
    x, y = x - 1, y - 1
    print(dist[x] + dist[y])


### FIXED CODE ###

import sys;sys.setrecursionlimit(int(1e7))

N = int(input())
ABC = [tuple(map(int, input().split())) for i in range(N-1)]
Q, K = map(int, input().split())
XY = [tuple(map(int, input().split())) for i in range(Q)]

tree = [[] for i in range(N+1)]   
depth = [None] * (N+1)

for abc in ABC:
    tree[abc[0]].append((abc[1],abc[2]))
    tree[abc[1]].append((abc[0],abc[2]))
    
def DFS(v, p, d):
    depth[v] = d
    for e in tree[v]:
        if e[0] != p:
            DFS(e[0], v, d + e[1])
            
DFS(K, 0, 0)

for x,y in XY:
    print(depth[x] + depth[y])
import math
num_vertax,num_coler=map(int,input().split())
ver_array=[0]*num_vertax
for i in range(num_vertax-1):
    a,b=map(int,input().split())
    ver_array[a-1]+=1
    ver_array[b-1]+=1
ans=num_coler
factorial=math.factorial(num_coler-1)
def permutation_modp(n,k):
    global factorial
    ans=factorial//n
    ans//=math.factorial(k)
    return ans
ans*=permutation_modp(1,num_coler-ver_array.pop(0)-1)
for ver in ver_array:
    ans*=permutation_modp(num_coler-1,num_coler-ver-1)
print(ans%1000000007)

### FIXED CODE ###

N,K=map(int,input().split())
mod=1000000007
path=[[] for i in range(N)]
for i in range(N-1):
  a,b=map(int,input().split())
  a=a-1
  b=b-1
  path[a].append(b)
  path[b].append(a)
#print(path)
  
abc=[False for i in range(N)] #0ならまだ塗ってない
 
abc[0]=True
cnt=0
ans=K%mod
nx=[]
for i in range(len(path[0])):
  child=path[0][i]
  if abc[child]:
    continue
  ans=ans*(K-1-cnt)
  ans=ans%mod
  cnt=cnt+1
  abc[child]=True
  nx.append(child)
while len(nx)>0:
  a=nx.pop()
  cnt=0
  for i in range(len(path[a])):
    child=path[a][i]
    if abc[child]:
      continue
    ans=ans*(K-2-cnt)
    ans=ans%mod
    cnt=cnt+1
    abc[child]=True
    nx.append(child)
      
print(ans%mod)
#109_D
H,W=map(int,input().split())
A=[]
Ans=[]
for i in range(N):
    a=list(map(int,input().split()))
    if i%2==0:
        A+=a
    else:
        A+=a[::-1]
for i in range(H*W-1):
    if A[i]%2==1:
        A[i]-=1
        A[i+1]+=1
        y1=i//W+1
        x1=i%W+1 if y1%2==1 else W-i%W
        y2=(i+1)//W+1
        x2=(i+1)%W+1 if y2%2==1 else W-(i+1)%W
        Ans.append([y1,x1,y2,x2])
print(len(Ans))
for ans in Ans:
    print(*ans)

### FIXED CODE ###

#109_D
H,W=map(int,input().split())
A=[]
Ans=[]
for i in range(H):
    a=list(map(int,input().split()))
    if i%2==0:
        A+=a
    else:
        A+=a[::-1]
for i in range(H*W-1):
    if A[i]%2==1:
        A[i]-=1
        A[i+1]+=1
        y1=i//W+1
        x1=i%W+1 if y1%2==1 else W-i%W
        y2=(i+1)//W+1
        x2=(i+1)%W+1 if y2%2==1 else W-(i+1)%W
        Ans.append([y1,x1,y2,x2])
print(len(Ans))
for ans in Ans:
    print(*ans)
a,b,c=map(int,input().split)
print(c-(a+b))

### FIXED CODE ###

a,b,c=map(int,input().split())
print(max(c-a+b,0))
large_p = 10**9 + 7
a = []
kazu_memo = {}
def f(target_step):
    global kazu_memo
    #print(target_step)
    if target_step in a:
        return 0
    elif target_step < 0:
        return 0
    elif target_step == 0:
        return 1
    else:
        if kazu_memo[target_step] > 0:
            return kazu_memo[target_step]
        else:
            kazu_tmp = 0
            kazu_tmp += f(target_step - 1)
            kazu_tmp += f(target_step - 2)
            kazu_memo[target_step] = kazu_tmp
            return kazu_tmp

def main():
    global a, kazu_memo
    n, m = map(int, input().split())
    a = [int(input()) for _ in range(m)]

    kazu_memo = {e: -1 for e in range(1, n + 1)}
    r = f(n)
    print(r % large_p)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
large_p = 10**9 + 7
a = []
kazu_memo = {}
kazu_tmp = 0
def f(target_step):
    global kazu_memo, kazu_tmp
    #print(target_step)
    if target_step < 0:
        return 0
    else:
        if kazu_memo[target_step] >= 0:
            return kazu_memo[target_step]
        else:
            kazu_tmp = (f(target_step - 1) + f(target_step - 2)) % large_p
            kazu_memo[target_step] = kazu_tmp
            return kazu_tmp

def main():
    global a, kazu_memo
    n, m = map(int, input().split())
    kazu_memo = {e: -1 for e in range(0, n + 1)}
    kazu_memo[0] = 1
    for _ in range(m):
        ta = int(input())
        kazu_memo[ta] = 0

    r = f(n)
    print(r % large_p)


if __name__ == '__main__':
    main()
h=int(input())
m=int(math.long(h,2))
print(2**(h+1)-1)

### FIXED CODE ###

import math
h=int(input())
m=int(math.log(h,2))
print(int(2**(m+1)-1))
N = int(input())
S = input()

ans = 0

# 3文字以上
for i in range(0, N - 2):
    for j in range(i + 3, N):
        if S[i:i + 3] == S[j:j + 3]:
            i += 2
            j += 2
            max_length = j
            length = 3
            while True:
                if i + 1 == max_length or j + 1 == N:
                    break
                else:
                    i += 1
                    j += 1
                if S[i] == S[j]:
                    length += 1
                else:
                    break
            if length > ans:
                ans = length

# 2文字
if ans == 0:
    for i in range(0, N - 1):
        s = S[i:i + 2]
        if s in S[i + 1:]:
            ans = 2

# 1文字
if ans == 0:
    for i in range(N):
        s = S[i]
        if s in S[i + 1:]:
            ans = 1

print(ans)


### FIXED CODE ###

N = int(input())
S = input()

ans = 0
left, right = 0, 1
while right < N:
    s = S[left:right]
    if s in S[right:]:
        ans = max(ans, len(s))
        right += 1
    else:
        left += 1

print(ans)
S = input()
n = len(S)
ans = n//2
c = S[ans]

while ans <= n:
    if c == S[ans] == S[-ans-1]:
        ans += 1
    else:
        break
print(ans)


### FIXED CODE ###

S = input()
n = len(S)
ans = n//2
c = S[ans]

while ans < n:
    if c == S[ans] == S[-ans-1]:
        ans += 1
    else:
        break
print(ans)
# coding: utf-8

n,m=map(int,input().split())
while n!=0:
    d=[]
    p=[]
    
    for i in range(n):
        d_i,p_i=map(int,input().split())
        d.append(d_i)
        p.append((p_i,i)) #タプルでインデックス情報を付加
    
    #単位長さあたりの期待値で降順ソート
    p.sort(key=lambda x:-x[0])
    
    #警備がいない場合の期待値を求める
    hazard=0
    for i in range(n):
        hazard+=d[i]*p[i][0]
    
    for i in range(n):
        rest=d[p[i][1]]
        while rest!=0:
            if m==0:
                break
            m-=1
            rest-=1
            hazard-=p[i][0]
        else:
            continue
        break
        
    print(hazard)
    
    n,m=map(int,input().split())



### FIXED CODE ###

# coding: utf-8

n,m=map(int,input().split())
while n!=0:
    d=[]
    p=[]
    
    for i in range(n):
        d_i,p_i=map(int,input().split())
        d.append(d_i)
        p.append((p_i,i)) #タプルでインデックス情報を付加
    #警備がいない場合の期待値を求める
    
    hazard=0
    for i in range(n):
        hazard+=d[i]*p[i][0]
    
    #単位長さあたりの期待値で降順ソート
    p.sort(key=lambda x:-x[0])
    
    for i in range(n):
        rest=d[p[i][1]]
        if m<rest:
            hazard-=m*p[i][0]
            break
        else:
            m-=rest
            hazard-=rest*p[i][0]
        
    print(hazard)
    n,m=map(int,input().split())
a,b,c,d = map(int, input().split())

if a + b + c + d == 7:
    print('{a}+{b}+{c}+{d}=7'.format(a,b,c,d))
elif a + b + c - d == 7:
    print('{a}+{b}+{c}-{d}=7'.format(a,b,c,d))
elif a + b - c + d == 7:
    print('{a}+{b}-{c}+{d}=7'.format(a,b,c,d))
elif a + b - c - d == 7:
    print('{a}+{b}-{c}-{d}=7'.format(a,b,c,d))
elif a - b + c + d == 7:    
    print('{a}-{b}+{c}+{d}=7'.format(a,b,c,d))
elif a - b + c - d == 7:       
    print('{a}-{b}+{c}-{d}=7'.format(a,b,c,d))
elif a - b - c + d == 7:     
    print('{a}-{b}-{c}+{d}=7'.format(a,b,c,d))
elif a - b - c - d == 7:    
    print('{a}-{b}-{c}-{d}=7'.format(a,b,c,d))

### FIXED CODE ###

a,b,c,d = map(int, list(input()))

if a + b + c + d == 7:
    print('{}+{}+{}+{}=7'.format(a,b,c,d))
elif a + b + c - d == 7:
    print('{}+{}+{}-{}=7'.format(a,b,c,d))
elif a + b - c + d == 7:
    print('{}+{}-{}+{}=7'.format(a,b,c,d))
elif a + b - c - d == 7:
    print('{}+{}-{}-{}=7'.format(a,b,c,d))
elif a - b + c + d == 7:    
    print('{}-{}+{}+{}=7'.format(a,b,c,d))
elif a - b + c - d == 7:       
    print('{}-{}+{}-{}=7'.format(a,b,c,d))
elif a - b - c + d == 7:     
    print('{}-{}-{}+{}=7'.format(a,b,c,d))
elif a - b - c - d == 7:    
    print('{}-{}-{}-{}=7'.format(a,b,c,d))
from functools import lru_cache
from bisect import bisect
from itertools import accumulate

MOD = 998244353

def solve(robots):
    robots.append((-float('inf'),float('inf')))
    N = len(robots)
    robots.sort()

    origins = [x for x,d in robots]
    dests = [x+d for x,d in robots]

    parent = [None]*N

    stack = [(float('inf'),None)]
    for i,(o,d) in enumerate(zip(origins,dests)):
        while stack[-1][0] <= o:
            stack.pop()
        parent[i] = stack[-1][1]
        while stack[-1][0] <= d:
            stack.pop()
        stack.append((d,i))

    adj = [list() for _ in range(N)]
    for i,p in enumerate(parent):
        if p is not None:
            adj[p].append(i)
    sources = [i for i,v in enumerate(parent) if v is None]

    @lru_cache(None)
    def rec(i):
        if not adj[i]:
            return 1
        a = 1
        for j in adj[i]:
            a *= rec(j)+1
            a %= MOD
        return a

    return rec(0)

if __name__ == '__main__':
    N = int(input())
    robots = [tuple(map(int,input().split())) for _ in range(N)]
    print(solve(robots))

### FIXED CODE ###

from bisect import bisect
from itertools import accumulate
from functools import reduce
from sys import setrecursionlimit

setrecursionlimit(10000000)

MOD = 998244353

def solve(robots):
    N = len(robots)
    robots.sort()

    parent = [None]*(N+1)

    stack = [(float('inf'),0)]
    for i,(x,d) in enumerate(robots,start=1):
        d += x
        while stack[-1][0] <= x:
            stack.pop()
        parent[i] = stack[-1][1]
        while stack[-1][0] <= d:
            stack.pop()
        stack.append((d,i))

    dp = [1]*(N+1)
    for i in reversed(range(1,N+1)):
        p = parent[i]
        dp[p] *= dp[i]+1
        dp[p] %= MOD
    return dp[0]

if __name__ == '__main__':
    N = int(input())
    robots = [tuple(map(int,input().split())) for _ in range(N)]
    print(solve(robots))
import numpy as np
import itertools
import bisect

n=int(input())
a=sorted([int(i) for i in input().split()])
b=sorted([int(i) for i in input().split()])
c=sorted([int(i) for i in input().split()])

count=0
index_b=0
index_c=0
for i in range(n):
        index_c=bisect.bisect_left(b,c[i])
        for j in range(index_c):
                count+=bisect.bisect_left(a,b[j])
print(count)

### FIXED CODE ###

import numpy as np

s=input()
t=input()

print('YES' if s[0]==t[2] and s[1]==t[1] and s[2]==t[0] else 'NO')
n,m = [int(i) for i in input().split()]
e = [[int(j) for j in input().split()] for i in range(m)]
sorted(e,key= lambda x : x[1])
s=[]
for i in e:
  if i[0]<=s[-1] and s!=[]:
    pass
  else:
    s.append(i[1]-1)
    
print(len(s))


### FIXED CODE ###

n,m = [int(i) for i in input().split()]
e = [[int(j) for j in input().split()] for i in range(m)]
new_e =sorted(e,key= lambda x : x[1])
s=[]
for i in new_e:
  if s!= [] and i[0]<=s[-1]:
    pass
  else:
    s.append(i[1]-1)

print(len(s))
s=input()

if 12<int(s[:2]):
    if 12>=int(s[2:])>=1:
        print("YYMM")
    else:
        print("NA")
else:
    if 12>=int(s[2:])>=1:
        print("AMBIGUOUS")
    elif 12<s[2:]:
        print("MMYY")
      


    


### FIXED CODE ###

s=input()

if 12<int(s[:2]) or 0==int(s[:2]):
    if 12>=int(s[2:])>=1:
        print("YYMM")
    else:
        print("NA")
elif 1<=int(s[:2])<=12:
    if 12>=int(s[2:])>=1:
        print("AMBIGUOUS")
    else:
        print("MMYY")
#!/usr/local/bin/python3
#coding:utf-8
#import numpy as np


def main():

   in0 = input()

   IN = in0.split(' ')

   N = int(IN[0])
   D = int(IN[1])

   X = np.zeros((N,D))
   
   for i in range(N):
      in0 = input()
      IN = in0.split(' ')
      for j in range(D):
         X[i,j] = int(IN[j])


   cnt = 0
   for i in range(N-1):
      for k in range(i+1,N):
      dis = 0
      for j in range(D):
         dis = dis + (X[i,j]-X[(k,j])**2

      dist = np.sqrt(dis)

      i_dist = int(dist)
      
      if((dist - i_dist)==0):
         cnt = cnt + 1


   print ("%s" % (cnt))




if __name__ == "__main__":
   main()

### FIXED CODE ###

#!/usr/local/bin/python3
#coding:utf-8
import numpy as np


def main():

   in0 = input()

   IN = in0.split(' ')

   N = int(IN[0])
   D = int(IN[1])

   X = np.zeros((N,D))

   for i in range(N):
      in0 = input()
      IN = in0.split(' ')
      for j in range(D):
         X[i,j] = int(IN[j])


   cnt = 0
   for i in range(N-1):
      for k in range(i+1,N):
         dis = 0
         for j in range(D):
            dis = dis + (X[i,j]-X[k,j])**2

         dist = np.sqrt(dis)

         i_dist = int(dist)

         if((dist - i_dist)==0):
            cnt = cnt + 1


   print ("%s" % (cnt))




if __name__ == "__main__":
   main()
N = int(input())
a = list(map(int,input().split()))

c = list()

for n in range(N):
    for i in range(1,31):
        if not a[n]%(2**i)==0:
            c.append(i-1)
            break
print(min(c))
        

### FIXED CODE ###

a = list(input())
print(int(a[0])+int(a[1])+int(a[2]))
N = int(input())
a = [int(i) for i input().split()]

ki = 0
gu_2 = 0
gu_4 = 0

for i in a:
    if i % 4 == 0:
        gu_4 += 1
    elif i % 2 == 0:
        gu_2 += 1
    else:
        ki += 1

if ki <= gu_4:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N = int(input())
T = list(map(int, input().split()))
ans = 0

for i in range(N):
    if T[i] % 4 == 0:
        ans += 1
    elif T[i] % 2 != 0:
        ans -= 1
    
if N % 2 != 0:
    ans += 1

print('Yes' if ans >= 0 else 'No')
n = 1
a = list(map, input().split())
sum = 0
for i in range(n):
  b = 1 / a[i]
  sum += b
ans = 1 / sum
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
aa = 0
for i in range(n):
  b = 1 / a[i]
  aa += b
ans = 1 / aa
print(ans)
N, K = map(int,input().split())

import math


def C(n,r):
    return math.factorial(n)//math.factorial(r)//math.factorial(n-r)

for i in range(K):
    print(int(C(N-K+1, i+1)*C(K-1, i)))

### FIXED CODE ###

N, B = map(int,input().split())
R = N-B
T = 1000000007

def generating_combination(n):
	T = 1000000007
	C = C = [[0 for i in range(n+1)] for j in range(n+1)]
	C[0][0] = 1
	C[1][0] = 1
	C[1][1] = 1
	for i in range(2,n+1):
		C[i][0] = 1
		C[i][i] = 1
		for j in range(1,i):
			C[i][j] = (C[i-1][j-1] + C[i-1][j])%T
	return(C)

D = generating_combination(2000)
for i in range(1,B+1):
	print((D[B-1][i-1]*D[R+1][i])%T)
from collections import deque
import heapq
N=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
if 0:
    import random
    N=2*10**5
    A=[random.randrange(1,N+1) for i in range(N)]
    B=[random.randrange(1,N+1) for i in range(N)]
    A.sort()
    B.sort()
a=[0 for i in range(N+1)]
b=[0 for i in range(N+1)]
for i in range(N):
    a[A[i]]+=1
    b[B[i]]+=1
if max([a[i]+b[i] for i in range(1,N+1)])>N:
    print("No")
    exit()
print("Yes")
ans=[0 for i in range(N)]
index=sorted([i for i in range(1,N+1)],key=lambda i:-a[i]-b[i])

q=[]
for i in index:
    if a[i]+b[i]==0:
        continue
    heapq.heappush(q,(-a[i]-b[i],-b[i],-i))
num=-1
#print(q,a)
while(len(q)>0):
    #print(ans,q)
    num+=1
    num%=N
    if q[0][1]==0:
        heapq.heappop(q)
        num-=1
        continue
    if ans[num]!=0:
        continue
    r0=heapq.heappop(q)
    if -r0[2]==A[num]:
        r1=heapq.heappop(q)
        ans[num]=-r1[2]
        if r1[1]<-1:
            heapq.heappush(q,(r1[0]+1,r1[1]+1,r1[2]))
        heapq.heappush(q,r0)
    else:
        ans[num]=-r0[2]
        if r0[1]<-1:
            heapq.heappush(q,(r0[0]+1,r0[1]+1,r0[2]))
print(*ans)

### FIXED CODE ###

import random
N=int(input())
A=[int(i) for i in input().split()]
B=[int(i) for i in input().split()]
a=[0 for i in range(N+1)]
b=[0 for i in range(N+1)]
for i in range(N):
    a[A[i]]+=1
    b[B[i]]+=1
if max([a[i]+b[i] for i in range(1,N+1)])<=N:
    print("Yes")
else:
    print("No")
    exit()
B=B[::-1]
point=0
for i in range(N):
    if A[i]==B[i]:
        point+=1
while(point>0):
    x=random.randrange(N)
    y=random.randrange(N)
    if x==y:
        continue
    before=0
    after=0
    if A[x]==B[x]:
        before+=1
    if A[y]==B[y]:
        before+=1
    if A[x]==B[y]:
        after+=1
    if A[y]==B[x]:
        after+=1
    if before>after:
        B[x],B[y]=B[y],B[x]
        point=point+after-before
print(*B)