tmollov

Untitled

Feb 8th, 2017
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Globalization;
  7.  
  8. namespace HM_4_Judge
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. var h = decimal.Parse(Console.ReadLine());
  15. var x = decimal.Parse(Console.ReadLine());
  16. var y = decimal.Parse(Console.ReadLine());
  17.  
  18.  
  19. decimal x1 = 3 * h;
  20. decimal y1 = h;
  21. decimal x2 = h;
  22. decimal y2 = 4 * h;
  23.  
  24. if (x > 0 && x < x1 && y > 0 && y < y1)
  25. {
  26. Console.WriteLine("inside");
  27. }
  28. else if (x > h && x < 2*h && y > 0 && y < y2)
  29. {
  30. Console.WriteLine("inside");
  31. }
  32. else if (x >= 0 && x <=3*h && y >= 0 && y <= h)
  33. {
  34. Console.WriteLine("border");
  35. }
  36. else if (x >= h && x <= 2*h && (y == 0 || (y >=h && y <= 4*h)) )
  37. {
  38. Console.WriteLine("border");
  39. }
  40. else
  41. {
  42. Console.WriteLine("outside");
  43. }
  44.  
  45.  
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment