Follows 10210.c (Total 22 lines):

/* @JUDGE_ID:4461XX 10210 C "formula" */
/* A */
#include<math.h>
#include<stdio.h>

double PI=3.14159265358979323864 ;

int main( void )
{
	double x1 , x2 , y1 , y2 , a , b , d ;

	while( scanf( "%lf %lf %lf %lf %lf %lf" , &x1 , &y1 , &x2 , &y2 , &a , &b )==6 ){
		d = sqrt( pow( x2-x1 , 2.0 )+pow( y2-y1 , 2.0 ) ) ;
		a = a*PI/180.0 ;
		b = b*PI/180.0 ;

		printf( "%.3lf\n" , d*( ( 1.0/tan( a ) )+( 1.0/tan( b ) ) ) ) ;
	}

	return 0 ;
}
/* @END_OF_SOURCE_CODE */

Back to statistics
Ya-Lin Huang (C)
huangyl@gmail.com