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.Numerics;
- using System.Threading.Tasks;
- //Ako nqkoi e reshil da gleda tova reshenie, mu pojelavam uspeh!
- //Po glupav nachin se sumnqvam da e izmislqn v istoriqta ;)
- class Program
- {
- 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());
- if(h<0)
- {
- h = Math.Abs(h);
- if(x1 <0)
- {
- x1 = Math.Abs(x1);
- }
- else if(x1>0)
- {
- x1 = -x1;
- }
- if (x2 < 0)
- {
- x2 = Math.Abs(x2);
- }
- else if (x2 > 0)
- {
- x2 = -x2;
- }
- if (x3 < 0)
- {
- x2 = Math.Abs(x3);
- }
- else if (x3 > 0)
- {
- x3 = -x3;
- }
- if (x4 < 0)
- {
- x4 = Math.Abs(x4);
- }
- else if (x4 > 0)
- {
- x4 = -x4;
- }
- if (x5 < 0)
- {
- x5 = Math.Abs(x5);
- }
- else if (x5 > 0)
- {
- x5 = -x5;
- }
- if (y1 < 0)
- {
- y1 = Math.Abs(y1);
- }
- else if (y1 > 0)
- {
- y1 = -y1;
- }
- if (y2 < 0)
- {
- y2 = Math.Abs(y2);
- }
- else if (y2 > 0)
- {
- y2 = -y2;
- }
- if (y3 < 0)
- {
- y3 = Math.Abs(y3);
- }
- else if (y3 > 0)
- {
- y3 = -y3;
- }
- if (y4 < 0)
- {
- y4 = Math.Abs(y4);
- }
- else if (y4 > 0)
- {
- y4 = -y4;
- }
- if (y5 < 0)
- {
- y5 = Math.Abs(y5);
- }
- else if (y5 > 0)
- {
- y5 = -y5;
- }
- }
- if(h>0)
- {
- //Point 1
- if(x1>=0 && x1<=3*h)
- {
- //left
- if((x1>=0 && x1<=0+h) && (y1>=0 && y1<=0+h))
- {
- Console.WriteLine("inside");
- }
- //middle
- else if((x1>=0+h && x1<=0+2*h) && (y1>=0 && y1<=4*h))
- {
- Console.WriteLine("inside");
- }
- //left
- else if((x1>=2*h && x1<=3*h) && (y1>=0 && y1 <=h))
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (x2 >= 0 && x2 <= 3 * h)
- {
- //left
- if ((x2 >= 0 && x2 <= 0 + h) && (y2 >= 0 && y2 <= 0 + h))
- {
- Console.WriteLine("inside");
- }
- //middle
- else if ((x2 >= 0 + h && x2 <= 0 + 2 * h) && (y2 >= 0 && y2 <= 4 * h))
- {
- Console.WriteLine("inside");
- }
- //left
- else if ((x2 >= 2 * h && x2 <= 3 * h) && (y2 >= 0 && y2 <= h))
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (x3 >= 0 && x3 <= 3 * h)
- {
- //left
- if ((x3 >= 0 && x3 <= 0 + h) && (y3 >= 0 && y3 <= 0 + h))
- {
- Console.WriteLine("inside");
- }
- //middle
- else if ((x3 >= 0 + h && x3 <= 0 + 2 * h) && (y3 >= 0 && y3 <= 4 * h))
- {
- Console.WriteLine("inside");
- }
- //left
- else if ((x3 >= 2 * h && x3 <= 3 * h) && (y3 >= 0 && y3 <= h))
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (x4 >= 0 && x4 <= 3 * h)
- {
- //left
- if ((x4 >= 0 && x4 <= 0 + h) && (y4 >= 0 && y4 <= 0 + h))
- {
- Console.WriteLine("inside");
- }
- //middle
- else if ((x4 >= 0 + h && x4 <= 0 + 2 * h) && (y4 >= 0 && y4 <= 4 * h))
- {
- Console.WriteLine("inside");
- }
- //left
- else if ((x4 >= 2 * h && x4 <= 3 * h) && (y4 >= 0 && y4 <= h))
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- else
- {
- Console.WriteLine("outside");
- }
- if (x5 >= 0 && x5 <= 3 * h)
- {
- //left
- if ((x5 >= 0 && x5 <= 0 + h) && (y5 >= 0 && y5 <= 0 + h))
- {
- Console.WriteLine("inside");
- }
- //middle
- else if ((x5 >= 0 + h && x5 <= 0 + 2 * h) && (y5 >= 0 && y5 <= 4 * h))
- {
- Console.WriteLine("inside");
- }
- //left
- else if ((x5 >= 2 * h && x5 <= 3 * h) && (y5 >= 0 && y5 <= h))
- {
- Console.WriteLine("inside");
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- else
- {
- Console.WriteLine("outside");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement