peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
a = [0] + list(map(int, input().split()))

m = 0
b = [0] * (n + 1)

for i in reversed(range(1, n+1)):
    cnt = 0
    for j in range(i, n+1, i):
        cnt += b[j]
    if cnt % 2 != a[i]:
        b[i] = 1
        m += 1

print(m)
if m > 0:
    print(*[i for i, j in enumerate(b) if j == 1], sep=' ')
# Judge status: Accepted
S = input()
if S.count("5") == 2 and S.count("7") == 1 :
  print("YES")
else :
  print("NO")
# Judge status: Wrong Answer
a,b,c,k = map(int, input().split())

ans = a - b

if(k % 2 == 1):
    ans = abs(ans)

if(len(str(ans)) >= 19):
    ans = 'Unfair'

print(ans)
# Judge status: Wrong Answer
L,R=[int(x) for x in input().strip().split()]

ans=10**9+1
for i in range(L,R+1,1):
  if i%2019==0:
    break
  for j in range(L,R+1,1):
    if j%2019==0:
      break

    if i<j:
      ans=min((i*j)%2019,ans)
print(ans)
# Judge status: Accepted
import math

K=int(input())
s=0
for a in range(1,K+1):
	for b in range(1,K+1):
		s1=math.gcd(a,b)
		for c in range(1,K+1):
			s=s+math.gcd(s1,c)
print(int(s))
# Judge status: Accepted
import math
n = int(input())
mid = int(math.sqrt(n))

while mid >=1:
    if n % mid == 0:
        print(mid + n//mid -2)
        break
    mid -= 1
# Judge status: Wrong Answer
n = int(input())
power = 1

for i in range(1, n+1):
    power *= i
print(power%10**9)
# Judge status: Wrong Answer
N,M=map(int,input().split())
*A,=map(int,input().split())
A=sorted(A)[::-1]

i=0
while M:
    A[i]//=2
    M-=1
    if A[i]<A[min(i+M,N-1)] or i==N-1:
        i+=1
    if i==N:
        A=sorted(A)[::-1]
        i=0

print(sum(A))
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split())) 
A =[None] * N
A[0] = B[0]

for i in range(1,N-1):
    A[i] = min(B[i-1],B[i])
    i += 1

A[-1] = B[-1]

print(sum(A))
# Judge status: Wrong Answer
N = int(input())
D = list(map(int, input().split()))
M = 998244353
from collections import Counter

if D[0] != 0:
    print(0)
    exit(0)

cd = Counter(D)
if cd[0] != 1:
    print(0)
    exit(0)

tmp = sorted(cd.items(), key=lambda x: x[0])

ans = 1
for kx in range(2, len(tmp)):
    __, p = tmp[kx-1]
    _, v = tmp[kx]
    while v > 0:
        ans *= p
        ans %= M
        v -= 1


print(ans)
# Judge status: Accepted
S = input()
f=0
for i in range(len(S)):
    if i%2==0 and S[i]=="L":
        print("No")
        f+=1
        break
    if i%2==1 and S[i]=="R":
        print("No")
        f+=1
        break
if f==0:
    print("Yes")
# Judge status: Wrong Answer
S = input('曜日を入力してね！ ')

if S == 'SUN':
    print('7')

elif S == 'MON':
    print('6')

elif S == 'TUE':
    print('5')

elif S == 'WED':
    print('4')

elif S == 'THU':
    print('3')

elif S == 'FRI':
    print('2')

elif S == 'SAT':
    print('1')
# Judge status: Wrong Answer
S = list(input())
N = len(S)

l = [0] * 2019
temp = 0
e = 1
for i in range(N-1, -1, -1):
    temp += int(S[i]) * e
    temp %= 2019
    l[temp] += 1
    e *= 10
    e %= 2019

ans = l[0]

for i in range(1, 2019):
    ans += l[i] * (l[i]-1) // 2

print(ans)
# Judge status: Accepted
import sys

n = int(input())
a = [int(input()) for i in range(n)]
a = [i for i in a]


