P23130 [AtCoder] [ARC051A] Painting
普及-
题目描述

Problem Description

Consider a white-painted two-dimensional plane.

First, paint the part whose distance from $ (x_1, y_1) $ is within $ r $ red.

Then, paint the part that satisfies $ x_2 ≦ x ≦ x_3, y_2 ≦ y ≦ y_3 $ blue.

Note that after being painted red, if further painted blue, the part becomes purple.

Determine whether there are parts painted red and blue, respectively.

Input Format

The input is given from the standard input in the following format:

$ x_1 $ $ y_1 $ $ r $ $ x_2 $ $ y_2 $ $ x_3 $ $ y_3 $

Output Format

Output 2 lines.

On the first line, output YES if there is a part painted red, otherwise output NO.

On the second line, output YES if there is a part painted blue, otherwise output NO.

Sample Input and Output

Sample Input #1

-1 -1 2
2 3 4 5

Sample Output #1

YES
YES

Sample Input #2

0 1 1
-2 0 4 3

Sample Output #2

NO
YES

Sample Input #3

0 0 5
-2 -2 2 1

Sample Output #3

YES
NO

Sample Input #4

0 0 2
0 0 4 4

Sample Output #4

YES
YES

Sample Input #5

0 0 5
-4 -4 4 4

Sample Output #5

YES
YES

Notes/Hints

Constraints

  • $ -100 ≦ x_1, y_1 ≦ 100 $
  • $ -100 ≦ x_2 < x_3 ≦ 100 $
  • $ -100 ≦ y_2 < y_3 ≦ 100 $
  • $ 1 ≦ r ≦ 100 $
  • All given numbers are integers.

Sample Explanation 1

A_img1 There are both red and blue parts.

Sample Explanation 2

A_img2 There is no part painted red.

Sample Explanation 3

A_img3 There is no part painted blue.

Sample Explanation 4

A_img4 Although the circle and rectangle overlap, there are both red and blue parts.

Sample Explanation 5

A_img5

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
-1 -1 2 2 3 4 5
样例输出
YES YES