fork download
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <algorithm>
  4. using namespace std;
  5. int main()
  6. {
  7. int t;
  8. cin>>t;
  9. for(int t1=0;t1<t;t1++)
  10. {
  11. int n,k;
  12. cin>>n>>k;
  13. if(n==1 && k==1)
  14. cout<<1<<endl;
  15. if(k>=(n/2)+1)
  16. cout<<-1<<endl;
  17. else
  18. {
  19. int i=2,count=0;
  20. while(count<k)
  21. {
  22. cout<<i<<" ";
  23. i+=2;
  24. count++;
  25. }
  26. cout<<endl;
  27. }
  28.  
  29. }
  30. return 0;
  31. }
Success #stdin #stdout 0s 2732KB
stdin
1
1 1
stdout
1
-1