Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Kadj Squares
Description In this problem, you are given a sequence x-y quarter of the plane, such that their sides make 45 degrees with x and y axes, and one of their vertices are on y=0 line. Let b be the _{i}x coordinates of the bottom vertex of S. First, put _{i}S such that its left vertex lies on _{1}x=0. Then, put S_{1}, (i > 1) at minimum b such that _{i}*b*>_{i}*b*_{i}_{-1}and- the interior of
*S*does not have intersection with the interior of_{i}*S*_{1}...*S*_{i-1}.
The goal is to find which squares are visible, either entirely or partially, when viewed from above. In the example above, the squares p, such that no square other than S intersect the vertical half-line drawn from _{i}p upwards. Input The input consists of multiple test cases. The first line of each test case is Output For each test case, output a single line containing the index of the visible squares in the input sequence, in ascending order, separated by blank characters. Sample Input 4 3 5 1 4 3 2 1 2 0 Sample Output 1 2 4 1 3 Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator