Problem:
Triangle For given two sides of a triangle a and b and the angle C between them, calculate the following properties:  S : Area of the triangle  L : The length of the circumference of the triangle  h : The height of the triangle with side a as a bottom edge  Input The length of a , the length of b and the angle C are given in integers. Output Print S , L and h in a line respectively. The output should not contain an absolute error greater than 10 -4 . Sample Input 4 3 90 Sample Output 6.00000000
12.00000000
3.00000000

Solution (Python):
import math

a,b,c_deg = map(float,input().split())

sin_c = math.sin(c_deg*math.pi/180)
cos_c = math.cos(c_deg*math.pi/180)

s = a*b*sin_c/2.0
c = math.sqrt(a**2+b**2-2*a*b*cos_c)

print(s)
print(a+b+c)
print(s/a*2.0)

Solution (Python):

import math
a, b, C = map(int, input().split())

S = a*b*math.sin(C*math.pi/180)*(1/2)
L = a+b+math.sqrt(a*a+b*b-2*a*b*math.cos(C*math.pi/180))
h = 2*S/a

print('%.4f'% S)
print('%.4f'% L)
print('%.4f'% h)

Solution (Python):
import math
a, b, c = [float(i) for i in input().split()]
print(a * b * math.sin(math.radians(c)) / 2)
print(a + b + math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(c))))
print(b * math.sin(math.radians(c)))

Solution (Python):
import math
a, b ,angleC = [float(x) for x in input().split(" ")]

c = math.sqrt((a **2) + (b **2) - 2*a*b*(math.cos(math.radians(int(angleC))) ))

S = 1/2 * a * b * (math.sin(math.radians(int(angleC))))
L = a + b + c
h = 2 * S / a


print(S)
print(L)
print(h)

Solution (Python):
import math
a,b,C = (float(i) for i in input().split())
rad =math.radians(C)
S = a*b*0.5*math.sin(rad)
L = a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(rad))
H = b*math.sin(rad)
print(S)
print(L)
print(H)

Solution (Python):


import math
import sys


def calculate_area(side_a, side_b, angle_c):
    return (side_a*side_b*math.sin(math.radians(angle_c))) / 2


def calculate_perimeter(side_a, side_b, angle_c):
    side_c = math.sqrt(side_a**2 + side_b**2
                       - 2*side_a*side_b*math.cos(math.radians(angle_c)))
    return side_a + side_b + side_c


def calculate_height_from_side_a(side_a, area):
    return (area*2)/side_a


def main():
    nums = [float(num) for num in sys.stdin.readline().split()]

    area = calculate_area(nums[0], nums[1], nums[2])
    perimeter = calculate_perimeter(nums[0], nums[1], nums[2])
    height_from_side_a = calculate_height_from_side_a(nums[0], area)

    print(area)
    print(perimeter)
    print(height_from_side_a)


if __name__ == '__main__':
    main()

Solution (Python):
import math
a, b, C = map(float, input().split())
print('{0:.8f}'.format(0.5*a*b*math.sin(math.radians(C))))
print('{0:.8f}'.format(a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(C)))))
print('{0:.8f}'.format(b*math.sin(math.radians(C))))

Solution (Python):
import math
a, b, c = map(float, input().split())
s = a*b*math.sin(math.radians(c))/2
h = 2*s/a
l = a + b + (a**2+b**2 - 2*a*b*math.cos(math.radians(c)))**0.5
print("{0:.5f} {1:.5f} {2:.5f}".format(s,l,h))

Solution (Python):
import math

a,b,C = map(float,input().split())

h = b * math.sin(math.pi*C/180)
S = a * h /2
L = a + b +(a**2 + b**2 - 2*a*b*math.cos(math.pi*C/180))**(0.5)

print(S,L,h)

Solution (Python):


import sys
import os
import math


a, b, C = list(map(float, input().split()))
rad = math.radians(C)
S = 1/2 * a * b * math.sin(rad)

L2 = a ** 2 + b ** 2 - 2 * a * b * math.cos(rad)
L = math.sqrt(L2)
around = a + b + L

h = b * math.sin(rad)

print(S)
print(around)
print(h)

Solution (Python):
import math

a,b,C = list(map(int,input().split()))

S = a * b * math.sin(math.radians(C)) / 2
c = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(C)))
h = 2 * S / a

print(S)
print(a+b+c)
print(h)

Solution (Python):
import math

a, b, C = map(int, input().split())
h = b * math.sin(math.radians(C))
S = a * h / 2
c = math.sqrt(h**2 + (a-b*math.cos(math.radians(C)))**2)
L = a + b + c

print(S)
print(L)
print(h)

Solution (Python):


import sys
import collections
import math
import unittest


def calculate_triangle_area():
    try:
        [side_a, side_b, deg_C] = [float(value) for value in input().rstrip().split()]
    except:
        __input_error()
    
    area        = (1/2) * side_a * side_b * math.sin(deg_C * math.pi / 180)
    perimeter   = side_a + side_b + math.sqrt(side_a**2 + side_b**2 - 2 * side_a * side_b * math.cos(deg_C * math.pi / 180))
    height      = side_b * math.sin(deg_C * math.pi / 180)
    
    print(area)
    print(perimeter)
    print(height)

def __input_error():
    print("input error")
    return -1

class __TestValueClass(unittest.TestCase):
    def testEqual(self,func,tuples):
        self.testFunction(self.assertEqual,func,tuples)
    
    def testFunction(self,assertfunc,func,tuples):
        
        for item in tuples:
            try:
                if isinstance(item[0], collections.Iterable):
                    assertfunc(func(*item[0]),item[1])
                else:
                    assertfunc(func(item[0]),item[1])
            except Exception as msg:
                swidth = 15
                print("="*50)
                print("-- Assertion Error in '" + func.__name__ + "' --")
                print("arguments".ljust(swidth)+":",item[0])
                print("compared value".ljust(swidth)+":",item[1])
                print("message".ljust(swidth)+":")
                print(msg)
                sys.exit()
        print(func.__name__,": succeeded")
        

if __name__ == "__main__" :

    calculate_triangle_area()

Solution (Python):
from math import sin, cos, radians, sqrt
a, b, C = [float(i) for i in input().split(" ")]
S = a * b * sin(radians(C)) / 2
L = a + b + sqrt( a**2 + b**2 - 2*a*b*( cos(radians(C)) ) )
h = 2 * S / a

print(S,L,h,sep = "\n")

Solution (Python):

import math

a, b, C = input().split()
a = float(a)
b = float(b)
C = float(C)

c = math.sqrt(((a*a) + (b*b) - 2*a*b*math.cos(math.radians(C))))
L = a + b + c
S = a*b*math.sin(math.radians(C))/2
h = 2*S/a
print("%.5f\n%.5f\n%.5f" % (S, L, h))

Solution (Python):

import math as m
a,b,C = map(float,input().split(" "))
C = m.pi*C/180
h = b*m.sin(C)
print( a*h*0.5 )
print( (a**2+b**2 - 2*a*b*m.cos(C))**0.5 + a + b )
print( h )

Solution (Python):
import math

a, b, x = map(float, input().split())
x = math.radians(x)
S = 0.5 * a * b * math.sin(x)
h = b * math.sin(x)
c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(x))
L = a + b + c
print(S)
print(L)
print(h)

Solution (Python):
import math

a, b, C = map(float, input().split(' '))

rad = math.radians(C)
c = math.sqrt(a**2+b**2-2*a*b*math.cos(rad))

S = a*b*math.sin(rad)*1/2
L = a+b+c
h = abs(b*math.sin(rad))

print('{:.5f} {:.5f} {:.5f}'.format(S, L, h))

Solution (Python):
import math
a, b, C = map(float, input().split())

S = a * b * math.sin(math.radians(C))/2
L = a + b + math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(C)))
h = S * 2 / a

print("{0:04f}".format(S))
print("{0:04f}".format(L))
print("{0:04f}".format(h))

Solution (Python):
import math
a, b, C = map(int, input().split())
C = C / 180 * math.pi
S = a * b * math.sin(C) / 2
c = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(C))
print('{0}'.format(S))
print('{0}'.format(a + b + c))
print('{0}'.format(2 * S / a))

Solution (Python):
import math
a, b, C = map(int, input().split())
C = C / 180 * math.pi
S = a * b * math.sin(C) / 2
print(S)
print(a + b + math.sqrt(a**2 + b**2 - 2*a*b*math.cos(C)))
print(2 * S / a)

Solution (Python):
import math
a, b, c = map(float, input().split())
r = math.radians(c)
S = (a * b * math.sin(r)) / 2
print(S)
d = (a**2 + b**2 - 2 * a * b * math.cos(r))
d = math.sqrt(d)
L = a + b + d
print(L)
h = 2 * S / a
print(h)

Solution (Python):
import math
s = input().split(" ")
a = round(float(s[0]),8)
b = round(float(s[1]),8)
c = round(float(s[2]),8)
d = round(math.sqrt(a**2 + b**2 - 2*a*b*(round(math.cos(math.radians(c)),8))),8)
L = a + b + d
S = round(b * a * (round(math.sin(math.radians(c)),8)) / 2, 8)
h = round(S * 2 / a, 8)
print(S)
print(L)
print(h)

Solution (Python):
import math
a, b, C=map(int, input().split())
print("{0:.5f}".format((1/2)*a*b*math.sin(C*math.pi/180.0)))
print("{0:.5f}".format(a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(C*math.pi/180))))
print("{0:.5f}".format(b*math.sin(C*math.pi/180.0)))

Solution (Python):
import math
a, b, C = map(int, input().split())
R = math.radians(C)
c = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(R))
L = a + b + c
S = a * b * math.sin(R) / 2
h = S * 2 / a
print(S)
print(L)
print(h)

Solution (Python):
import math


def float_print(v):
    print('{:.5f}'.format(v))


a, b, C = map(float, input().split())
C = math.radians(C)

float_print(a * b * math.sin(C) / 2)
float_print(a + b + math.sqrt(math.pow(a, 2) + math.pow(b, 2) - 2 * a * b * math.cos(C)))
float_print(b * math.sin(C))

Solution (Python):
import math
a,b,c=map(int,input().split())
C=(c/180)*math.pi
S=(a*b*math.sin(C))/2
L=a+b+(a**2+b**2-2*a*b*math.cos(C))**0.5
h=b*math.sin(C)
print("%.5f\n%.5f\n%.5f\n"%(S,L,h))

Solution (Python):
import math
a=[float(i)for i in input().split()]
k=a[2]*math.pi/180
if a[2]>90.0:
    h=math.sin(k)*a[1]
    s=math.cos(k)*a[1]
    L=math.sqrt((a[0]-s)*(a[0]-s)+h*h)+a[0]+a[1]
elif a[2]<90.0:
    h=math.sin(k)*a[1]
    n=math.sqrt(a[1]*a[1]-h*h)
    L=a[0]+a[1]+math.sqrt(h*h+(a[0]-n)*(a[0]-n))
else:
    h=a[1]
    L=math.sqrt(a[0]*a[0]+a[1]*a[1])+a[0]+a[1]
S=a[0]*h/2
print("%.5f"%(S))
print("%.5f"%(L))
print("%.5f"%(h))

Solution (Python):


"""
????§???¢
????§???¢????????? a, b ??¨?????????????§? C ?????????
??????????§???¢?????¢??? S?????¨????????? L, 
a ???????????¨????????¨???????????? h 
????±???????????????°?????????????????????????????????
"""
import math
a, b, C = map(float,input().strip().split())
theta = math.radians(C) 
h = math.sin(theta) * b
S = a * h / 2
a1 = math.cos(theta) * b
a2 = a - a1
x = math.sqrt((h * h) + (a2 * a2))
L = a + b + x

print(S)
print(L)
print(h)

Solution (Python):
import math
a,b,C = [float(s) for s in input().split(' ')]

C = math.radians(C)

h = b * math.sin(C)
S = a * h * 0.5
L = a + b + math.sqrt(a**2 + b**2 - 2*a*b*math.cos(C))

print(S)
print(L)
print(h)

Solution (Python):
import math

def main():
    A, B, C = map(int, input().split())

    c = math.radians(C)
    s = A * B * math.sin(c) / 2
    l = A + B + math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(c))
    h = B * math.sin(c)

    print(s)
    print(l)
    print(h)

main()

Solution (Python):
import math

a,b,C= map(float,(input().split()))
Crad=C/180*math.pi

H = b*math.sin(Crad)
S = H * a/2


L=math.sqrt((a-b*math.cos(Crad))**2+H**2)+a+b
print(S)
print(L)
print(H)

Solution (Python):
import math

a,b,C=list(map(int,input().split()))

C_radian=math.radians(C)

S=a*b*math.sin(C_radian)/2
L=a+b+(a**2+b**2-2*a*b*math.cos(C_radian))**0.5
h=b*math.sin(C_radian)

print(S)
print(L)
print(h)

Solution (Python):
import math
a, b, C = map(int, input().split())
C2 = math.radians(C)

sin = math.sin(C2)
cos = math.cos(C2)
c = math.sqrt(a**2 + b**2 - 2*a*b*cos)

S =(a*b*sin) / 2
L = a+b+c

h = (a*b*sin/2)/(a/2)

print("{0:.8f}".format(S))
print("{0:.8f}".format(L))
print("{0:.8f}".format(h))

Solution (Python):
import math

a,b,C=map(int,input().split())
C2=math.radians(C)
sin=math.sin(C2)
cos=math.cos(C2)
S = 0.5*a*b*sin
L = a+b+(math.sqrt((a**2+b**2)-(2*a*b*cos)))
H = (a*b*sin/2)/(a/2)
print("{0:.8f}".format(S))
print("{0:.8f}".format(L))
print("{0:.8f}".format(H))

Solution (Python):
from math import sin, cos, radians

a, b, C = (float(x) for x in input().split())
s = a * b * sin(radians(C)) * 0.5
l = (a **2 + b**2 - 2 * a * b * cos(radians(C))) ** 0.5 + a + b
h = s * 2 / a
print(s)
print(l)
print(h)

Solution (Python):
import math

a, b, C = list(map(int, input().split()))
C = math.radians(C)
S = 0.5 * a * b * math.sin(C)
l = a + b + math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(C))
h = b * math.sin(C)
print("{:.5f}".format(S))
print("{:.5f}".format(l))
print("{:.5f}".format(h))

Solution (Python):
import math
a,b,c = map(float,input().split())
c = math.radians(c)
print(a*b*math.sin(c)/2)
print(a+b+math.sqrt(a**2 + b**2 - 2*a*b*(math.cos(c))))
print(b * math.sin(c))

Solution (Python):
import math
a,b,c=map(float,input().split())
c=math.radians(c)
h=b*math.sin(c)
s=a*h/2
d=math.sqrt(a**2+b**2-2*a*b*math.cos(c))
l=a+b+d
print(s,l,h)

Solution (Python):


import sys, math, os


PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


a, b, C = [int(_) for _ in input().split()]
C *= math.pi / 180
S = a * b * math.sin(C) / 2
c = math.sqrt(a**2 - 2 * a * b * math.cos(C) + b**2)
L = a + b + c
h = 2 * S / a
print("%.8f\n%.8f\n%.8f" % (S, L, h))

Solution (Python):
import math
from math import cos, sin

a,b,C=map(float,input().split())
C = math.radians(C)
S = 0.5*a*b*sin(C)
L = math.sqrt(b**2+a**2-2*a*b*cos(C))+a+b
h = 2*S / a

print(S)
print(L)
print(h)

Solution (Python):
import math

a, b, C = map(float, raw_input().split())
print a * b * math.sin(math.radians(C)) / 2
print a + b + math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(C)))
print (b * math.sin(math.radians(C)))

Solution (Python):
import math
a, b, c = map(int, input().split())
r = math.radians(c)
S = math.sin(r) * a * b / 2
print(S)
d = math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(r))
print(a + b + d)
h = math.sin(r) * b
print(h)

Solution (Python):
import math
a,b,C = map(int, input().split())
c = math.radians(C)
h = b * math.sin(c)
s = a * h / 2
a2 = a - b * math.cos(c)
c2 = math.sqrt(h**2 + a2**2)
l = a + b + c2

print("%f" % s)
print("%f" % l)
print("%f" % h)

Solution (Python):
import math as m
a, b, c = map(float, input().split())
c = m.radians(c)
S = a * b * m.sin(c) * (1/2)
l = m.sqrt(a**2 + b**2 - 2 * a * b * m.cos(c))
L = a + b + l
h = b * m.sin(c)
print("%.5f\n%.5f\n%.5f" % (S, L, h))

Solution (Python):
from math import cos, radians, sin, sqrt

def g(a, b, c):
    c_rad = radians(c)
    yield a * b * sin(c_rad) / 2
    yield a + b + sqrt(a ** 2 + b ** 2 - 2 * a * b * cos(c_rad))
    yield b * sin(c_rad)

a, b, c = list(map(int, input().split()))

for i in g(a, b, c):
    print("{:.8f}".format(i))

Solution (Python):
import math
a,b,c=map(int, input().split())
c=math.radians(c)
print(0.5*a*b*math.sin(c))
print(a+b+math.sqrt(a**2+b**2-2*a*b*math.cos(c)))
print(b*math.sin(c))

Solution (Python):
import math as m

a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
c=m.radians(c)
S=0.5*a*b*m.sin(c)
L=a+b+m.sqrt(a*a+b*b-2*a*b*m.cos(c))
H=b*m.sin(c)
print(S)
print(L)
print(H)

Solution (Python):
import math

a, b, c = map(float, input().split())
S =  0.5 * a * b * math.sin(c * math.pi / 180)
L = a + b + (a ** 2 + b ** 2 - 2 * a * b * math.cos(c * math.pi / 180)) ** 0.5
h = 2 * S / a

print("%f\n%f\n%f" % (S, L, h))

Solution (Python):
import math
a, b, C = map(float, input().split())
print('%f' %(a * b * math.sin(math.pi * C / 180.0) / 2))
print('%f' %(a + b + math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.pi * C / 180.0))))
print(('%f' %(b * math.sin(math.pi * C / 180.0) )))

Solution (Python):
import math

input_str = input().split(' ')
a = int(input_str[0])
b = int(input_str[1])
theta = int(input_str[2]) * math.pi / 180
c = math.sqrt(a*a-2*a*b*math.cos(theta)+b*b)

h = b * math.sin(theta)
S = a * h / 2
L = a + b + c

print('%.8f'%S)
print('%.8f'%L)
print('%.8f'%h)

Solution (Python):
import math

data = map(int, raw_input().split())
a = data[0]
b = data[1]
deg = math.radians(data[2])

c = (a**2 + b**2 - 2*a*b*math.cos(deg))**0.5
L = a + b + c
h = b * math.sin(deg)
S = a * h * 0.5

print S
print L
print h

Solution (Python):
import math
def main():
    a, b, C = map(int, input().split())
    C /= 180
    C *= math.pi
    
    S = 1 / 2 * a * b * math.sin(C)
    L = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(C)) + a + b
    h = 2 * S / a
    print(S)
    print(L)
    print(h)


if __name__ == "__main__":
    main()

Solution (Python):
from __future__ import division
import math

a, b, C = map(int, raw_input().split())
S = a * b * math.sin(math.radians(C)) / 2
c = math.sqrt((a**2 + b**2 -2*a*b*math.cos(math.radians(C))))
L = a + b + c
h = b * math.sin(math.radians(C))

for i in S, L, h:
    print "{:.5f}".format(i)

Solution (Python):
import math
a,b,C=map(float,input().split())
C*=math.pi/180
print('%.8f'%(a*b*math.sin(C)/2))
print('%.8f'%(a+b+(a*a+b*b-2*a*b*math.cos(C))**.5))
print('%.8f'%(b*math.sin(C)))

Solution (Python):
import math
a, b, C = map(int, input().split())

C_rad = C * math.pi / 180.0

h = b * math.sin(C_rad)
S = a * h / 2.0
c = math.sqrt(math.pow(h, 2) + math.pow(a - b * math.cos(C_rad), 2))
L = a + b + c

