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 in JAVA (judge verdict: Accepted)

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
 
public class Main {
	public void exec() throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);
        String[] inStr= br.readLine().split(" ");
        int a = Integer.parseInt(inStr[0]);
        int b = Integer.parseInt(inStr[1]);
        double c = Integer.parseInt(inStr[2])*Math.PI/180;
        double h = b*Math.sin(c);
        double d = a - b*Math.cos(c);
        out.printf("%.4f\n",h*a/2);
        out.printf("%.4f\n",Math.sqrt(d*d + h*h)+a+b);
        out.printf("%.4f\n",h);
        out.flush();
    }
  
    public static void main(String[] args) throws IOException {
        new Main().exec();
    }
}