switch = 1

c = 0
while True:
    switch = a[switch-1]
    c += 1
    if switch == 2:
        break
    
    if c > 10**6:
        print(-1)
        sys.exit()
        break

print(c)
# Judge status: Accepted
#!/usr/bin/env python3

def main():
    *AB, = map(int, open(0).read().split())
    I = [1, 2, 3]
    C = set(I) - set(AB)
    print(list(C)[0])


main()
# Judge status: Accepted
a,b,c,d = map(int,input().split())

print(max(0,min(b,d)-max(a,c)))
# Judge status: Wrong Answer
N = int(input())
cnt_max = 0
ans = 1

for i in range(1, N):
    cnt = 0
    num = i
    while True:
        if num % 2 == 0:
            cnt += 1
            num /= 2
        else:
            break
    if cnt_max < cnt:
        cnt_max = cnt
        ans = i

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())

red = [False] * n
ball = [1] * n

red[0] = True
for _ in range(m):
    x, y = map(lambda x: int(x) - 1, input().split())
    if red[x]:
        red[y] = True
        if ball[x] == 1:
            red[x] = False
    ball[y] += 1
    ball[x] -= 1
print(len(list(filter(lambda x: x, red))))
# Judge status: Accepted
def main():
    s = input()

    sLen = len(s)

    s = 'x' * sLen

    print(s)
    
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n, k = map(int, input().split())
s = list(input())
count = 0
for i in range(n-1):
    if s[i] == s[i+1]:
        count += 1
count += k*2
if count > n:
    print(n)
else:
    print(count)
# Judge status: Accepted
from sys import exit
s=input()
for i in range(len(s)-1):
	if s[i]==s[i+1]:
		print("Bad")
		exit()
print("Good")
# Judge status: Accepted
from sys import stdin

n = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]

ans = [0] * n

for i, a in enumerate(A):
    ans[a-1] = i+1

print(' '.join(map(str, ans)))
# Judge status: Wrong Answer
N = int(input())
*p, = map(int, input().split())

v = sum(1 for i,j in zip(range(1, N+1), p) if i!=j)
print("Yes" if v<=2 else "No")
# Judge status: Accepted
x, a, b =map(int, input().split())

if abs(x-a) > abs(x-b):
    print("B")
else:
    print("A")
# Judge status: Accepted
from math import gcd
k=int(input())
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        ans_=gcd(i,j)
        for l in range(1,k+1):
            ans+=gcd(ans_,l)
print(ans)
# Judge status: Accepted
print('No' if input().replace('hi','') != '' else 'Yes')
# Judge status: Accepted
N, M = map(int, input().split())
a = [0] * M
for i in range(M):
    a[i] = int(input())
a.append(N+1)
mod = 1000000007

dp = [0] * (N + 1)
dp[0] = 1
if a[0] == 1:
    a.pop(0)
else:
    dp[1] = 1

for i in range(2, N + 1):
    if a[0] == i:
        dp[i] = 0
        a.pop(0)
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod

print(dp[N])
# Judge status: Accepted
h,n,*t = map(int,open(0).read().split())

dp = [0] + [10**8]* h

for a,b in  zip(*[iter(t)]*2):
    for life_point in range(h +1):
        
        original_life = max(0,life_point - a)
#         print(original_life)
        magic_consum = dp[original_life]+ b
#         print(magic_consum)
        dp[life_point] = min(dp[life_point],magic_consum)
#         print(dp)
print(dp[h])
# Judge status: Wrong Answer
n = int(input())
p = [int(i) for i in input().split()]
count = 0
for i in range(len(p)):
    if i != p[i]:
        count += 1
if count <= 2:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
data = input().split()
 
a = int(data[0])
b = int(data[1])
c = int(data[2])
 
if a == b != c or b == c != a or a == c != b:
  ans = "Yes"
else:
  ans = "no"
  
print(ans)
# Judge status: Wrong Answer
import math
a = int(input())
mx = 0

