ArbTangent/Beka00
ArbTangent/VoMaKu
nn1from decimal import *
1import math2import math
n2from decimal import *n
33
4def pi():4def pi():
5    getcontext().prec += 25    getcontext().prec += 2
6    three = Decimal(3)6    three = Decimal(3)
7    (lasts, t, s, n, na, d, da) = (0, three, 3, 1, 0, 0, 24)7    (lasts, t, s, n, na, d, da) = (0, three, 3, 1, 0, 0, 24)
8    while s != lasts:8    while s != lasts:
9        lasts = s9        lasts = s
10        (n, na) = (n + na, na + 8)10        (n, na) = (n + na, na + 8)
11        (d, da) = (d + da, da + 32)11        (d, da) = (d + da, da + 32)
12        t = t * n / d12        t = t * n / d
13        s += t13        s += t
14    getcontext().prec -= 214    getcontext().prec -= 2
15    return +s15    return +s
1616
17def cos(x):17def cos(x):
18    getcontext().prec += 218    getcontext().prec += 2
19    (i, lasts, s, fact, num, sign) = (0, 0, 1, 1, 1, 1)19    (i, lasts, s, fact, num, sign) = (0, 0, 1, 1, 1, 1)
20    while s != lasts:20    while s != lasts:
21        lasts = s21        lasts = s
22        i += 222        i += 2
23        fact *= i * (i - 1)23        fact *= i * (i - 1)
24        num *= x * x24        num *= x * x
25        sign *= -125        sign *= -1
26        s += num / fact * sign26        s += num / fact * sign
27    getcontext().prec -= 227    getcontext().prec -= 2
28    return +s28    return +s
2929
30def sin(x):30def sin(x):
31    getcontext().prec += 231    getcontext().prec += 2
32    (i, lasts, s, fact, num, sign) = (1, 0, x, 1, x, 1)32    (i, lasts, s, fact, num, sign) = (1, 0, x, 1, x, 1)
33    while s != lasts:33    while s != lasts:
34        lasts = s34        lasts = s
35        i += 235        i += 2
36        fact *= i * (i - 1)36        fact *= i * (i - 1)
37        num *= x * x37        num *= x * x
38        sign *= -138        sign *= -1
39        s += num / fact * sign39        s += num / fact * sign
40    getcontext().prec -= 240    getcontext().prec -= 2
41    return +s41    return +s
n42alpha = input()n42angle = input()
43n = int(input())43num = int(input())
44if n <= 15:44if num <= 15:
45    alpha = float(alpha) * math.pi * 0.00545    angle = float(angle) * math.pi * 0.005
46    getcontext().prec = n46    getcontext().prec = num
47    print(Decimal(math.tan(alpha)) / Decimal(1))47    print(Decimal(math.tan(angle)) / Decimal(1))
48else:48else:
t49    getcontext().prec = n + 2t49    getcontext().prec = num + 2
50    alpha = Decimal(alpha) * Decimal('0.005') * pi()50    angle = Decimal(angle) * Decimal('0.005') * pi()
51    answer = sin(Decimal(alpha)) / cos(Decimal(alpha))51    answer = sin(Decimal(angle)) / cos(Decimal(angle))
52    getcontext().prec -= 252    getcontext().prec -= 2
53    print(Decimal(answer) / Decimal(1))53    print(Decimal(answer) / Decimal(1))
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op