From a6fdac361f4b41425387eefe33788dbbee0e56b2 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Sat, 15 Oct 2016 17:36:01 +0800 Subject: [PATCH] Create 5916.cpp --- HDOJ/5916.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 HDOJ/5916.cpp diff --git a/HDOJ/5916.cpp b/HDOJ/5916.cpp new file mode 100644 index 0000000..064c3c6 --- /dev/null +++ b/HDOJ/5916.cpp @@ -0,0 +1,34 @@ +#include +#include +#include +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; +}