REA - Editorial

PROBLEM LINK:

Practice
Contest

Author: Manish Pathak
Tester: Manish Pathak
Editorialist: Manish Pathak

DIFFICULTY:

SIMPLE

PREREQUISITES:

Maths

PROBLEM:

A Polygon is drawn,whose vertices are points on a Lattice,a regularly spaced array of points.M and N are the number of inside and boundary points of the polygon respectively.You have to find the area of the polygon.

EXPLANATION:

This can be solved by Pick’s Theorem.
According to Pick’s Theorem all you need to do to find the area of a polygon is to count the points on the interior and on the boundary of the shape.

Pick’s Theorem then states that:

Area= i+b/2-1

(i stands for the number of points in the interior of the shape, b stands for the number of points on the boundary of the shape.)
This link
might be helpful.

AUTHOR’S AND EDITORIALIST’S SOLUTIONS:

Author’s and editorialist’s solution can be found here.

1 Like