for i in range(2,a):
    j=2
    while i**j <a:
        print(i,j)
        mx = max(i**j,mx)
        j+=1

print(mx)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    if a[i] %2 ==0:
        if a[i] % 3 == 0:
            continue
        elif a[i] % 5== 0:
            continue
        else :
            print("DENIED")
            exit()
print("APPROVED")
# Judge status: Accepted
n = int(input())
A = []
B = []
for i in range(n):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

ans = 0
for i in range(n)[-1::-1]:
    val = B[i] - (A[i] + ans)%B[i]
    if val == B[i]:
        continue
    ans += val
    
print(ans)
# Judge status: Wrong Answer
s=input()
t=input()
result='No'
for i in range(len(s)-1):
  s=s[-1]+s[:len(s)-1]
  if s==t:
    result='Yes'
print(result)
# Judge status: Accepted
a,b = map(int,input().split())
print(a if a <= b else a-1)
# Judge status: Accepted
N=int(input())
def prime_factorization(n):
    p={}
    for i in range(2,int(n**.5)+1):
        x=0
        while n%i==0:
            n//=i
            x+=1
        if x:
            p[i]=x
    if n>1:
        p[n]=1
    return p
p=prime_factorization(N)
x=0
for v in p.values():
    y=0
    while y<v:
        x+=1
        y+=1
        v-=y
print(x)
# Judge status: Accepted
s=input()
t=input()
if s[0]==t[2]and s[1]==t[1] and s[2]==t[0]:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
S = input()

s = set()
for i in range(len(S)):
    s.add(S[i])

if len(S) == len(s):
    print("yes")
else:
    print("no")
# Judge status: Accepted
N = int(input())
if N % 2 == 0:
    N /=2
    print(int(N))
else:
    N /=2
    N+=1
    N = int(N)
    print(N)
# Judge status: Accepted
N = int(input())

vac = []
for i in range(N):
    vac.append(list(map(int, input().split())))
    
DP = [[0 for _ in range(3)] for _ in range(N+1)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if(j == k):
                continue
            DP[i+1][k] = max(DP[i+1][k], DP[i][j]+vac[i][k])
ans = 0
for i in DP[N]:
    ans = max(ans, i)
print(ans)
# Judge status: Wrong Answer
n = input()
a = set(map(int, input().split()))

if len(a) == n:
  print('Yes')

else:
  print('No')
# Judge status: Accepted
S = input()
for i in range(0, len(S)):
    if (i % 2 == 0 and S[i] != 'R' and S[i] != 'U' and S[i] != 'D') or \
     (i % 2 == 1 and S[i] != 'L' and S[i] != 'U' and S[i] != 'D'):
        print('No')
        exit(0)
print('Yes')
# Judge status: Wrong Answer
n,a,b = map(int, input().split())
total = 0
for i in range(1,n+1):
  array = list(map(int,str(i)))
  if a< sum(array) and sum(array)<b :
    total += i
print(total)
# Judge status: Accepted
N, x = list(map(int,input().split()))
a = list(map(int,input().split()))
result = 0

for i in range(N-1):
  n = a[i] + a[i+1] - x
  if n > 0:
    result += n
    a[i+1] -= n
    if a[i+1] < 0:
      a[i+1] = 0

print(result)
# Judge status: Wrong Answer
s=input()
if len(s)<=2:
    print(len(set(list(s))));exit()
dp=[0]*(len(s)+ 1)
dp[0]=1
dp[1]=1
dp[2]=(len(set(list(s[:2]))))

for i in range(3,1+len(s)):
    dp[i]=(dp[i-1]+1) if s[i-1]!=s[i-2]else (dp[i-3]+2)
print(dp[-1])
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(n):
    for j in range(i,n):
        for k in range(j,n):
            if l[i]!=l[j] and l[j]!=l[k]:  
                if l[i]+l[j]>l[k]:
                    ans+=1
print(ans)
# Judge status: Accepted
a, b = map(int, input().split())
if (a+b) % 2 == 0:
    print((a+b) // 2)
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
S,T=input().split()
A,B = map(int,input().split())
U = input()
ans = ""
if U==S:
    A=A-1
    a=str(A)
    b=str(B)
    ans = a+" "+b
    print(ans)
else:
    B-=1
    a=str(A)
    b=str(B)
    ans=a+" "+b
    print(ans)
# Judge status: Accepted
import collections
N = int(input())
S = input()

table = collections.defaultdict(int)
for i in range(N):
    table[S[i]] += 1
ans = 1
mod = 10**9 + 7
alpha = 'abcdefghijklmnopqrstuvwxyz'
for x in alpha:
    ans *= table[x] + 1
    ans %= mod

print((ans-1) % mod)
# Judge status: Wrong Answer
n,k = map(int, input().split())
H = list(map(int, input().split()))
sum = 0
l = n-k
sorted(H)
if k >= n : print(0)
else:
    for i in range(l):
        sum += H[i]
    print(sum)
# Judge status: Accepted
n, a, b = map(int, input().split())
mod = 10**9 + 7
def comb(n,k):
    if n<k:
        return 0
    if n<0 or k<0:
        return 0
    k=min(n-k,k)
    ans=1
    inv=[1]*(k+1)
    if k>=1:
        ans*=(n-k+1)%mod
    for i in range(2,k+1):
        inv[i]=mod-inv[mod%i]*(mod//i)%mod
        ans=ans*(n-k+i)*inv[i]%mod
    return ans
c = comb(n, a)
d = comb(n, b)
answer = pow(2, n, mod) - 1
print((answer-c-d)%mod)
# Judge status: Accepted
A,B= map(int,input().split())

ans=0

for i in range(A,B+1):
    for j in range(len(str(i))):
        zen = j
        kou = len(str(i))-1-j
        if zen >= kou:
            ans+=1
            break
        if str(i)[zen] != str(i)[kou]:
            break
    
print(ans)
# Judge status: Accepted
x = int(input())

if x==0:
    print(1)
else:
    print(0)
# Judge status: Accepted
n = int(input())
d = [int(c) for c in input().split()]
e = sorted(d)
mid = n//2
print(e[mid]-e[mid-1])
# Judge status: Accepted
k,x = [int(x) for x in input().split()]
a = x-k+1
b = x+k-1
for i in range(a,b+1):
    print(i,end=" ")
# Judge status: Wrong Answer
from collections import Counter

N = int(input())
S = input()
dum = []
mmm = []
d = 0
while 3 + d*2 < N:
    for i in range(N - 2*(d+1)):
        dum.append([S[i], S[i+d+1], S[i+2*(d+1)]])
        mmm.append([i, i+d+1, i+2*(d+1)])
    d += 1
dum_n = len([x for x in dum if len(set(x)) == 3])

RGB_Counter = Counter(S)
print(RGB_Counter['R'] * RGB_Counter['G'] * RGB_Counter['B'] -dum_n)
# Judge status: Accepted
N = input()
dp = [[0]*2 for _ in range(1001000)]
dp[0][1] = 1
for i in range(len(N)):
    d = int(N[i])
    dp[i+1][0] = min(dp[i][0] + d, dp[i][1] + 10-d)
    dp[i+1][1] = min(dp[i][0] + d + 1, dp[i][1] + 10-d-1)  # もらいすぎている状態を維持する
ans = dp[len(N)][0]
print(ans)
# Judge status: Accepted
a , b , c = map(int,input().split())
if b - a == c - b:
  print("YES")
else: 
  print("NO")
# Judge status: Accepted
# https://atcoder.jp/contests/abc053/tasks/abc053_b
s = input()
a_index = s.find("A")
z_index = s.rfind("Z")
print(z_index - a_index + 1)
# Judge status: Accepted
data = list(input())
count = 0
for i in range(1, len(data)):
  if data[i] == data[i-1]:
    if data[i] == "0":
      data[i] = "1"
    else:
      data[i] = "0"
    count += 1
print(count)
# Judge status: Accepted
n=int(input())
li = list(map(int,input().split()))

now=li[0]
sum=0
for i in li[1:]:
  if now>i:
    sum+=now-i
  elif i>now:
    now=i

print(sum)
# Judge status: Accepted
n = int(input())
i = 1
while i * i <= n:
    i += 1
print((i - 1) * (i - 1))
# Judge status: Accepted
x = int(input())

if x == 3 or x == 5 or x == 7:
  print("YES")
else:
  print("NO")
# Judge status: Wrong Answer
n=int(input())
def make_divisors(n):
	lower_divisors , upper_divisors = [], []
	i = 1
	while i*i <= n:
		if n % i == 0:
			lower_divisors.append(i)
			if i != n // i:
				upper_divisors.append(n//i)
		i += 1
	return lower_divisors + upper_divisors[::-1]
l=make_divisors(n)
if len(l)%2==0:
	print((l[len(l)//2]+l[(len(l)//2)-1])-2)
elif len(l)%2==1:
	print((l[len(l)//2-1]+l[(len(l)//2)+1])-2)
# Judge status: Wrong Answer
x,a,b=map(int, input().split())
date=b-a
if date<0:
  print("delicious")
elif date<=x:
  print("safe")
else:
  print("dangerous")
# Judge status: Accepted
import fractions
import sys
A,B=map(int,input().split())

for i in range(1,1009):
    if(int(i*0.08) == A and int(i*0.1)==B):
        print(i)
        sys.exit()
print(-1)
# Judge status: Accepted

n=int(input())
l=list(map(int , input().split()))
#尺取り法
l.sort()
s=0
for i in range(n):
  if i+2<n:
    k=i+2
  else:
    break
  for j in range(i+1,n):
    while (k<n and l[k]<l[i]+l[j]):
      k+=1
    s+=k-(j+1)
print(s)
# Judge status: Accepted
n = int(input())
l =[[' ', 0, -1] for i in range(n)]
for i in range(n):
    l[i][0], p = input().split()
    l[i][1] = -int(p)
    l[i][2] = i+1

l_ = sorted(l)
for i in range(n):
    print(l_[i][2])
# Judge status: Accepted
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = input()
    ans = 1000
    for i in range(len(S) - 2):
        s = int(S[i:i + 3])
        ans = min(ans, (abs(s - 753)))
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
a = input().split()
x = 0
for i in a:
    b = a.pop(0)
    if b in a:
        x += 1
        break
if x == 1:
    print("No")
else:
    print("Yes")
# Judge status: Accepted

a,b=map(int,input().split())
print(a*b)
# Judge status: Accepted
n,q=map(int,input().split())
s=input()
d=[0]*(n+1)
for i in range(1,n):
  if s[i]=="C" and s[i-1]=="A":
    d[i]=d[i-1]+1
  else:
    d[i]=d[i-1]

for j in range(q):
  l,r=map(int,input().split())
  print(d[r-1]-d[l-1])
# Judge status: Accepted
# ABC 140

N = int(input())
A = [int(a)-1 for a in input().split()]
B = [int(a) for a in input().split()]
C = [int(a) for a in input().split()]
m =0
l = N + 10
for a in A:
    m+=B[a]
    if l+1 == a:
        m+=C[l]
    l=a
print(m)
# Judge status: Accepted
def solve():
    N, M = map(int, input().split())
    if N <= 5:
        return 0
    elif N <= 12:
        return M //2
    else:
        return M

print(solve())
# Judge status: Accepted
import os

def main():
	n = int(input())
	if n%2 == 0:
		print((n//2)/n)
	else:
		print(((n//2)+1)/n)


if __name__ == "__main__":
	main()
# Judge status: Accepted
import sys
def MI(): return map(int,sys.stdin.readline().rstrip().split())

N,M = MI()
city = [[] for i in range(N+1)]
for i in range(M):
    P,Y = MI()
    city[P].append((Y,i))

ID = []
for i in range(N+1):
    city[i] = sorted(city[i])
    for j in range(len(city[i])):
        P,Y = city[i][j]
        ID.append((Y,str(i).zfill(6)+str(j+1).zfill(6)))

ID.sort()
for i in range(M):
    print(ID[i][1])
# Judge status: Accepted
S = input()
if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
else:
    print(1)
# Judge status: Accepted
import numpy as np
N = int(input())
A = np.array(input().split(), dtype=np.int32)
B = np.array(input().split(), dtype=np.int32)
C = - np.array(input().split(), dtype=np.int32)
 
A.sort()
B.sort()
C.sort()
 
cnt_A = np.searchsorted(A,B,side='left')
cnt_C = np.searchsorted(C,-B,side='left')
 
answer = (cnt_A * cnt_C).sum()
print(answer)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
def solve(N,A):
    ans = 1
    lis = [A[0]]
    for i in range(1,N):
        if len(lis)==1 or diff==0:
            diff = A[i]-A[i-1]
        elif (A[i]-A[i-1])*diff<0:
            ans += 1
            lis = []
        lis.append(A[i])
    return ans
print(solve(N,A))
# Judge status: Accepted
str1 = input()
str2 = input()
str2 = str2[:len(str1)]
# print(str1)
# print(str2)
if str1 == str2:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
a,b = map(int,input().split())
L = list(map(int,input().split()))
L.sort()
if b<=2:
    print("No")
    exit()

if sum(L) >= a: 
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,m=map(int,input().split())
check=[False]*n
check[0]=True
ball=[1]*n
for i in range(m):
    x,y=map(int,input().split())
    x-=1
    y-=1
    if check[x]:
        check[y]=True
    else:
        continue
    ball[y]+=1
    ball[x]-=1

ans=0

for i in range(n):
    if ball[i]==0:
        check[i]=False

for chk in check:
    if chk:
        ans+=1

print(ans)
# Judge status: Accepted
import sys
from collections import defaultdict, Counter, deque
from itertools import accumulate, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right, bisect
from heapq import heappop, heappush
from fractions import gcd
from math import ceil, floor, sqrt, cos, sin, pi
from copy import deepcopy

# If you use recursive call, uncomment this code
#sys.setrecursionlimit(10**6)

def main():
    N = int(input())
    print(len(set([input() for _ in range(N)])))

if __name__ == '__main__':
    main()
# Judge status: Accepted
S = list(input())
S.sort()
l = list("abcdefghijklmnopqrstuvwxyz")
flag = 0

for i in l:
  if i in S:
    continue
  else:
    print(i)
    flag = 1
    break
    
if flag == 0:
  print("None")
# Judge status: Wrong Answer
a,b= input().split()
a,b=int(a),int(b)
if a+b <=24:
    print(a+b)
elif a+b>24:
    print(a+b-24)
# Judge status: Accepted
k = int(input())
a, b = map(int,input().split())

count = 0

for i in range(b-a+1):
    if (i+a)%k == 0:
        print("OK")
        count += 1
        break

if count == 0:
    print("NG")
# Judge status: Accepted
print(["NO","YES"][input()[::-1]==input()])
# Judge status: Accepted
num=int(input())
print(num*2*3.1415926535)
# Judge status: Wrong Answer
s=input()
n=len(s)
if(n==1):
  s+="es"
  print(s)
else:
  if(s[n-1]=="s"):
    s+="es"
    print(s)
  else:
    s+="s"
    print(s)
# Judge status: Wrong Answer
S = input()

if S == 'SUN':
    print('7')
elif S == 'MON':
    print('6')
elif S == 'TUE':
    print('5')
elif S == 'WED':
    print('4')
elif S == 'TUR':
    print('3')
elif S == 'FRI':
    print('2')
elif S == 'SAT':
    print('1')
else: print('Error')
# Judge status: Wrong Answer
import math
a,b,x=map(int,input().split())
if x==a*a*b:
  print(0)
elif x/2>=a*b/2:
  tangent= ((a*b-x/a)*2) / a**2
  print(math.atan(tangent)*180/math.pi)
else:
  tangent=(a*(b**2)) /2*x
  print(math.atan(tangent)*180/math.pi)
# Judge status: Accepted
# li = [[0] * 4 for i in range(3)]

# A = list.map(int, input().split())

x = int(input())

ans = 0
ans += (x // 500) * 1000
temp = x % 500
ans += (temp // 5) * 5

print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7


# 最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


# 最小公倍数
def lcm(a, b):
    return a * b * pow(gcd(a, b), MOD - 2, MOD)


LCM = A[0]
for a in A:
    LCM = lcm(LCM, a)
LCM %= MOD

ans = 0
for a in A:
    ans += LCM * pow(a, MOD - 2, MOD)
    ans %= MOD

print(ans % MOD)
# Judge status: Accepted
N=int(input())
tmp=[list(map(int,input().split())) for i in range(N-1)]
for i in range(N-1):
   time=0
   for j in range(i,N-1):
      data=tmp[j]
      if time<data[1]:
         time=data[1]+data[0]
      else:
         if time%data[2]==0:
            time+=data[0]
         else:
            time+=data[2]-(time%data[2])+data[0]
   print(time)
print(0)
# Judge status: Accepted
h,n,a=map(int,input().split())
if h+n+a<=21:
  print("win")
else:
  print("bust")
# Judge status: Wrong Answer
n,d=map(int,input().split())
k=0
for i in range(n):
  x,y=map(int,input().split())
  if x**2+y**2<=d:k+=1
print(k)
# Judge status: Wrong Answer
if __name__ == '__main__':
    n = int(input())
    lst = list(map(int, input().split()))

    ans = 50*101
    for i in range(-100,101):
        mn = 0
        for c in lst:
            mn += (i-c)*(i-c)
        ans = min(ans,mn)

    print(ans)
# Judge status: Accepted
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
x,y=map(int,input().split())
if x in a and y in a or x in b and y in b:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
a = list(map(int, input().split()))
A = [a]
ans = 0
while True:
    if (A[-1][0] & 1)or(A[-1][1] & 1)or(A[-1][2] & 1):
        print(ans)
        break
    tmp = [A[-1][1]//2+A[-1][2]//2, A[-1][0]//2 +
           A[-1][2]//2, A[-1][0]//2+A[-1][1]//2]
    if tmp in A:
        print(-1)
        break
    A.append(tmp)
    ans += 1
# Judge status: Accepted
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

A_max = max(A)
# A_str = format(A_max, "b")
# A_len = len(A_str)

# print("A_max: {} A_str: {} A_len: {}".format(A_max, A_str, A_len))
# format_opt = "0{}b".format(A_len)
# print("format_opt: {}".format(format_opt))
mask = 0
for a in A:
    mask = mask ^ a
# print(mask)

ans = []
for a in A:
    ans.append(a ^ mask)

print(*ans)
# Judge status: Wrong Answer
S = input()
f,e = int(S[:2]),int(S[2:])
if f==0 or e==0 or (f>12 and e>12):
  print('NA')
else:
  if 1<=f<=12 and e>12:
    print('MMYY')
  elif f>12 and 1<=e<=12:
    print('YYMM')
  else:
    print('AMBIGUOUS')
# Judge status: Accepted
s=input()
n=len(s)
t=0
for i in range(n):
    if s[i]=="1":
        t+=1
print(min(2*t,2*(n-t)))
# Judge status: Wrong Answer
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if(A+V*T==B+W*T):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import numpy as np
from itertools import product

n, m, x = map(int, input().split())
ca = np.array([list(map(int, input().split())) for _ in range(n)], dtype="i8")

ans = 10 ** 20
for bit in product([0, 1], repeat=n):
    tmp = np.zeros(m + 1)
    for i, j in enumerate(bit):
        if j == 1:
            tmp += ca[i]
    f = 0
    for i in tmp[1:]:
        if i < x:
            f = 1
    if f == 0:
        ans = min(ans, tmp[0])

if ans == 10 ** 20:
    print(-1)
else:
    print(int(ans))