Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Point_In_The_Figure
- {
- class Point_In_The_Figure
- {
- static void Main(string[] args)
- {
- int h = int.Parse(Console.ReadLine());
- int x = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- int x1 = 0; // first rectangle
- int y1 = 0; // first rectangle
- int x2 = 3 * h; // first rectangle
- int y2 = h; // first rectangle
- int x3 = h; // second rectangle
- int y3 = h; // second rectangle
- int x4 = 2 * h; // second rectangle
- int y4 = 4 * h; // second rectangle
- if (((((x == x1) || (x == x2)) && (y1 <= y) && (y <= h)) || (((y == y1) || (y == h)) && (x1 <= x) && (x <= x2)) ||
- (((x == h) || (x == x4)) && (h <= y) && (y <= y4)) || (((y == h) || (y == y4)) && (h <= x) && (x <= x4))) && (!((y == h) && (x > h) && (x < x4))))
- Console.WriteLine("border");
- else if (((x >= x1) && (x <= x2) && (y >= y1) && (y <= h)) || ((x >= h) && (x <= x4) && (y >= h) && (y <= y4)) || (y == h) && (x > h) && (x < x4))
- Console.WriteLine("inside");
- else Console.WriteLine("outside");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement