Harryxun/stf_run huggingface dataset:
import sys

sys.setrecursionlimit(100000)

N = int(input())
Nodes = [{} for i in range(N)]


def search(index, dist):
    neighbors = Nodes[index]
    for key in neighbors:
        if distances[key] is not None:
            continue

        distances[key] = dist + neighbors[key]
        search(key, distances[key])


# 木を作る
for _ in range(N-1):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    Nodes[a][b] = c
    Nodes[b][a] = c

# 頂点Kから各点への距離を求める
Q, K = map(int, input().split())
distances = [None for i in range(N)]
distances[K-1] = 0
search(index=K-1, dist=0)

#print(distances)

# 解答
for _ in range(Q):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    print(distances[x] + distances[y])


### FIXED CODE ###

import sys

sys.setrecursionlimit(1000000)

N = int(input())
Nodes = [{} for i in range(N)]


def search(index, dist):
    neighbors = Nodes[index]
    for key in neighbors:
        if distances[key] is not None:
            continue

        distances[key] = dist + neighbors[key]
        search(key, distances[key])


# 木を作る
for _ in range(N-1):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    Nodes[a][b] = c
    Nodes[b][a] = c

# 頂点Kから各点への距離を求める
Q, K = map(int, input().split())
distances = [None for i in range(N)]
distances[K-1] = 0
search(index=K-1, dist=0)

#print(distances)

# 解答
for _ in range(Q):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    print(distances[x] + distances[y])
def dfs(v):
    path.append(v)
    visited[v] = 1
    nv = A[v]
    if visited[nv] == 1:
        return nv
    return dfs(nv)


N, K = map(int, input().split())
A = list(map(lambda x: int(x) - 1, input().split()))
visited = [-1] * N
path = []
cycle_start = dfs(0)
cycle_len = len(path) - path.index(cycle_start)
head_len = len(path) - cycle_len
if K <= head_len:
    print(path[K] + 1)
else:
    K -= head_len
    print(path[head_len + K % cycle_len] + 1)


### FIXED CODE ###

import sys


def input():
    return sys.stdin.readline().strip()


N, K = map(int, input().split())
A = [0] + list(map(int, input().split()))

pos = A[1]
path = [1]
visited = {1}
cycle_start = -1
for _ in range(N):
    if pos in visited:
        cycle_start = pos
        break
    visited.add(pos)
    path.append(pos)
    pos = A[pos]

if cycle_start > 0:
    cycle_start_idx = path.index(cycle_start)
    acyclic_path = path[:cycle_start_idx]
    cyclic_path = path[cycle_start_idx:]
    if K < len(acyclic_path):
        print(acyclic_path[K])
    else:
        print(cyclic_path[(K - len(acyclic_path)) % len(cyclic_path)])
else:
    print(path[K])
n = int(input())
k = int(input())
i=0
p = []
while i < n:
    p.append(int(input()))
    i += 1
#print(p)
#s=0
#l=0
#while l < k:
#    s += min(p)
#    p = p.remove(min(p))
#    l += 1
#print(s)
p.sort()
s= sum(p[:k])
print(s)

### FIXED CODE ###

n,k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
#print(p)
s= sum(p[:k])
print(s)
n = int(input())
b = list(map(int,input().split()))

a = [b.pop()]
for b_i in b[::-1]:
  a.append(min(a[-1],b_i))
a.append(b[0])
print(sum(a))

### FIXED CODE ###

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

a = [b[-1],b[0]]
for i in range(n-2):
  a.append(min(b[i],b[i+1]))

print(sum(a))
a,b,c=map(int,input().split())
if a+b<=a+c:
  print(min(a+b,b+c))
else:
  print(min((a+c,b+c))

### FIXED CODE ###

a,b,c=map(int,input().split())
if a+b<=a+c:
  print(min(a+b,b+c))
else:
  print(min(a+c,b+c))
N = int(input())

 
ansAC = 0
ansWA = 0
ansTLE = 0
ansRE = 0
 
for i in range(N):
  S = input()
  if S == "AC":
    ansAC += 1
  elif S == "TLE":
    ansTLE += 1
  elif S == "WA":
    ansWA += 1
  elif S == "RE":
    ansRE += 1
print("AC x " + ansAC)
print("WA x " + ansWA)
print("TLE x " + ansTLE)
print("RE x " + ansRE)

### FIXED CODE ###

N = int(input())
ansAC = 0
ansWA = 0
ansTLE = 0
ansRE = 0
 
for i in range(N):
  S = input()
  if S == "AC":
    ansAC += 1
  elif S == "TLE":
    ansTLE += 1
  elif S == "WA":
    ansWA += 1
  elif S == "RE":
    ansRE += 1
print("AC x " + str(ansAC))
print("WA x " + str(ansWA))
print("TLE x " + str(ansTLE))
print("RE x " + str(ansRE))
N = int(input())
A = (int(x) for x in input().split())
sum  = 1
for i in A:
    sum = sum * i
if(sum > (10**18)):
    print(-1)
else:
    print(sum)


### FIXED CODE ###

A,B=(int(x) for x in input().split())
print(A*B)
a = int,input()
print(a+(a*a)+(a*a*a))

### FIXED CODE ###

a = input()
b = int(a)
print(b+b**2+b**3)
a=[]
a1,a2,c = input().split()
a.append(int(a1))
a.append(int(a2))
c = int(c)
cur = 0
for i in range(c):
    a[1-cur]+=a[cur]//2
    a[cur]//=2
    cur=1-cur
print(a[0], a[1])


### FIXED CODE ###

s = input()
if(len(s)==2):
    print(s)
else:
    print(s[::-1])
s=list(input())
n=len(s)
mod=10**9 + 7
dp=[[0]*(n) for i in range(13)]

if s[n-1]=='?':
    for i in range(10):
        dp[0][i]+=1
else:
    dp[0][s[n-1]]+=1

for i in range(n-1):
    if s[n-2-i]=='?':
        for j in range(13):
            if dp[i][j]>0:
                for k in range(10):
                    dp[i+1][(j+(10**i)*k)%13]+=1
                    dp[i+1][(j+(10**i)*k)%13]%=mod
    else:
        for j in range(13):
            if dp[i][j]>0:
                dp[i+1][j+(10**i)*s[n-2-i]]+=1
                dp[i+1][j+(10**i)*s[n-2-i]]%=mod
print(dp[n-1][5]%mod)

### FIXED CODE ###

mod=10**9+7
r=[[(j-k)*9%13 for j in range(10)] for k in range(13)]
dp=[1]+[0]*12
for c in input():
  dp = [sum(dp[j] for j in k)%mod for k in r] if c>'9' else [dp[(int(c)-k)*9%13] for k in range(13)]
print(dp[5])
n,m = map(int, input().split())
aa = [0] * m
bb = [0] * m
cc = [0] * m
dd = [0] * m

for i in range(n):
    aa[i], bb[i] = map(int, input().split())
for i in range(m):
    cc[i], dd[i] = map(int, input().split())

distance = []
for i in range(n):
    d = []
    for j in range(m):
        d_ = abs(aa[i] - cc[j]) + abs(bb[i] - dd[j])
        d.append(d_)
    distance.append(d)
for d in distance:
    print(d.index(min(d))+1)

### FIXED CODE ###

n,m = map(int, input().split())
aa = [0] * n
bb = [0] * n
cc = [0] * m
dd = [0] * m

for i in range(n):
    aa[i], bb[i] = map(int, input().split())
for i in range(m):
    cc[i], dd[i] = map(int, input().split())

for i in range(n):
    d = [abs(aa[i] - cc[j]) + abs(bb[i] - dd[j]) for j in range(m)]
    print(d.index(min(d))+1)
n=int(input())
x_=input()
px=x_.count("1")
if not px:
    print(0)
    for i in range(n-1):
        print(1)
    exit()
if px==1:
    for i in range(n):
        if int(x_[-i-1]):
            print(0)
        else:
            if not i:
                print(2)
            else:
                print(1)
x=int(x_,2)

pow2=[1]

for i in range(n):
    tmp=pow2[-1]
    tmp*=2
    tmp%=px+1
    pow2.append(tmp)
pow22=[1]
for i in range(n):
    tmp=pow22[-1]
    tmp*=2
    tmp%=px-1
    pow22.append(tmp)
x1=x%(px+1)
x2=x%(px-1)
ans=[]
for i in range(n):
    tmp=0;dv=0
    if int(x_[-i-1]):
        tmp=x2-pow22[i]
        dv=px-1
    else:
        tmp=x1+pow2[i]
        dv=px+1
    if dv==0:
        ans.append(0)
        continue
    cnt=1
    while tmp:
        if not dv:
            break
        tmp%=dv
        dv=bin(tmp).count("1")
        if not tmp:
            break
        cnt+=1
    ans.append(cnt)
for i in ans[::-1]:
    print(i)

### FIXED CODE ###

n=int(input())
x_=input()
px=x_.count("1")
if not px:
    for i in range(n):
        print(1)
    exit()
if px==1:
####[上から] i 桁目
    for i in range(n):
        if int(x_[i]):
            print(0)
        else:
            if i==n-1 or int(x_[-1])==1:###
                print(2)
            else:
                print(1)
    exit()
x=int(x_,2)

pow2=[1]

for i in range(n):
    tmp=pow2[-1]
    tmp*=2
    tmp%=px+1
    pow2.append(tmp)
pow22=[1]
for i in range(n):
    tmp=pow22[-1]
    tmp*=2
    tmp%=px-1
    pow22.append(tmp)
x1=x%(px+1)
x2=x%(px-1)
ans=[]
for i in range(n):
    tmp=0;dv=0
    if int(x_[-i-1]):
        tmp=x2-pow22[i]
        tmp%=(px-1)
        dv=px-1
    else:
        tmp=x1+pow2[i]
        tmp%=(px+1)
        dv=px+1
    
    cnt=1
    while tmp:
        
        dv=bin(tmp).count("1")
        if not dv or not tmp:
            break
        
        tmp%=dv
        cnt+=1
    ans.append(cnt)
for i in ans[::-1]:
    print(i)
import numpy as np
n, m = map(int, input().split())
stairs = set([int(input()) for i in range(m)])
ans = np.ones(n+1)
mod = 10**9 + 7
if 1 in stairs:
    ans[1] -= 1
for i in range(2, n+1):
    if i in stairs:
        ans[i] = 0
    else:
        ans[i] = ans[i-1] + ans[i-2]

print(int(ans[-1] % mod))


### FIXED CODE ###

import numpy as np
n, m = map(int, input().split())
stairs = set([int(input()) for i in range(m)])
ans = [1] * (n+1)
mod = 10**9 + 7
if 1 in stairs:
    ans[1] -= 1
for i in range(2, n+1):
    if i in stairs:
        ans[i] = 0
    else:
        ans[i] = ans[i-1] + ans[i-2]

print(ans[-1]%mod)
N=int(input())
v=list(map(int,input().split()))
s=0
v.sort()
if len(v)=1:
  print(v[0])
elif len(v)=2:
  print(sum(v)/2)
else:
  s+=(v[0]+[1])/(2**N-1)
  for j in range(2,N):
    s+=v[j]/(2**N-j)
print(s)


### FIXED CODE ###

N=int(input())
v=list(map(int,input().split()))
v.sort()
s=v[0]
for j in range(1,N):
    s=(s+v[j])/2
print(s)
a,b,c=input().split()
if a==b and a==c:
  print(No)
else:
  print(Yes)

### FIXED CODE ###

a=input()
if a[0]==a[1] and a[0]==a[2]:
  print("No")
else:
  print("Yes")
#D
import heapq

n,m = map(int,input().split())
a = list(map(int,input().split()))
heapq.heapify(a)
tmp = 0
for i in range(m):
    b,c = map(int,input().split())
    for j in range(b):
        if c >= tmp
            p = heapq.heappop(a)
            if c > p:
                heapq.heappush(a,c)
            else:
                heapq.heappush(a,p)
                tmp = p
                break
            
        tmp = p
            
print(sum(a))

### FIXED CODE ###

#D
import heapq

n,m = map(int,input().split())
a = list(map(int,input().split()))
bc = []
for i in range(m):
    b,c = map(int,input().split())
    bc.append((b,c))
bc.sort(key=lambda x:-x[1])
heapq.heapify(a)
for i in range(m):
    b,c = bc[i][0],bc[i][1]
    for j in range(b):
        p = heapq.heappop(a)
        if c > p:
            heapq.heappush(a,c)
        else:
            heapq.heappush(a,p)
            break
            
            
print(sum(a))
n, m = map(int, input().split())
num_list = ['X'] * n

def ans():
    for i in range(m):
        set = list(map(str, input().split()))
        if set[0] == '1' and set[1] == '0':
            return -1
        else:
            if num_list[int(set[0]) - 1] == 'X':
                num_list[int(set[0]) - 1] = set[1]
            elif num_list[int(set[0]) - 1] == set[1]:
                continue
            else:
                return -1


    if num_list[0] == 'X':
        num_list[0] = '1';

    for i in range(1, m):
        if num_list[i] == 'X':
            num_list[i] = '0'

    return ''.join(num_list)

print(ans())


### FIXED CODE ###

n, m = map(int, input().split())
num_list = ['X'] * n

def ans():
    if n == 1 and m == 0:
        return 0
    for i in range(m):
        set = list(map(str, input().split()))
        if set[0] == '1' and set[1] == '0' and n != 1:
            return -1
        else:
            if num_list[int(set[0]) - 1] == 'X':
                num_list[int(set[0]) - 1] = set[1]
            elif num_list[int(set[0]) - 1] == set[1]:
                continue
            else:
                return -1


    if num_list[0] == 'X':
        num_list[0] = '1'

    for i in range(1, n):
        if num_list[i] == 'X':
            num_list[i] = '0'

    return ''.join(num_list)

print(ans())
def trace(A,input_num):
    if i != input_num - 1:   
        for i in range(input_num):
            print(A[i],end = " ")
    else:
        print(A[i])
        
    print("\n")

def insertionSort(A,input_num):
    for i in range(input_num):
        v = A[i]
        j = i - 1
        while(j >= 0 and A[j] > v):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        trace(A,input_num)
        
        
input_num = int(input())
A = list(map(int, input().split()))

trace(A,input_num)



### FIXED CODE ###

def insertionSort(A,input_num):
    for i in range(input_num):
        v = A[i]
        j = i - 1
        while(j >= 0 and A[j] > v):
            A[j + 1] = A[j]
            j -= 1
        A[j + 1] = v
        print(*A)
        
input_num = int(input())
A = list(map(int, input().split()))

insertionSort(A,input_num)
N,K,Q = map(int,input().split())
a=[]
for i in range(Q):
  a.append(int(input()))
for i in range(N):
  if 0<K-Q+a.count(i+1):
	print("Yes")
  else:
	print("No")

### FIXED CODE ###

N,K,Q = map(int,input().split())
a = [0 for i in range(N)]
for i in range(Q):
  a[int(input())-1]+=1
for i in a:
  if K-Q+i>0:
    print("Yes")
  else:
    print("No")
print(input().replace('FESTIVAL','')

### FIXED CODE ###

print(input()[:-8])
a,b,c,d = map(int,input().split())
print(min(a,b)+min(c,d))

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())

print(min(a,b)+min(c,d))
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [int(10000000000)]*100000
dp[0] = 0
cost = 0
for i in range(0, n):
  for j in range(1, k+1):
    if dp[i] > dp[i-j]+abs(h[i]-h[i-j]):
      dp[i] = dp[i-j]+abs(h[i]-h[i-j])
print(dp[n-1])

### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [int(10000000000)]*100000
dp[0] = 0
cost = 0
if k > len(h):
  k = len(h)
for i in range(0, n):
  for j in range(1, k+1):
    if dp[i] > dp[i-j]+abs(h[i]-h[i-j]):
      dp[i] = dp[i-j]+abs(h[i]-h[i-j])
print(dp[n-1])
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(min(K, N)*X + max(0, N-K)*Y

### FIXED CODE ###

N = int(input())
K = int(input())
X = int(input())
Y = int(input())
print(min(K, N)*X + max(0, N-K)*Y)
from math import gcd

mod = 10**9 +7
N = int(input())
dic = {}

zero = 0
for _ in range(N):
    a,b = map(int, input().split())
    if  a ==0 and b == 0:
        zero += 1
        continue
    elif a == 0:
        key = (0,1)
    elif b == 0:
        key = (1,0)
    else:
        if a<0:
            a=-a 
            b=-b
        g = gcd(a,abs(b))
        key = (a//g,b//g)
    
    if key not in dic:
        dic[key]=0

    dic[key] +=1

ans = 1
for k1, v1 in dic.items():
    if v1 ==0:
        continue

    if k1[1] >0:
        k2 = (k1[1],-k1[0])
    else:
        k2 = (-k1[1],k1[0])

    if k2 not in dic:
        ans *= 2**v1
        ans %= mod
    else:
        ans *= ((2**v1-1)) %mod) + ((2**dic[k2]-1)) %mod) +1
        ans %= mod
        dic[k2]=0

ans = (ans + zero -1 )%mod
print(ans)

### FIXED CODE ###

from math import gcd

mod = 10**9 +7
N = int(input())
dic = {}

zero = 0
for _ in range(N):
    a,b = map(int, input().split())
    if  a ==0 and b == 0:
        zero += 1
        continue
    elif a == 0:
        key = (0,1)
    elif b == 0:
        key = (1,0)
    else:
        if a<0:
            a=-a 
            b=-b
        g = gcd(a,abs(b))
        key = (a//g,b//g)
    
    if key not in dic:
        dic[key]=0

    dic[key] +=1

ans = 1
for k1, v1 in dic.items():
    if v1 ==0:
        continue

    if k1[1] >0:
        k2 = (k1[1],-k1[0])
    else:
        k2 = (-k1[1],k1[0])

    if k2 not in dic:
        ans *= 2**v1
        ans %= mod
    else:
        ans *= ((2**v1-1) %mod) + ((2**dic[k2]-1) %mod) +1
        ans %= mod
        dic[k2]=0

ans = (ans + zero -1 )%mod
print(ans)
x=int(input())
print("Yes" if x%sum(list(str(x)))==0 else "No")

### FIXED CODE ###

x=int(input())
print("Yes" if x%sum(map(int,str(x)))==0 else "No")
import sys
import math
from fractions import gcd

a,b,c,d = (int(i) for i in input().split())

c1 = b // c - (a - 1) // c
d1 = b // d - (a - 1) // d
cd = (c * d) //math.gcd(c,d)
cd1 = b // cd - (a - 1) // cd



print((b - a + 1) - c1 - d1 + cd1)

### FIXED CODE ###

import sys
import math
from fractions import gcd

a,b,c,d = (int(i) for i in input().split())

c1 = b // c - (a - 1) // c
d1 = b // d - (a - 1) // d
cd = (c * d) //gcd(c,d)
cd1 = b // cd - (a - 1) // cd



print((b - a + 1) - c1 - d1 + cd1)
str = list(input())
nn = len(str)
ss = [1] * nn

mm = pow(10, 2)
for i in range(1, mm):
  for j in range(1, nn):
    if ss[j-1] != 0:
      if str[j-1] == 'L':
        ss[j-1] = ss[j-1] - 1
        ss[j-2] = ss[j-2] + 1
      else:
        ss[j-1] = ss[j-1] - 1
        ss[j] = ss[j] + 1

kk = ' '.join(ss)
  
print(kk)

### FIXED CODE ###

n = int(input())
i = list(map(int, input().split()))

f = 1
for k in range(1, n):
  if f == 0:
    continue
  
  if k == 0:
    continue
  
  if i[k-1] < i[k]:
    i[k] = i[k] - 1
  elif i[k-1] == i[k]:
    i[k] = i[k]
  else:
    f = 0
      
if f == 0:
  print('No')
else:
  print('Yes')
num = input()
s = input()
res = ""
for x in s:
    loc = ord(x) + num
    res += chr(loc - 26 if loc > 90 else loc)
print(res)

### FIXED CODE ###

num = int(input())
s = input()
res = ""
for x in s:
    loc = ord(x) + num
    res += chr(loc - 26 if loc > 90 else loc)
print(res)
import math

x1, y1, x2, y2 = map(int, input().split())
distance = math.sqrt((x2-x1)**2 + (y2-y1)**2)
print(distance)

### FIXED CODE ###

import math

x1, y1, x2, y2 = map(float, input().split())
distance = math.sqrt((x2-x1)**2 + (y2-y1)**2)
print(distance)
N = int(input())
mark = 0

for i in range(1 , 10):
  for j in range(1 , 10):
    if(i * j == N):
      mark = 1
      break
      
if mark = 1:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N = int(input())
mark = 0

for i in range(1 , 10):
  for j in range(1 , 10):
    if(i * j == N):
      mark = 1
      break
      
if mark == 1:
  print("Yes")
else:
  print("No")
f = True
cnt = 0
l = [0,0,0]
while f:
    t = []
    t.append(int(input()))
    t.append(int(input()))
    t.append(int(input()))
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        continue
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),[s for s in l])
    


### FIXED CODE ###

f = True
cnt = 0
l = [0,0,0]
while f:
    t = [int(s) for s in input().split()]
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        break
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),l[1],l[0],l[2])
n = input()
counter = 0
s = "TEMP"
temp = "TEMP"

while n > 0:
  s = input()
  if temp != s:
    counter = counter + 1
  temp = s
  n = n - 1

print(counter)

### FIXED CODE ###

n = int(input())
counter = 0
s = "TEMP"
list = []
temp = ''

while n > 0:
  s = input()
  list.append(s)
  n = n - 1

list.sort()
for item in list:
  if item == temp:
    counter = counter - 1
  counter = counter + 1
  temp = item

print(counter)
from sys import stdin
import numpy as np

def bit_search(a, n, m, x):
    min_price = np.inf
    for i in range(2 ** n):
        price = 0
        skill = np.zeros((n, m))
        for j in range(n):
            if (i >> j) & 1:
                price += a[j][0]
                skill[j] = a[j][1:]
        skill_sum = np.sum(skill, axis=0)\
                        if skill.shape[0] > 1 else np_skill
        if (skill_sum >= x).all() and price < min_price:
            min_price = price
    return min_price

def main():
    readline = stdin.readline
    n, m, x = map(int, readline().split())
    a = [list(map(int, readline().split())) for _ in range(n)]
    min_price = bit_search(a, n, m, x)
    return print('-1' if np.isinf(min_price) else min_price)

if __name__ == '__main__':
    main()


### FIXED CODE ###

from sys import stdin
import numpy as np

def main():
    readline = stdin.readline
    n, m, x = map(int, readline().split())
    a = [list(map(int, readline().split())) for _ in range(n)]
    res = []
    for i in range(2 ** n):
        price = 0
        skill = []

        for j in range(n):
            if ((i >> j) & 1):
                price += a[j][0]
                skill.append(a[j][1:])
        np_skill = np.array(skill)
        skill_sum = np.sum(np_skill, axis=0)\
                        if np_skill.shape[0] > 1 else np_skill

        if skill_sum.size != 0 and (skill_sum >= x).all():
            res.append(price)

    if not res: return print('-1')

    return print(min(res))

if __name__ == '__main__':
    main()
# ABC144d


def main():
    import sys
    import math
    import numpy as np
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)

    a, b, x = map(int, input().split())
    if x > a*a*b/2:
        # print(np.rad2deg(np.arctan(2*(a*a*b-x)/(a*a*a))))
        print(math.degrees(math.atan(2*(a*a*b-x)/(a*a*a))))
        exit(0)
    print(math.degrees(math.atan(a*b*b/2/x)))
    # print(np.rad2deg(np.arctan(a*b*b/2/x)))


if __name__ == '__main__':
    main()

### FIXED CODE ###

# ABC144d


def main():
    import sys
    import math
    import numpy as np
    input = sys.stdin.readline
    sys.setrecursionlimit(10**6)

    a, b, x = map(int, input().split())
    if x > a*a*b/2:
        print(np.rad2deg(np.arctan(2*(a*a*b-x)/(a*a*a))))
        # print(math.degrees(math.atan(2*(a*a*b-x)/(a*a*a))))
        exit(0)
    # print(math.degrees(math.atan(a*b*b/2/x)))
    print(np.rad2deg(np.arctan(a*b*b/2/x)))


if __name__ == '__main__':
    main()
import numpy as np
N, M = map(int,input().split())
P = list(map(int,input().split()))
P.sort()
Q = [0] + P[:len(P)-1]
P = np.array(P)
Q = np.array(Q)
R = P-Q
R[0] = 0
for i in range(1,N):
    index = np.argmax(R)
    R[index] = 0
print(sum(R))

### FIXED CODE ###

T, X = map(int, input().split())
print(T/X)
N = int (input ())
M = int (input ())

if N == M :
    print ("Yes")
else :
    print ("No")

### FIXED CODE ###

S = input()
S = S.split(" ")
N = S[0]
M = S[1]

if N == M :
    print ("Yes")
else :
    print ("No")
l, r = [int(i) for i in input().split()]

if r - l + 1 >= 2019:
    print(0)
else:
    ans = 2018
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            ans = min(ans, (i*j)%2019)
print(ans)

### FIXED CODE ###

l, r = [int(i) for i in input().split()]

if r - l + 1 >= 2019:
    print(0)
else:
    ans = 2018
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            ans = min(ans, (i*j) % 2019)
    print(ans)
# input
N, M = map(int, input().split())
check = []
c_append = check.append
for i in range(1, M + 1):
    L, R = map(int, input().split())
    c_append(set(list(range(L, R + 1))))

# check
mastar_keys = set(list(range(1, N + 1)))
for k in sorted(check, key=lambda x: len(x)):
    mastar_keys = mastar_keys & check[k]
    if len(mastar_keys) == 0:
        break

print(len(mastar_keys))

### FIXED CODE ###

# input & check
N, M = map(int, input().split())
x, y = 0, N
for i in range(1, M + 1):
    L, R = map(int, input().split())
    x = max(x, L)
    y = min(y, R)

print(len(range(x, y + 1)))
list=[1, 1, 1, 1, 1]
for i in range(1, 7):
  list.append(6**i)
for j in range(1, 7):
  list.append(9**i)
sort(list, reverse=True)
N=int(input())
count=0
for i in range(19):
  if N <= i:
    N=N-i
    count=+1
      if N==0:
        print(count)

### FIXED CODE ###

N=int(input())

A=[1]

i = 1
while True:
    if 6**i <= 100000:
        A.append(6**i)
    else:
        break
    i += 1

i = 1
while True:
    if 9**i <= 100000:
        A.append(9**i)
    else:
        break
    i += 1

A.sort()

dp = [N]*(N+1)
dp[0] = 0
for i in range(1, N+1):
    for j in range(len(A)):
        if i - A[j] >= 0:
            dp[i] = min(1+dp[i-A[j]], dp[i])

print(dp[-1])
a=list(map(int,input().split()))
b=sorted(a)
if b.count(0)==n:
    print("Yes")
elif n%3==0:
    if b.count(0)==n//3 and b.count(b[n-1])==n-(n//3):
        print("Yes")
    elif b[0]^b[n//3]^b[n-1]==0 and b.count(b[0])==n//3 and b.count(b[n//3])==n//3 and b.count(b[n-1])==n//3:
        print("Yes")
    else:
        print("No")
else:
    print("No")

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=a[1]
for i in range(2,n):
    b = b^(a[i])

if b==a[0]:
    print("Yes")
else:
    print("No")