P2785 Physics 1 (phsic1) - Magnetic Flux
Background
The newbie HansBug scratched his head countless times in the physics exam, yet his mind was still blank.
Description
In front of the newbie HansBug is a peculiar magnetic field region in the shape of a polygon, described by a sequence of $N$ points, which are the vertices of the region in order. Now HansBug wants to know the magnetic flux of this region. However, his brain cells and luck have been depleted, so this high-end task is left to you.
Input Format
The first line contains an integer $N$ and a real number $B$, where $B$ is the magnetic flux density.
Lines $2\sim N+1$ each contain two real numbers, representing the $x$ and $y$ coordinates of a point.
Output Format
Output one line containing a real number: the magnetic flux (rounded to 4 decimal places).
Explanation/Hint
Magnetic flux $=$ magnetic flux density $\times$ area of the magnetic field region.

$0\lt B\le 10$.
Translated by ChatGPT 5