Under construction

Still being built. Things may change

Arm Coordination

Time limit2sMemory limit1024 MB

Summary
Given a circle's integer center and radius, output four integer-coordinate corners of a smallest enclosing square.
Level

Easy2 of 10

Topics
Geometry, Math, Implementation
Solved
No attempts yet

Problem

All the cool kids in town want to join the Bots and Androids Programmer Club (BAPC). To become a member, applicants must demonstrate their skill with a home-made robot programmed to perform some tricks. Like your older brother, you want to join the BAPC, so it is time to lock yourself in the hobby basement and start building robots.

Your older brother has used up almost all the parts for his own BAPC projects, so you have to get creative with whatever is left. You find a robotic arm with a single purpose: fitting circle-shaped objects into square-shaped holes. That is not exactly what you had in mind, but it will have to do. You have only five hours left to apply for BAPC membership.

The memory chip of the robotic arm appears to be wiped, but luckily you know the programming interface of its ARM processor. First, the robotic arm supports only integer coordinates. Second, when the arm picks up a circle-shaped object, you must calculate the smallest possible square it could fit the object in; after that, it will autonomously find a suitable square-shaped hole.

Given the location of a circle-shaped object, calculate the smallest possible square that encloses the object.

Input

The input consists of the following.

  • One line contains two integers xx and yy (−109≤x,y≤109-10^9 \le x,y \le 10^9), the coordinates of the center of the circle.
  • One line contains one integer rr (1≤r≤1091 \le r \le 10^9), the radius of the circle.

Output

Output four lines. Each line contains two integers: the xx- and yy-coordinates of one corner of the square. Print the corners in either clockwise or counter-clockwise order.

If there are multiple valid solutions, you may output any one of them.

Examples2

  1. Example 1

    Input
    -3 6
    5
    
    Expected output
    -10 7
    -2 13
    4 5
    -4 -1
    
  2. Example 2

    Input
    0 0
    10
    
    Expected output
    -14 -2
    -2 14
    14 2
    2 -14