Advertisement
Guest User

Untitled

a guest
Feb 16th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6.  
  7. //map
  8.  
  9.  
  10. int main()
  11. {
  12. int n, m, k;
  13. cin >> n >> m >> k;
  14. int arr[5];
  15. for (int i = 0; i < n; i++)
  16. {
  17. cin >> arr[i];
  18. }
  19. sort(arr, arr + n);
  20. int ch = 0;
  21. for (int i = n; i > n - k; i--)
  22. {
  23. cout << i<<" ";
  24. ch++;
  25. }
  26. if (ch < m)
  27. {
  28. for (int i = 0; i < m - ch; i++)
  29. {
  30. cout << n<<" ";
  31. }
  32. }
  33.  
  34.  
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement