Problem:


Problem A: The Mean of Angles

Problem

与えられた2つの角度&theta;1,&theta;2 のちょうど間の角度を求めよ。ここで、ちょうど間の角度を、下図のように「&theta;1 &plus; t = &theta;2 &minus; t を満たすtのうち絶対値が最も小さいものをt’としたときの&theta;1 &plus; t’」と定義する。

Input

入力は以下の形式で与えられる。

&theta;1
&theta;2

Constraints

入力は以下の条件を満たす。

    
角度は度数法(degree)で表される

    
0 ≤ &theta;1, &theta;2 < 360

    
&theta;1, &theta;2は整数

    
|&theta;1 &minus; &theta;2| &ne; 180

    
解答が[0,0.0001]または[359.999, 360)になるような入力は与えられない

Output

&theta;1,&theta;2のちょうど間の角度を度数法で[0,360)の範囲で1行に出力せよ。ただし0.0001を超える誤差を含んではならない。

Sample Input 1

10
20

Sample Output 1

15.0

Sample Input 2

20
350

Sample Output 2

5.0



Sample input:
10
20


Sample output:
15.0

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
if (a+b)/2<180:
  print((a+b)/2)
else:
  print(((a+b)/2)-180)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
if a+b<360:
  print((a+b)/2)
else:
  print(((a+b)/2)-180)

Submission status: Wrong Answer

Solution code:
a=int(input())
b=int(input())
if abs(a-b)<300 and a+b>180:
  print((a+b)/2+180)
elif a+b<180:
  print((a+b)/2)
else:
  print(((a+b)/2)-180)

Submission status: Wrong Answer

Solution code:
a = float(input())
b = float(input())
#if a>b: a,b=b,a
ansa = (a+b)/2
ta = abs(a-ansa)
if ansa<0: ansa+=360.0

ansb = (a+b-360)/2
tb = abs(a-ansb)
if ansb<0: ansb+=360.0

if ta<tb: print(ansa)
else: print(ansb)

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


def main():
    a = I()
    b = I()
    if a > b:
        b += 360
    return (a+b) / 2.0 % 180


print(main())

Submission status: Wrong Answer

Solution code:
print((int(input()) + int(input())) / 2 % 180)

Submission status: Wrong Answer

Solution code:
s1 = int(input())
s2 = int(input())
a = min(s1,s2)
b = max(s1,s2)

if a+360-b<180:
    if a > 360-b:
        print((a+b-360)/2)
    else:
        print((360-b-a)/2)
else:
    print((a+b)/2)

Submission status: Wrong Answer

Solution code:
s1 = int(input())
s2 = int(input())
d = s1 - s2
if abs(d) >= 180:
    s1 = min(360-s1, s1)
    s2 = min(360-s2, s2)
    if s1 >= s2:
        print(abs(s1-s2)/2)
    else:
        print(360-abs(s1-s2)/2)
else:
    print(abs(d)/2 + min(s1, s2))

Submission status: Accepted

Solution code:
t1 = int(input())
t2 = int(input())
if not t1 < t2:
    t1, t2 = t2, t1
if t2 - t1 <= 180:
    print((t2 + t1)/2)
else:
    print(((t2 + t1 + 360) % 720)/2)

Submission status: Accepted

Solution code:
a = float(input())
b = float(input())
if a>b: a,b=b,a
ansa = (a+b)/2
ta = abs(a-ansa)
if ansa<0: ansa+=360.0

ansb = (a+b-360)/2
tb = abs(a-ansb)
if ansb<0: ansb+=360.0

if ta<tb: print(ansa)
else: print(ansb)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LS(): return input().split()
def I(): return int(input())
def F(): return float(input())
def S(): return input()


def main():
    a = I()
    b = I()
    if a > b:
        a,b = b,a
    if b-a > a+360-b:
        a += 360
    return (a+b) / 2.0 % 360


print(main())

Submission status: Accepted

Solution code:
angs = [int(input()), int(input())]
angs.sort()
if angs[1] - angs[0] > 180:
    ans = sum(angs) / 2 + 180
    if ans >= 360:
        ans -= 360
    print(ans)
else:
    print(sum(angs) / 2)

Submission status: Accepted

Solution code:
a, b = int(input()), int(input())
print((a + b) / 2 % 360 if abs (a - b) % 360 < 180 else (a + b + 360) / 2 % 360)

Submission status: Accepted

Solution code:
s1 = int(input())
s2 = int(input())
a = min(s1,s2)
b = max(s1,s2)

if b-a>180:
    print((b+(360-b+a)/2)%360)
else:
    print((a+b)/2)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())
a = a % 360
b = b % 360
if a > b :
    a, b = b, a
if b - a > 180 :
    a += 360
t = abs((a - b) / 2)
ans = min(a, b) + t
ans = ans % 360
print('{:6f}'.format(ans))

Submission status: Accepted

Solution code:
s1 = int(input())
s2 = int(input())
if s1 > s2:
    s1, s2 = s2, s1
if s2 - s1 < 180:
    print((s1+s2)/2)
elif (s1+s2)/2 +180 < 360:
    print((s1+s2)/2 +180)
else:
    print((s1 + s2) / 2 - 180)

Submission status: Accepted

Solution code:
t1 = int(input())
t2 = int(input())

x = (t2-t1)/2
a = x
for i in range(-2,3):
    t = x + i*180
    if abs(a) > abs(t):
        a = t

ans = t1+a
while ans < 0:
    ans += 360
while ans > 360:
    ans -= 360

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = int(input())

a, b = min(a, b), max(a, b)

if b - a <= 180:
    print((a+b) / 2)
else:
    print(((a+b+360) % 720) / 2)

Submission status: Accepted

Solution code:
a,b=int(input()),int(input())
print((a+b+360*(abs(a-b)>180))/2%360)