programming c there is a large orchard containing apple trees that is coming up for sale. you want to bid for the same but you need to count the number of trees in the orchard so that you can arrive at a reasonable bid. the orchard is quite huge. while the boundaries are straight lines the area covered by the orchard is a polygon. the polygon is simple (the sides will not intersect) but may not be convex (the interior angles may be more than 180 degrees) however if you introduce a coordinate system inside the orchard with the origin at a tree all the trees are uniformly located at all points whose both coordinates are even integers. (note that an integer is said to be even if the absolute value is even; hence -6 and 0 are even -3 is not). the corner points of the boundaries are also at points whose coordinates are even integers. given the coordinates of the corner points of the boundary write a program to count the number of trees in the orchard.
Answers
Answered by
0
Constraints 4<=N<=50
Input Format
The first line will contain an integer N that will denote the number of boundary corners.
The next N lines will contain the commas separated the integers that give the coordinates of the boundary corners in a clockwise order.
Output:
It will give you one integer the number of trees in the orchard.
Similar questions