using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace _13_Point_in_the_Figure { public class Box { public int Number { get; set; } public int size { get; set; } public int startX { get; set; } public int startY { get; set; } public int endX { get; set; } public int endY { get; set; } public void defineEnds() { this.endX = this.startX + this.size; this.endY = this.startY + this.size; } } class Program { static void Main(string[] args) { int h = int.Parse(Console.ReadLine()); int x = int.Parse(Console.ReadLine()); int y = int.Parse(Console.ReadLine()); Box Box1 = GetBox1(h); Box Box2 = GetBox2(h, Box1); Box Box3 = GetBox3(h, Box2); Box Box4 = GetBox4(h, Box1); Box Box5 = GetBox5(h, Box4); Box Box6 = GetBox6(h, Box5); bool Border, Inside; CheckForBorderOrInside(x, y, Box1, Box2, Box3, Box4, Box5, Box6, out Border, out Inside); Border = Edges(x, y, Box1, Box2, Box5, Border); if (Border) { Console.WriteLine("border"); } else if (Inside) { Console.WriteLine("inside"); } if (Border == false && Inside == false) { Console.WriteLine("outside"); } } private static void CheckForBorderOrInside(int x, int y, Box Box1, Box Box2, Box Box3, Box Box4, Box Box5, Box Box6, out bool Border, out bool Inside) { Border = false; Inside = false; if (CheckForBorder(Box1, x, y) && (!CheckForBorder(Box2, x, y))) { Border = true; } else if (CheckForBorder(Box2, x, y) && (!CheckForBorder(Box1, x, y)) && (!CheckForBorder(Box3, x, y)) && (!CheckForBorder(Box4, x, y))) { Border = true; } else if (CheckForBorder(Box3, x, y) && (!CheckForBorder(Box2, x, y))) { Border = true; } else if (CheckForBorder(Box4, x, y) && (!CheckForBorder(Box2, x, y)) && (!CheckForBorder(Box5, x, y))) { Border = true; } else if (CheckForBorder(Box5, x, y) && (!CheckForBorder(Box4, x, y)) && (!CheckForBorder(Box6, x, y))) { Border = true; } else if (CheckForBorder(Box6, x, y) && (!CheckForBorder(Box5, x, y))) { Border = true; } else if (CheckForBorder(Box1, x, y) && CheckForBorder(Box2, x, y)) { Inside = true; } else if (CheckForBorder(Box2, x, y) && ((CheckForBorder(Box3, x, y)) || (CheckForBorder(Box4, x, y)))) { Inside = true; } else if (CheckForBorder(Box4, x, y) && CheckForBorder(Box5, x, y)) { Inside = true; } else if (CheckForBorder(Box5, x, y) && CheckForBorder(Box6, x, y)) { Inside = true; } else if (CheckForInside(Box1, x, y) || CheckForInside(Box2, x, y) || CheckForInside(Box3, x, y) || CheckForInside(Box4, x, y) || CheckForInside(Box5, x, y) || CheckForInside(Box6, x, y)) { Inside = true; } } private static bool Edges(int x, int y, Box Box1, Box Box2, Box Box5, bool Border) { if (x == Box1.endX && y == Box1.endY) { Border = true; } else if (x == Box1.endX && y == Box1.startY) { Border = true; } else if (x == Box2.endX && y == Box2.startY) { Border = true; } else if (x == Box2.endX && y == Box2.endY) { Border = true; } else if (x == Box5.startX && y == Box5.startY) { Border = true; } else if (x == Box5.startX && y == Box5.endY) { Border = true; } else if (x == Box5.endX && y == Box5.startY) { Border = true; } else if (x == Box5.endX && y == Box5.endY) { Border = true; } return Border; } private static Box GetBox6(int h, Box Box5) { Box Box6 = new Box(); Box6.startX = Box5.startX; Box6.startY = Box5.endY; Box6.size = h; Box6.defineEnds(); return Box6; } private static Box GetBox5(int h, Box Box4) { Box Box5 = new Box(); Box5.startX = Box4.startX; Box5.startY = Box4.endY; Box5.size = h; Box5.defineEnds(); return Box5; } private static Box GetBox4(int h, Box Box1) { Box Box4 = new Box(); Box4.startX = Box1.endX; Box4.startY = Box1.endY; Box4.size = h; Box4.defineEnds(); return Box4; } private static Box GetBox3(int h, Box Box2) { Box Box3 = new Box(); Box3.startX = Box2.endX; Box3.startY = Box2.startY; Box3.size = h; Box3.defineEnds(); return Box3; } private static Box GetBox1(int h) { Box Box1 = new Box(); Box1.startX = 0; Box1.startY = 0; Box1.size = h; Box1.defineEnds(); return Box1; } private static Box GetBox2(int h, Box Box1) { Box Box2 = new Box(); Box2.startX = Box1.endX; Box2.startY = Box1.startY; Box2.size = h; Box2.defineEnds(); return Box2; } public static bool CheckForBorder(Box CurrentBox, int XtoCheck, int YtoCheck) { bool Xequality = XtoCheck == CurrentBox.startX || XtoCheck == CurrentBox.endX; bool Yinside = CurrentBox.startY <= YtoCheck && YtoCheck <= CurrentBox.endY; bool Yequality = YtoCheck == CurrentBox.startY || YtoCheck == CurrentBox.endY; bool Xinside = CurrentBox.startX <= XtoCheck && XtoCheck <= CurrentBox.endX; bool isBorder = false; if (Xequality && Yinside) { isBorder = true; } else if (Yequality && Xinside) { isBorder = true; } return isBorder; } public static bool CheckForInside(Box CurrentBox, int XtoCheck, int YtoCheck) { bool Yinside = CurrentBox.startY < YtoCheck && YtoCheck < CurrentBox.endY; bool Xinside = CurrentBox.startX < XtoCheck && XtoCheck < CurrentBox.endX; bool isInside = false; if (Xinside && Yinside) { isInside = true; } return isInside; } } }