Create 5916.cpp

This commit is contained in:
Kirigaya Kazuto 2016-10-15 17:36:01 +08:00 committed by GitHub
parent d3805a21f3
commit a6fdac361f

34
HDOJ/5916.cpp Normal file
View File

@ -0,0 +1,34 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
int main()
{
int t;
scanf("%d",&t);
for(int cc=1;cc<=t;cc++)
{
int n,k;
scanf("%d %d",&n,&k);
if(n==2)
{
printf("Case #%d: 1 2\n",cc);
continue;
}
if(n==3)
{
printf("Case #%d: 1 2 3\n",cc);
continue;
}
printf("Case #%d: ",cc);
printf("%d",2*k);
for(int p=k;p>=1;--p) printf(" %d",p);
for(int p=k+1;p<=2*k-1;++p) printf(" %d",p);
for(int p=2*k+1;p<=n;++p) printf(" %d",p);
printf("\n");
}
return 0;
}