Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2019
2,723
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4. int arr[2005];
  5. int main()
  6. {
  7.     int n;
  8.     scanf("%d",&n);
  9.     for (int i=0;i<2*n;i++)
  10.     scanf("%d",&arr[i]);
  11.     sort(arr,arr+2*n);
  12.     if (arr[0]==arr[2*n-1])
  13.     {
  14.         printf("-1");
  15.         return 0;
  16.     }
  17.     for (int i=0;i<2*n;i++)
  18.     printf("%d ",arr[i]);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement