Saleh127

codechef aryrot

May 23rd, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define sc(a) scanf("%lld",&a)
  6. #define sc2(a,b) scanf("%lld %lld",&a,&b)
  7. #define pf(a) printf("%lld",a)
  8. #define loop1(i,a,c) for(i=a;i<=c;i++)
  9. #define loop(i,c) for(i=0;i<c;i++)
  10. int main()
  11. {
  12. ll a[100005],c,d,e,f,i,j,k,l;
  13. test
  14. {
  15. cin>>c>>d;
  16. for(i=0;i<c;i++)
  17. {
  18. cin>>a[i];
  19. }
  20. e=c-d;
  21. for(i=e;i<c;i++)
  22. {
  23. printf("%lld ",a[i]);
  24. }
  25. for(j=0;j<e;j++)
  26. {
  27. if(j<(e-1)) printf("%lld ",a[j]);
  28. else printf("%lld\n",a[j]);
  29. }
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment