O-Area
The prime minister of Vojvodina has recently bought a piece of valuable agricultural land, which is situated in a valley forming a regular grid of unit square fields. Since Vojvodina is flat, no need to make life difficult to people who work on land registration. So when they verify the transaction, especially whether the price corresponds to the market value of the land, which is always determined as the number of unit square fields fully contained in it, this is much easier then in ACM land. Your task is to write a program that computes the market value. The piece of land forms a closed polygon, whose vertices lie in the corners of unit fields. For example, the polygon in the picture (it corresponds to the first example in Sample Input) contains three square fields.
4
1 1
5 3
5 4
3 5
Output:35
3 3
2 5
3 4
5 2
4 2
Output:
05
0 0
0 -50
-50 -51
-51 -50
-50 0
Output:
2500
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.