Advertisement
oogabooga1

Cartonase2

Feb 16th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4. int n,i,v[1001],ult,r,m;
  5. int main()
  6. {
  7. cin>>n>>m;
  8. n=n-m;
  9. for (i=1; i<=n; i++)
  10. cin>>v[i];
  11. sort (v+1,v+n+1);
  12. ult=v[1];
  13. r=(v[n]-v[1])/(n+m-1);
  14. for (i=1; i<=n; i++)
  15. {
  16. if (v[i]!=ult)
  17. {
  18. cout<<ult<<' ';
  19. i--;
  20. }
  21. ult+=r;
  22. }
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement