Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _0._0._1.Practice
- {
- class Program
- {
- static void Main(string[] args)
- {
- var h = int.Parse(Console.ReadLine());
- var x = int.Parse(Console.ReadLine());
- var y = int.Parse(Console.ReadLine());
- var botXstart = 0;
- var botXend = 3 * h;
- var botYstart = 0;
- var botYend = h;
- var topXstart = h;
- var topXend = 2 * h;
- var topYstart = h;
- var topYend = 4 * h;
- var inBotRectangle = (x > botXstart && x < botXend) && (y > botYstart && y < botYend);
- var inTopRectangle = (x > topXstart && x < topXend) && (y > topYstart && y < topYend);
- var middleLine = (x > h && x < 2 * h && y == h);
- var onBotBorderXdown = (x >= 0 && x <= 3 * h && y == 0);
- var onBotBorderXUp = (((x >= 0 && x <= h) || (x >= 2 * h && x <= 3 * h)) && y == h);
- var onBotBorderYboth = ((y >= 0 && y <= h) && x == 0) || ((y >= 0 && y <= h) && x == 3 * h);
- var onTopBorderXUp = (x >= h && x <= 2 * h) && y == 4 * h;
- var onTopBorderYleft = ((y > h && y < 4 * h) && x == h);
- var onTopBorderYright = ((y > h && y < 4 * h) && x == 2 * h);
- if (inBotRectangle || inTopRectangle || middleLine)
- {
- Console.WriteLine("inside");
- }
- else if (onBotBorderXdown || onBotBorderXUp || onBotBorderYboth || onTopBorderXUp || onTopBorderYleft || onTopBorderYright)
- {
- Console.WriteLine("border");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement