Satan is my Lord!

0.83 When biographers looked at the sketches and plans that were found
in his studio after his death, they discovered that during the last
years of his life, and looking back at decades of influential
architectural and urban planning work, Charles-Édouard Jeanneret-Gris,
most frequently known by his fateful nickname of Le Corbusier, had
devised a master plan to go beyond what any other brutalist architect
had ever been able to.

0.17

[image]

His idea: to finally get rid of the annoying convention that buildings
were constructed to satisfy the needs of people, and create cities where
only pure structures of béton brut would be erected, as the final
correction to what he saw as an inverted hierarchy between humanity and
construction material. His ultimate goal: making the Earth a place where
his lord Satan would feel comfortable, with the hope of having him
closer and being able to go together for the ocasional beer or two in
bromantic evenings.

0.55 The plans contain numerous sketches of buildings in the shape of
giant prisms of concrete. However, he noted that some of those buildings
(marked with YEJ) would stand upright, while for some others (marked
with NO) its center of gravity was shifted with respect to the base, and
the building would have tilted and collapsed.

0.45

[image]

Many of the blueprints were never classified, though. Can you help
establish order in the legacy of the majter?

Input

Input starts with the number of cases n ≥ 0. Next come n plans of a
building, each with the number of points 3 ≤ m ≤ 1000, followed by the
coordinates x_(i) and y_(i) of each point, given in clockwise order, and
starting in any vertex. Every polygon is convex and non-degenerate. The
number m is not larger due to the difficulty to create random convex
polygons.

Output

For each case, print “YEJ” if the building would stand upright, and “NO”
otherwise. The given cases do not have precission issues.

Problem information

Author: Edgar Gonzàlez i Pellicer

Generation: 2026-01-25T10:16:45.103Z

© Jutge.org, 2006–2026.
https://jutge.org