print(S)
print(L)
print(h)

Solution (Python):
import math

a,b,c = [float(s) for s in input().split()]
r = c * math.pi / 180
h = math.sin(r) * b
s = a * h / 2

x1 = a
y1 = 0
if c == 90:
    x2 = 0
else:
    x2 = math.cos(r) * b
y2 = h

d = math.sqrt((math.fabs(x1 - x2) ** 2) + (math.fabs(y1 - y2) ** 2))
l = a + b + d

print(s)
print(l)
print(h)

Solution (Python):
from math import sin, cos, sqrt, radians
a, b, C = map(int, input().split())
C = radians(C)
S = .5 * a * b * sin(C)
h = b * sin(C)
c = sqrt(a ** 2 + b ** 2 - 2 * a * b * cos(C))
L = a + b + c
print(S)
print(L)
print(h)

Solution (Python):
import math
 
a,b,C = map(float, input().split())
C_rad = C / 180 * math.pi
 
H = b * math.sin(C_rad)
S = H * a / 2 
L = math.sqrt( (a-b*math.cos(C_rad)) **2 + H**2 ) + a + b

print(S)
print(L)
print(H)

Solution (Python):


import math

def main():

    a, b, degree = map(int, input().split())

    radian = math.radians(degree)

    S = 0.5*a*b*math.sin(radian)
    x = a + b + math.sqrt(pow(a,2)+pow(b,2)-2*a*b*math.cos(radian))
    print('%.8f' % S)
    print('%.8f' % x)
    print('%.8f' % ((2*S)/a))



if __name__ == '__main__':
    main()

Solution (Python):
from math import sin, cos, sqrt, pi
side_a, side_b, angle = map(int, input().split())                                                                      
angle = angle * pi / 180
side_c = sqrt(side_b**2 + side_a**2 - 2 * side_a * side_b * cos(angle))
area = 0.5 * side_a * side_b * sin(angle)
circum = side_a + side_b + side_c
height = side_b * sin(angle)
print(area, circum, height)

Solution (Python):
from math import *
a,b,C=map(int,input().split())
C2=radians(C)
S=float(a*b*sin(C2)/2)
L=float(a+b+((a**2+b**2-2*a*b*cos(C2))**(1/2)))
h=float(b*sin(C2))
print(S)
print(L)
print(h)

Solution (Python):
import math


def main():
    """
       /|
    b / | h
     /  |
    /??????|???_
    <- a -->

    ??????a, ??????b, a??¨b??????????§?C(???)
    C???????????????radian????±???????

    ??????1????????????: x
    ??????: h (b?????????????????¨????????????sin????????¨???????±???????
    ??¢???: S (??????)

    L (x + a + b): ??????????????????????????¨??????
    x = sqrt(a_ ** 2 + h ** 2)
    ??????a??????????????????h?????§???????????? a_ ??¨????????¨
    a_ = a - b * cos(rad)
    ??? ??????????????¨?????????????????? ??§??°??°??£??????????????????
    """
    a, b, C = map(int, input().split())

    
    rad = math.pi * C / 180
    sin = math.sin(rad)
    h = b * sin
    S = a * h / 2

    a_ = a - b * math.cos(rad)
    len_d = math.sqrt(a_ ** 2 + h ** 2)

    print("{:.8f}".format(S))
    print("{:.8f}".format(a + b + len_d))
    print("{:.8f}".format(h))

if __name__ == "__main__":
    main()

Solution (Python):
from math import *
a,b,C=map(int,input().split())
C=C*pi/180
S=a*b*sin(C)/2
print(S,a+b+(a*a+b*b-2*a*b*cos(C))**0.5,2*S/a,sep='\n')

Solution (Python):
import math
a,b,C=map(int,input().split())
C=C*math.pi/180
S=a*b*math.sin(C)/2
print(S,a+b+(a*a+b*b-2*a*b*math.cos(C))**0.5,2*S/a,sep='\n')

Solution (Python):
import math
line = input().split()
a = int(line[0])
b = int(line[1])
c = int(line[2])
degree = c
rad = math.radians(degree)
s = a * b * math.sin(rad) / 2
l = a + b + math.sqrt(pow(a,2) + pow(b,2) - 2 * a * b * math.cos(rad))
h = b * math.sin(rad)
print("{0:.8f}".format(s))
print("{0:.8f}".format(l))
print("{0:.8f}".format(h))

Solution (Python):
import math

a, b, C = map(float, input().split())

h = b * math.sin(math.radians(C))
S = a * h / 2

a1 = b * math.cos(math.radians(C))
cc = math.sqrt(h * h + (a - a1) * (a - a1))

print("{a:5f}".format(a=S))
print("{a:5f}".format(a=a + b + cc))
print("{a:5f}".format(a=h))

Solution (Python):
from math import *
a, b, C = map(float, input().split())
c = sqrt(a ** 2 + b ** 2 - 2 * a * b * cos(radians(C)))
s = (a + b + c) / 2
S = sqrt(s * (s - a) * (s - b) * (s - c))
L = a + b + c
h = b * sin(radians(C))
print(S)
print(L)
print(h)

Solution (Python):
a,b,c = map(float,input().split())
import math
h = b * math.sin(math.radians(c))
S = ( a * h ) / 2
L = a + b + ( math.sqrt( a**2 + b**2 - 2*a*b*math.cos(math.radians(c)) ) )
print('{0:.8f}'.format(S))
print('{0:.8f}'.format(L))
print('{0:.8f}'.format(h))

Solution (Python):
import math
a,b,C=map(int,input().split())
C=C*math.pi/180
S=a*b*math.sin(C)/2
print(S,a+b+(a*a+b*b-2*a*b*math.cos(C))**.5,2*S/a,sep='\n')

Solution (Python):
import math

a, b, C = map(float, input().split())
S =  0.5 * a * b * math.sin(C * math.pi / 180)
L = a + b + (a ** 2 + b ** 2 - 2 * a * b * math.cos(C * math.pi / 180)) ** 0.5
h = 2 * S / a

print("%f\n%f\n%f" % (S, L, h))

Solution (Python):
import math
def hoge(a):
    return a*a
    
a, b, angle = map(float, input().split())
angle = math.radians(angle)
print (a*b*math.sin(angle) / 2)
print (a+b+math.sqrt(hoge(a) + hoge(b) - 2*a*b*math.cos(angle)))
print(a*b*math.sin(angle)/a)

Solution (Python):

import math
array = map(int, raw_input().split())
a = array[0]
b = array[1]
C = array[2]
rad = math.radians(C)
S = a * b * math.sin(rad) / 2.0
L = a + b + math.sqrt(math.pow(a,2) + math.pow(b,2) - 2 * a * b * math.cos(rad))
h = b * math.sin(rad)
print S
print L
print h

Solution (Python):
import math
data = list(map(float, input().split()))
a, b, theta = data[0], data[1], data[2]/180*math.pi
data[1] = (a**2+b**2-2*a*b*math.cos(theta)) ** 0.5 + a + b
data[2] = b * math.sin(theta)
data[0] = a * data[2] / 2
for i in range(3):
    print(data[i])

Solution (Python):
from math import sin, cos, radians
a, b, ang = map(int, input().split())
ang = radians(ang)
area = a * b * sin(ang) / 2
c = (a ** 2 + b ** 2 - 2 * a * b * cos(ang)) ** 0.5
circ = a + b + c
height = area * 2 / a
print("%lf\n%lf\n%lf" % (area, circ, height))

Solution (Python):
a,b,c = [int(x) for x in input().split()]
import math
si = math.sin(math.radians(c))
co = math.cos(math.radians(c))
s = a*b*si/2
l = a + b + (a**2 + b**2 - 2*a*b*co)**(1/2)
h = 2*s/a 
print("{:.6f}".format(s))
print("{:.6f}".format(l))
print("{:.6f}".format(h))

Solution (Python):



import sys
import math

a, b, c = map(float, sys.stdin.readline().split())
degree = abs(180-abs(c))*math.pi / 180

height = abs(b * math.sin(degree))
pos_x = b * math.cos(degree) + a
edge_x = (height**2 + pos_x**2) ** 0.5

print(round(a * height / 2, 6))
print(round(a + b + edge_x, 6))
print(round(height, 6))

Solution (Python):
from math import sin,cos,radians
a,b,c=map(int,input().split())
c=radians(c)
s=a*b*sin(c)*0.5
for i in[s,a+b+(a*a+b*b-2*a*b*cos(c))**0.5,s/a*2]:print('%5f'%i)

Solution (Python):



import sys
import math

a, b, c = map(float, sys.stdin.readline().split())
radian = c*math.pi / 180

height = abs(b * math.sin(radian))
pos_x = b * math.cos(radian)
edge_x = (height**2 + (pos_x-a)**2) ** 0.5

print(round(a * height / 2, 6))
print(round(a + b + edge_x, 6))
print(round(height, 6))

Solution (Python):


import math

def Sin(n):
    return math.sin(n*math.pi/180)

def Cos(n):
    return math.cos(n*math.pi/180)

a,b,ang=map(float,raw_input().split())
A=a*a
B=b*b
area=(0.5*a*b*Sin(ang))
C=A+B-(2*a*b*(Cos(ang)))
c=float(math.sqrt(C))
s=a+b+c
print round(area,5)
print round(s,5)
print round((area*2)/a,5)

Solution (Python):
import math

def triangle(a, b, deg):
    result = {}
    rad = math.radians(deg)
    c = math.sqrt(a*a+b*b-(2*a*b*math.cos(rad)))
    s = (a+b+c)/2
    result['area'] = math.sqrt(s*(s-a)*(s-b)*(s-c))
    result['perimeter'] = a+b+c
    result['height'] = result['area'] * 2 / a
    return result

if __name__ == '__main__':
    a, b, deg = map(int, input().split())
    triangle = triangle(a, b, deg)
    print(triangle['area'])
    print(triangle['perimeter'])
    print(triangle['height'])

Solution (Python):
import math

def triangle(a, b, deg):
    result = {}
    rad = math.radians(deg)
    c = math.sqrt(a*a+b*b-(2*a*b*math.cos(rad)))
    s = (a+b+c)/2
    result['area'] = math.sqrt(s*(s-a)*(s-b)*(s-c))
    result['perimeter'] = a+b+c
    result['height'] = result['area'] * 2 / a
    return result

if __name__ == '__main__':
    a, b, deg = map(int, input().split())
    triangle = triangle(a, b, deg)
    print(triangle['area'])
    print(triangle['perimeter'])
    print(triangle['height'])

Solution (Python):
import math
alen, blen, cang = map(float, input().split())
h = math.sin(math.radians(cang)) * blen

S = 0.5 * alen * h
if cang < 90.0:
    L = alen + blen + math.sqrt((alen - math.sqrt(blen**2.0 - h**2.0)) ** 2.0 + h**2.0)
else:
    L = alen + blen + math.sqrt((alen + math.sqrt(blen**2.0 - h**2.0)) ** 2.0 + h**2.0)
print(S)
print(L)
print(h)

Solution (Python):
import math
a, b, c = map(float, input().split(' '))
c = c / 180 * math.pi
s = a * b * math.sin(c) / 2
l = a + b + pow((pow(a, 2) + pow(b, 2) - 2 * a * b * math.cos(c)), 0.5)
h = b * math.sin(c)
print('{0:.8f}'.format(s) + '\n' + '{0:.8f}'.format(l) + '\n' + '{0:.8f}'.format(h))

Solution (Python):
import math


def triangle(a, b, angle):
    """returns (area, circumference, height) of a triangle

    a, b: sides of a trianble
    anble: interior angle of a, b (deg)

    >>> s, l, h = triangle(4, 3, 90)
    >>> print('{:.5f} {:.5f} {:.5f}'.format(s, l, h))
    6.00000 12.00000 3.00000
    >>> s, l, h = triangle(1, 1, 60)
    >>> print('{:.5f} {:.5f} {:.5f}'.format(s, l, h))
    0.43301 3.00000 0.86603
    """
    rad = math.radians(angle)
    h = b * math.sin(rad)
    c = math.sqrt(h**2 + (a - b*math.cos(rad))**2)

    return ((a * h) / 2, a + b + c, h)


def run():
    a, b, C = [int(i) for i in input().split()]
    (area, length, height) = triangle(a, b, C)

    print(area)
    print(length)
    print(height)


if __name__ == '__main__':
    run()

Solution (Python):
from math import radians, cos, sin, sqrt

a, b, c = map(float, input().split())

c = radians(c)
h = b * sin(c)
s = a * h * 1 / 2

d = sqrt(a ** 2 + b ** 2 - 2 * a * b * cos(c))
l = a + b + d

print(s)
print(l)
print(h)

Solution (Python):

import math

a, b, C = (float(i) for i in input().split())
C = math.pi * C / 180
S = a * b * math.sin(C) / 2
h = b * math.sin(C)
L = a + b + math.sqrt(a**2 + b ** 2 - 2 * a * b * math.cos(C))

print("{:.8f}".format(S))
print("{:.8f}".format(L))
print("{:.8f}".format(h))

Solution (Python):
from math import sin, cos, radians, sqrt
a, b, C = map(float, input().split())
rad = radians(C)
h = b * sin(rad)
print(a * h / 2)
print(a + b + sqrt(a ** 2 + b ** 2 - 2 * a * b * cos(rad)))
print(h)

Solution (Python):
import math
a,b,c = [int(x) for x in input().split()]
c = math.radians(c)
s = a * b * math.sin(c) / 2
l = a + b + math.sqrt(a**2 + b**2 - 2*a*b*math.cos(c))
h = 2 * s / a
for i in [s,l,h]:
    print('{:.12f}'.format(i))

Solution (Python):
import math
a,b,c = map(float,input().split())
rad = math.radians(c)
x = (a**2+b**2-2*a*b*math.cos(rad))**(1/2)
L = a+b+x
S = a*b*math.sin(rad)/2
h = 2*S/a
print("{:.8f}\n{:.8f}\n{:.8f}".format(S,L,h))

Solution (Python):
import math

a, b, C = map(float, input().split())

S = (a * b * math.sin(math.radians(C))) / 2
L = a + b + (math.sqrt(a**2 + b**2 - 2*a*b*math.cos(math.radians(C))))
h = b * math.sin(math.radians(C))

print("{:.8f}".format(S))
print("{:.8f}".format(L))
print("{:.8f}".format(h))

Solution (Python):
import math

a,b,C = tuple(float(n) for n in input().split())
C = math.radians(C)
S = a*b*math.sin(C) / 2
L = a + b + math.sqrt(a**2+b**2-2*a*b*math.cos(C))
h = b*math.sin(C)
print("{:.8f}\n{:.8f}\n{:.8f}".format(S,L,h))

Solution (Python):
import math, re

a, b, c = [int(n) for n in re.split(r"\s+", input().strip())]
h = b * math.sin(c * math.pi / 180)
S = a * h / 2
L = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(c * math.pi / 180)) + a + b
print("%f %f %f" % (S, L, h))

Solution (Python):
import math
a,b,R=map(int,input().split())
C=R*math.pi/180
S=0.5*a*b*math.sin(C)
c=math.sqrt(a**2+b**2-2*a*b*math.cos(C))
L=a+b+c
h=2*S/a
print(S)
print(L)
print(h)

Solution (Python):
import math
a, b, c = map(int, input().split())
PI = 3.1415926535897932384
c = math.radians(c)
print('{:.5f}'.format(a * b * math.sin(c) / 2))
A = a - b * math.cos(c)
B = b * math.sin(c)
print('{:.5f}'.format(math.sqrt(A * A + B * B) + a + b))
print('{:.5f}'.format(B))

Solution (Python):


import math

a, b, C = map(float, input().split())
c = math.sqrt((a * a) + (b * b) - 2 * a * b * math.cos(math.radians(C)))
s = (a * b * math.sin(math.radians(C))) / 2
l = a + b + c
h = (2 * s) / a
print(s)
print(l)
print(h)

Solution (Python):



import math

a, b, C = [int(x) for x in input().split(' ')]

S = a * b * math.sin(math.radians(C)) / 2.0
L = a + b + math.sqrt(pow(a, 2) + pow(b, 2) - 2 * a * b * math.cos(math.radians(C)))
h = b * math.sin(math.radians(C))

print('%.5f'%S)
print('%.5f'%L)
print('%.5f'%h)

Solution (Python):
from math import pi,sin,cos
a,b,C=map(int,input().split())
C=C*pi/180
S=a*b*sin(C)/2
print(S,a+b+(a*a+b*b-2*a*b*cos(C))**.5,2*S/a,sep='\n')

Solution (Python):
from math import *
a,b,C=map(int,input().split())
C=C*pi/180
S=a*b*sin(C)/2
print(S,a+b+(a*a+b*b-2*a*b*cos(C))**.5,2*S/a,sep='\n')

Solution (Python):
from math import*
a,b,C=map(int,input().split())
C=C*pi/180
S=a*b*sin(C)/2
print(S,a+b+(a*a+b*b-2*a*b*cos(C))**.5,2*S/a,sep='\n')

Solution (Python):
from math import*
a,b,C=map(int,input().split())
C=C*pi/180
S=a*b*sin(C)/2
print(S,a+b+(a*a+b*b-2*a*b*cos(C))**.5,2*S/a,sep='\n')

Solution (Python):
import math

a, b, ca = map(float, input().split())
ca = math.radians(ca)
s = a * b * math.sin(ca) / 2
c = (a ** 2 + b ** 2 - 2 * a * b * math.cos(ca)) ** 0.5
h = b * math.sin(ca)
print("{:.5f}".format(s))
print("{:.5f}".format(a + b + c))
print("{:.5f}".format(h))

Solution (Python):
import math
a,b,c = map(int,input().split())
print(float(0.5*a*b*math.sin(c*math.pi/180)))
print(float(a+b+math.sqrt(a**2 + b**2 - 2*a*b*math.cos(c*math.pi/180))))
print(float(b*math.sin(c*math.pi/180)))

Solution (Python):
import math
l=input().split()
a=float(l[0])
b=float(l[1])
c=int(l[2])

S=a*b*math.sin(math.radians(c))/2
h=S*2/a
d=math.sqrt(a*a+b*b-2*a*b*math.cos(math.radians(c)))
L=a+b+d

print(S)
print(L)
print(h)

Solution (Python):
import math
e=map(float,raw_input().split())
a=e[0]
b=e[1]
C=math.radians(e[2])
c=(a**2+b**2-2*a*b*math.cos(C))**0.5
h=b*math.sin(C)
S=h*a*0.5
L=a+b+c
print S
print L
print h

Solution (Python):
import math
a,b,c=map(int,input().split())
sinc=math.sin(math.radians(c))
cosc=math.cos(math.radians(c))
s=1/2*a*b*sinc
l=math.sqrt(a**2+b**2-2*a*b*cosc)+a+b
h=s*2/a
print(s)
print(l)
print(h)

Solution (Python):
import math
a, b, C = map(int, input().split())
print('{0:.4f}'.format(0.5*a*b*math.sin(math.radians(C))))
L = (a+b) + math.sqrt(a**2+b**2-2*a*b*math.cos(math.radians(C)))
print(L)
print('{0:.4f}'.format(math.sin(math.radians(C)) * b))

Solution (Python):
import math

a, b, C = map(int, input().split())

c = math.sqrt(a**2 + b**2 - (2 * a * b* math.cos(math.radians(C))))
L = a + b + c 
s = L / 2 
S = math.sqrt(s * (s - a) * (s - b) * (s - c))
h = (2 * S) / a
print("{}\n{}\n{}".format(S, L, h))

Solution (Python):


import math

def floatinput():
    a = input().split()
    for i in range(len(a)):
        a[i] = float(a[i])
    return a

def main():
    data = floatinput()
    a = data[0]; b = data[1]; C = data[2]
    S = a * b * 0.5 * math.sin(math.radians(C))
    c = math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(C)))
    L = a + b + c
    h = b * math.sin(math.radians(C))
    print(S); print(L); print(h)

if __name__ == "__main__":
    main()