P28617 [洛谷] Physics 1 (phsic1) - Magnetic Flux
提高
题目描述

Background

HansBug, the novice, is in the physics exam room, scratching his head countless times, yet his mind remains blank.

Problem Description

HansBug, the novice, is faced with a strange magnetic field, shaped like a polygon, described as a sequence of $N$ points, which are the vertices of the magnetic field in order. Now, HansBug wants to know the magnetic flux of this magnetic field. However, his brain cells and RP are exhausted, so this sophisticated task is entrusted to you.

Input Format

The first line contains an integer $N$ and a real number $B$, where $B$ is the magnetic induction intensity.

Lines $2$ to $N+1$ each contain two real numbers, representing the horizontal and vertical coordinates of the point.

Output Format

One line containing a real number, which is the magnetic flux (rounded to four decimal places).

Sample Input and Output

Sample Input #1

3 1
0 0
1 0
0 2

Sample Output #1

1.0000

Sample Input #2

4 1
1 1
1 -1
-1 -1
-1 1

Sample Output #2

4.0000

Notes

The magnetic flux = magnetic induction intensity $\times$ area of the magnetic field region.

Image

$0 < B \leq 10$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 1 0 0 1 0 0 2
样例输出
1.0000