Problem: You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate axes: the length of the side that is parallel to the Ox axis, equals w, the length of the side that is parallel to the Oy axis, equals h. The second rectangle can be obtained by rotating the first rectangle relative to the origin of coordinates by angle α.

<image>

Your task is to find the area of the region which belongs to both given rectangles. This region is shaded in the picture.

Input

The first line contains three integers w, h, α (1 ≤ w, h ≤ 106; 0 ≤ α ≤ 180). Angle α is given in degrees.

Output

In a single line print a real number — the area of the region which belongs to both given rectangles.

The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 6.

Examples

Input

1 1 45


Output

0.828427125


Input

6 4 30


Output

19.668384925

Note

The second sample has been drawn on the picture above.

Solution (in JAVA):

Solution:


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.StringTokenizer;

public class ProblemCRedo{
	static int S=25;//scale
	public static void main(String[] args){
		FastScanner sc = new FastScanner();
		long w = sc.nextLong();
		long h = sc.nextLong();

		double a = sc.nextDouble();
		if(a > 90){
			a = 180-a;
		}
		if(a>89.9999999){
			System.out.println(new BigDecimal(w).multiply(new BigDecimal(w)));
			return;
		}
		if(a<=0.00000000001){
			System.out.println(new BigDecimal(w).multiply(new BigDecimal(h)));
			return;
		}
		
		if(h>w){
			long temp = h;
			h=w;
			w=temp;
		}
		
		a = Math.toRadians(a);
		
		Point UR = new Point();
		UR.x = (double)w/2;
		UR.y = (double)h/2;
		Point UL = new Point();
		UL.x = (double)-w/2;
		UL.y = (double)h/2;
	
		Point URr = UR.rotate(a);
		Point ULr = UL.rotate(a);
		BigDecimal mUp = getSlope(URr.x, URr.y, ULr.x, ULr.y);
		BigDecimal cUp = new BigDecimal(getIntercept(mUp.doubleValue(), URr.x, URr.y));
		
		double alphaBound = 2*Math.atan(1.0*h/w);
		if(alphaBound > Math.PI/2){
			alphaBound = Math.PI - alphaBound;
		}
		//System.out.println(alphaBound);
		//System.out.println(Math.toDegrees(alphaBound));
		if(a > alphaBound){
			//case 2: 2 trapeziums
			Point tipTop = intersect(mUp, cUp, BigDecimal.ZERO, new BigDecimal((double)h/2));
			Point tipBottom = intersect(mUp, cUp, BigDecimal.ZERO, new BigDecimal((double)-h/2));
			BigDecimal wTop = new BigDecimal(Math.abs(tipTop.x - (double)-w/2));
			BigDecimal wBot = new BigDecimal(Math.abs(tipBottom.x - (double)-w/2));
			BigDecimal totalArea = new BigDecimal(w).multiply(new BigDecimal(h));
			BigDecimal subArea = wTop.add(wBot).multiply(new BigDecimal(h));
			//System.out.println("trapezium case");
			//System.out.println(totalArea);
			//System.out.println(subArea);
			System.out.println(totalArea.subtract(subArea));
			return;
		}
		//case 1: 4 triangles
		//upper triangle
		
		Point tipTop = intersect(mUp,cUp, BigDecimal.ZERO, new BigDecimal((double)h/2));
		Point tipLeft = intersect(mUp,cUp, (double)-w/2);
		BigDecimal ar1 = new BigDecimal(Math.abs(tipTop.x - ((double)-w/2))).multiply(new BigDecimal(Math.abs(tipLeft.y - (double)h/2)));
		
		//lower triangle
		Point BL = new Point();
		BL.x = (double)-w/2;
		BL.y = (double)-h/2;
		Point BLr = BL.rotate(a);
		BigDecimal mBot = getSlope(ULr.x, ULr.y, BLr.x, BLr.y);
		BigDecimal cBot = new BigDecimal(getIntercept(mBot.doubleValue(), ULr.x, ULr.y));
		
		Point tipRight = intersect(mBot,cBot, BigDecimal.ZERO, new BigDecimal((double)-h/2));
		Point tipBot = intersect(mBot,cBot, (double)-w/2);
		BigDecimal width = new BigDecimal(tipRight.x - ((double)-w/2));
		BigDecimal height = new BigDecimal(Math.abs(tipBot.y - ((double)-h/2)));
		BigDecimal ar2 = width.multiply(height);
		
		//done
		
		BigDecimal totalArea = new BigDecimal(w).multiply(new BigDecimal(h));
		BigDecimal subArea = ar1.add(ar2);
		//System.out.println("triangle case");
		//System.out.println(totalArea);
		//System.out.println(subArea);
		System.out.println(totalArea.subtract(subArea));
	}
	
	public static double getIntercept(double slope, double x1, double y1){
		return y1 - slope*x1;
	}
	
	public static BigDecimal getSlope(double x1, double y1, double x2, double y2){
		return new BigDecimal(y2-y1).divide(new BigDecimal(x2-x1),S,RoundingMode.HALF_UP);
	}
	
	public static Point intersect(BigDecimal m1, BigDecimal c1, double x){
		Point p = new Point();
		p.x = x;
		p.y = m1.multiply(new BigDecimal(x)).add(c1).doubleValue();
		return p;
	}
	
	public static Point intersect(BigDecimal m1, BigDecimal c1, BigDecimal m2, BigDecimal c2){
		Point result = new Point();
		result.x = (c2.subtract(c1)).divide((m1.subtract(m2)), S,RoundingMode.HALF_UP).doubleValue();
		result.y = m1.multiply(new BigDecimal(result.x)).add(c1).doubleValue();
	
		return result;
	}
	
	
	public static class Point{
		public double x;
		public double y;
		
		public Point rotate(double a){
			Point p = new Point();
			p.x = x*Math.cos(a) - y*Math.sin(a);
			p.y = x*Math.sin(a) + y*Math.cos(a);
			return p;
		}
	}
	
	public static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(String s) {
			try {
				br = new BufferedReader(new FileReader(s));
			} catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String nextToken() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(nextToken());
		}

		long nextLong() {
			return Long.parseLong(nextToken());
		}

		double nextDouble() {
			return Double.parseDouble(nextToken());
		}
	}
}