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 Program
- {
- static void Main(string[] args)
- {
- int height = int.Parse(Console.ReadLine());
- int x = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- bool outRect1 = (x < 0 || x > 3 * height) || (y < 0 || y > height);
- bool outRect2 = (x < height || x > 2 * height) || (y < height || y > 4 * height);
- bool inRect1 = (x > 0 && x < 3 * height) && (y > 0 && y < height);
- bool inRect2 = (x > height && x < 2 * height) && (y > height && y < 4 * height);
- bool commonBorder = (x > height && x < 2 * height) && y == height;
- if (outRect1 && outRect2)
- {
- Console.WriteLine("outside");
- }
- else if (inRect1 || inRect2 || commonBorder)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("border");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement