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;
- class Task1
- {
- static void Main()
- {
- int h = int.Parse(Console.ReadLine());
- int x1 = int.Parse(Console.ReadLine());
- int y1 = int.Parse(Console.ReadLine());
- int x2 = int.Parse(Console.ReadLine());
- int y2 = int.Parse(Console.ReadLine());
- int x3 = int.Parse(Console.ReadLine());
- int y3 = int.Parse(Console.ReadLine());
- int x4 = int.Parse(Console.ReadLine());
- int y4 = int.Parse(Console.ReadLine());
- int x5 = int.Parse(Console.ReadLine());
- int y5 = int.Parse(Console.ReadLine());
- bool insideBuildingFirst = ((y1 >= 0 && y1 <= h) && (x1 >= 0 && x1 <= 3 * h)) || ((y1 >= 0 && y1 <= 4 * h) && (x1 >= h && x1 <= 2 * h));
- bool insideBuildingSecond = ((y2 >= 0 && y2 <= h) && (x2 >= 0 && x2 <= 3 * h)) || ((y2 >= 0 && y2 <= 4 * h) && (x2 >= h && x2 <= 2 * h));
- bool insideBuildingThird = ((y3 >= 0 && y3 <= h) && (x3 >= 0 && x3 <= 3 * h)) || ((y3 >= 0 && y3 <= 4 * h) && (x3 >= h && x3 <= 2 * h));
- bool insideBuildingFourth = ((y4 >= 0 && y4 <= h) && (x4 >= 0 && x4 <= 3 * h)) || ((y4 >= 0 && y4 <= 4 * h) && (x4 >= h && x4 <= 2 * h));
- bool insideBuildingFifth = ((y5 >= 0 && y5 <= h) && (x5 >= 0 && x5 <= 3 * h)) || ((y5 >= 0 && y5 <= 4 * h) && (x5 >= h && x5 <= 2 * h));
- if (insideBuildingFirst)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (insideBuildingSecond)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (insideBuildingThird)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (insideBuildingFourth)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (insideBuildingFifth)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement