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 Inside_the_Building
- {
- class InsideTheBuilding
- {
- static void Main(string[] args)
- {
- 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 insideFirst = x1 >= 0 && x1 <= 3 * h && y1 <= h && y1 >= 0 || x1 >= h && x1 <= 2 * h && y1 >= h && y1 <= 4 * h;
- bool insideSecond = x2 >= 0 && x2 <= 3 * h && y2 <= h && y2 >= 0 || x2 >= h && x2 <= 2 * h && y2 >= h && y2 <= 4 * h;
- bool insideThird = x3 >= 0 && x3 <= 3 * h && y3 <= h && y3 >= 0 || x3 >= h && x3 <= 2 * h && y3 >= h && y3 <= 4 * h;
- bool insideFourth = x4 >= 0 && x4 <= 3 * h && y4 <= h && y4 >= 0 || x4 >= h && x4 <= 2 * h && y4 >= h && y4 <= 4 * h;
- bool insideFifth = x5 >= 0 && x5 <= 3 * h && y5 <= h && y5 >= 0 || x5 >= h && x5 <= 2 * h && y5 >= h && y5 <= 4 * h;
- if (insideFirst && true)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (insideSecond && true)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (insideThird && true)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (insideFourth && true)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (insideFifth && true)
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment