Advertisement
felix_de_suza

1.FitInBox

Sep 11th, 2014
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.55 KB | None | 0 0
  1. using System;
  2.  
  3. class FitInBox
  4. {
  5. static void Main()
  6. {
  7. int w1 = int.Parse(Console.ReadLine());
  8. int h1 = int.Parse(Console.ReadLine());
  9. int d1 = int.Parse(Console.ReadLine());
  10. int w2 = int.Parse(Console.ReadLine());
  11. int h2 = int.Parse(Console.ReadLine());
  12. int d2 = int.Parse(Console.ReadLine());
  13. if ((w2 < w1 && h2 < h1) || (d2 < d1 && w2 < w1) || (d2 < d1 && h2 < h1))
  14. {
  15. int w3 = w1;
  16. int h3 = h1;
  17. int d3 = d1;
  18. w1 = w2;
  19. w2 = w3;
  20. h1 = h2;
  21. h2 = h3;
  22. d1 = d2;
  23. d2 = d3;
  24. }
  25. if ((w1 < w2 && h1 < h2 && d1 < d2))
  26. {
  27. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, w2, h2, d2);
  28. if ((w1 < w2 && h1 < d2 && d1 < h2))
  29. {
  30. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, w2, d2, h2);
  31. if ((w1 < h2 && h1 < w2 && d1 < d2))
  32. {
  33. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, w2, d2);
  34. if ((w1 < h2 && h1 < d2 && d1 < w2))
  35. {
  36. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, d2, w2);
  37. if ((w1 < d2 && h1 < w2 && d1 < h2))
  38. {
  39. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, w2, h2);
  40. if ((w1 < d2 && h1 < h2 && d1 < w2))
  41. {
  42. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, h2, w2);
  43. }
  44. }
  45. }
  46. }
  47. }
  48. }
  49. else if ((w1 < w2 && h1 < d2 && d1 < h2))
  50. {
  51. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, w2, d2, h2);
  52. if ((w1 < h2 && h1 < w2 && d1 < d2))
  53. {
  54. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, w2, d2);
  55. if ((w1 < h2 && h1 < d2 && d1 < w2))
  56. {
  57. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, d2, w2);
  58. if ((w1 < d2 && h1 < w2 && d1 < h2))
  59. {
  60. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, w2, h2);
  61. if ((w1 < d2 && h1 < h2 && d1 < w2))
  62. {
  63. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, h2, w2);
  64. }
  65. }
  66. }
  67. }
  68. }
  69. else if ((w1 < h2 && h1 < w2 && d1 < d2))
  70. {
  71. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, w2, d2);
  72. if ((w1 < h2 && h1 < d2 && d1 < w2))
  73. {
  74. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, d2, w2);
  75. if ((w1 < d2 && h1 < w2 && d1 < h2))
  76. {
  77. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, w2, h2);
  78. if ((w1 < d2 && h1 < h2 && d1 < w2))
  79. {
  80. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, h2, w2);
  81. }
  82. }
  83. }
  84. }
  85. else if ((w1 < h2 && h1 < d2 && d1 < w2))
  86. {
  87. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, h2, d2, w2);
  88. if ((w1 < d2 && h1 < w2 && d1 < h2))
  89. {
  90. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, w2, h2);
  91. if ((w1 < d2 && h1 < h2 && d1 < w2))
  92. {
  93. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, h2, w2);
  94. }
  95. }
  96. }
  97. else if ((w1 < d2 && h1 < w2 && d1 < h2))
  98. {
  99. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, w2, h2);
  100. if ((w1 < d2 && h1 < h2 && d1 < w2))
  101. {
  102. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, h2, w2);
  103. }
  104. }
  105. else if ((w1 < d2 && h1 < h2 && d1 < w2))
  106. {
  107. Console.WriteLine("({0}, {1}, {2}) < ({3}, {4}, {5})", w1, h1, d1, d2, h2, w2);
  108. }
  109. }
  110. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement