#P1302. 可见矩形
可见矩形
Description
Given pairwise non-overlapping (their common area is zero) squares on the plane, whose vertex coordinates are all integers. Let the origin be . For any square , if there exist two distinct points and on the boundary of such that the interior of has no common point with any other square, then we say that is visible from .
Given these pairwise non-overlapping squares, compute the number of squares visible from the origin .
Input Format
The first line contains the number of squares ().
Each of the next lines contains three integers describing a square. Here and are the coordinates of the lower-left vertex, and is the side length, where .
Output Format
Output a single line containing one integer, the number of squares visible from the origin .
3
2 6 4
1 4 1
2 4 1
3
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号