|Online Judge||Problem Set||Authors||Online Contests||User|
We are given N squares in the coordinate plane whose sides are parallel to the coordinate axes. All the corners have integer coordinates and the squares do not touch or overlap.
You are required to count the number of squares visible from the origin point O, O = (0, 0).
A square is visible from the origin point O if there are two distinct points A and B on one of its sides such that the interior of the triangle OAB has no common points with any of the remaining squares.
The first line of the input contains the integer N, 1 <= N <= 1000, the number of squares.
Each of the following N lines describes a square by specifying integers X, Y and L separated by single blank characters, 1 <= X, Y, L <= 10000. X and Y are coordinates of the lower left corner (the corner with the least X and Y coordinates) and L is the side length.
The first and the only line of the output should contain the number of squares that are visible from the origin.
3 2 6 3 1 4 1 3 4 1
[Submit] [Go Back] [Status] [Discuss]
Home Page Go Back To top
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator