Point#7451

Point

1 second
128 megabytes
Very easy

The point is given with its and coordinates: (, ).

Two points (, ), (, ) and an integer are given. Add them.

Write the code according to the next interface:

class Point // C++
{
private:
  int x, y;
public:
  Point(int x = 0, int y = 0); // Constructor
  void Read(void); // Read point coordinates
  void Print(void); // Print point coordinates
  Point operator +(int v); // Overload operator +: return the sum of point and integer v
  Point operator +(Point &p); // Overload operator +: return the sum of two points
  int getX(void); // Return x coordinate
  int getY(void); // Return y coordinate
  void SetX(int x); // Set x coordinate
  void SetY(int y); // Set y coordinate
};
prb7451.gif
class Point // Java
{
  private int x, y;
  Point(int x, int y); // Constructor
  public String toString(); // Return the string with point coordinates
  public Point Add(int v); // Add to both point coordinates the value of v, return the point
  public Point Add(Point p); // Add point p, return the sum of two points
  public int getX(); // Return x coordinate
  public int getY(); // Return y coordinate
  public void SetX(int x); // Set x coordinate
  public void SetY(int y); // Set y coordinate
};

Input

The first line contains the coordinates and of the first point. The second line contains the coordinates and of the second point. The third line contains an integer . All values do not exceed by the absolute value.

Output

Print the sum of two points and a number.

Examples

Example 1

Loading
Loading