fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int x, y, a, b, c, d;
  6. cin >> x >> y >> a >> b >> c >> d;
  7. if ( x >= c && x >= a && c >= a && d >= b && y <= d ) {
  8. cout << " ( " << x << " " << y << " ) " <<
  9. "( " << a << " " << b << " )" << " ( " << c << " " << d << " ) ";}
  10. else if ( x >= c && x >=a && a >= c && b >= d && y <= b ){
  11. cout << " ( " << x << " " << y << " ) " <<
  12. "( " << c << " " << d << " )" << " ( " << a << " " << b << " ) ";}
  13. else if ( c >= a && c >= x && x >= a && y >= b && d <= y ){
  14. cout << " ( " << c << " " << d << " ) " <<
  15. "( " << a << " " << b << " )" << " ( " << x << " " << y << " ) ";}
  16. else if ( c >= x && c >= a && a >= x && b >= y && d <= b){
  17. cout << " ( " << c << " " << d << " ) " <<
  18. "( " << x << " " << y << " )" << " ( " << a << " " << b << " ) ";}
  19. else if ( a >= c && a >= x && c >= x && d >= y && b <= d ){
  20. cout << " ( " << a << " " << b << " ) " <<
  21. "( " << x << " " << y << " )" << " ( " << c << " " << d << " ) ";}
  22. else if ( a >= c && a >= x && x >= c && y >= d && b <= y){
  23. cout << " ( " << a << " " << b << " ) " <<
  24. "( " << c << " " << d << " )" << " ( " << x << " " << y << " ) ";}
  25.  
  26. return 0;
  27. }
Success #stdin #stdout 0s 3460KB
stdin
 2 1 0 0 2 0
stdout
 ( 2 0 ) ( 0 0 ) ( 2 1 )