1031 Fence 1031 Fence

Described
in some 1,765,243,235 a flat region in the fenced. Barrier having a height h and which has a closed polygonal line (not self-intersecting) in the form of a projection plane, which is specified by its vertices of N Cartesian coordinates (Xi, Yi). In the coordinates (0,0), the lamp standing on the field. Light barrier may be located outside or inside, but not at its sides, as in the following example image (not shown in thin line lights illuminate member):

Fences are completely black, i.e., it is neither diffusion nor reflection, do not let light through. Studies and experiments indicate that the following represents the law of light intensity falling on the fence at any point illumination:
I0 = K / R & lt
Wherein k is a known constant value not dependent on the point in question, r is the distance between the point and the plane of projection lamp. Having a height h and width d1 irradiation infinitesimal narrow vertical plate is
DI = I0 * | cosα | * DL * H
Where I0 is the intensity of the light barrier plate, α is the projection angle between the plane normal to the direction of the case side surface of the light fence.
You will write a program that will find the total lighting fence, defined as the sum of all lighting lighting board.
Input
The first line of the input file contains the number k, h and N, separated by spaces. k and h are real constants. N (3 <= N <= 100) is the number of vertices of the fence. Then the N rows, each row comprising two real numbers Xi and Yi, separated by spaces.
Output
to the output file, the total illuminance fence rounded to the second digit after the decimal point.
Sample input
Sample input
0.5 1.7 3
1.0 3.0
2.0 -1.0
-4.0 -1.0
Sample Output
5.34
 
 
Described
in some 1,765,243,235 a flat region in the fenced. Barrier having a height h and which has a closed polygonal line (not self-intersecting) in the form of a projection plane, which is specified by its vertices of N Cartesian coordinates (Xi, Yi). In the coordinates (0,0), the lamp standing on the field. Light barrier may be located outside or inside, but not at its sides, as in the following example image (not shown in thin line lights illuminate member):

Fences are completely black, i.e., it is neither diffusion nor reflection, do not let light through. Studies and experiments indicate that the following represents the law of light intensity falling on the fence at any point illumination:
I0 = K / R & lt
Wherein k is a known constant value not dependent on the point in question, r is the distance between the point and the plane of projection lamp. Having a height h and width d1 irradiation infinitesimal narrow vertical plate is
DI = I0 * | cosα | * DL * H
Where I0 is the intensity of the light barrier plate, α is the projection angle between the plane normal to the direction of the case side surface of the light fence.
You will write a program that will find the total lighting fence, defined as the sum of all lighting lighting board.
Input
The first line of the input file contains the number k, h and N, separated by spaces. k and h are real constants. N (3 <= N <= 100) is the number of vertices of the fence. Then the N rows, each row comprising two real numbers Xi and Yi, separated by spaces.
Output
to the output file, the total illuminance fence rounded to the second digit after the decimal point.
Sample input
Sample input
0.5 1.7 3
1.0 3.0
2.0 -1.0
-4.0 -1.0
Sample Output
5.34
 

Guess you like

Origin www.cnblogs.com/gyuy990/p/11669357.html