LaLa and Monster Hunting (Part 1)

아직 제출이 없습니다시간 제한5초메모리 제한1024 MB

문제

A dreadful monster has been witnessed in a forest near the city of magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} Sharia, and a group of valorous adventurers will hunt it down in few days before it hurts anyone. However, LaLa\color{blue}{\text{LaLa}} knows that the real reason those adventurers are willing to take the risk is to obtain the rare magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} stone that the monster is known to produce in its intestines. LaLa\color{blue}{\text{LaLa}} would like to obtain the magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} stone before they do, as it is known to be quite beautiful.

LaLa\color{blue}{\text{LaLa}} will first locate the monster with her magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}}. LaLa\color{blue}{\text{LaLa}} has placed a bunch of magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} tools within the forest, each of which has some power associated with it.

Consider the circles centered at each magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} tool with radius equal to its power. LaLa\color{blue}{\text{LaLa}}'s magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} will successfully locate the monster if and only if the convex hull of the circles contains the location of the monster.

Write a program that determines whether LaLa\color{blue}{\text{LaLa}} will be able to locate the monster.

입력

The input is given in the following format:

NN

x_0x\_0 y_0y\_0 r_0r\_0

x_1x\_1 y_1y\_1 r_1r\_1

\vdots

x_N1x\_{N-1} y_N1y\_{N-1} r_N1r\_{N-1}

where NN is the number of magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} tools placed in the forest, the ii-th of which is located at (x_i,y_i)(x\_i, y\_i) and has power r_ir\_i. Here, assume that the forest is a two-dimensional plane where the monster is located at (0,0)(0, 0).

The input satisfies the following constraints:

  • All the numbers in the input are integers.
  • 1N1,000,0001 \le N \le 1\\,000\\,000
  • 1,000,000x_i,y_i1,000,000-1\\,000\\,000 \le x\_i, y\_i \le 1\\,000\\,000 for all integers 0i<N0 \le i < N
  • 0r_i1,000,0000 \le r\_i \le 1\\,000\\,000 for all integers 0i<N0 \le i < N
  • The distance between point (0,0)(0, 0) and the boundary of the convex hull of NN circles, ii-th of which is centered at (x_i,y_i)(x\_i, y\_i) and has radius r_ir\_i, is at least 11.

출력

If LaLa\color{blue}{\text{LaLa}}'s magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} will successfully locate the monster, print a single string "Yes". Otherwise, print a single string "No". You may print each character in either case (lower or upper).

힌트

The following illustrates the configuration of the magic\color{red}{\text{m}} \color{brown}{\text{a}} \color{orange}{\text{g}} \color{blue}{\text{i}} \color{magenta} {\text{c}} tools for the sample tests. The red curve denotes the boundary of the convex hull.

First SampleSecond SampleThird Sample