import type.lang.*;
import java.awt.*;

public class DemoRectangle
{
   public static void main(String[] args)
   {
		IO.println("Input rectangle position (x,y coordinate of top-left corner):");
		IO.print("x: ");
		int x = IO.readInt();

		IO.print("y: ");
		int y = IO.readInt();

		IO.println("\nInput rectangle size (width and height):");
		IO.print("width: ");
		int w = IO.readInt();

		IO.print("height: ");
		int h = IO.readInt();

		Rectangle r = new Rectangle(x, y, w, h);

		while (true)
		{
			IO.println("\nGive me a test point (or -1 to quit):");
			IO.print("x: ");
			int testx = IO.readInt();

			if (testx == -1)
				break;

			IO.print("y: ");
			int texty = IO.readInt();

			if (r.contains(testx, texty))
				IO.println("Point is inside rectangle");
			else
					IO.println("Point is NOT inside rectangle");
		}
		IO.println("Bye!");
   }
}

