Problem Description Little Q likes solving math problems very much. Unluckily, however, he does not have good spatial ability. Everytime he meets a 3D geometry problem, he will struggle to draw a picture.
Input The first line of the input contains an integer T(1≤T≤50) , denoting the number of test cases.
Output For each test case, print several lines to display the cube. See the sample output for details.
Sample Input 2 1 1 1 6 2 4
|
#include <bits/stdc++.h>
#include <stdio.h>
using namespace std;
#define re(ss,dd,ww) for(int ww=ss;ww<dd;++ww)
#define er(ss,dd,ww) for(int ww=dd;ww>=ss;--ww)
#define wl(ss) while(ss)
int main(){
int t;
scanf("%d",&t);
wl(t--){
int l,s,d;
scanf("%d %d %d",&l,&s,&d);
int w=1;
re(0,s,i){
re(0,2,j) printf(".");
}
printf("+");
re(0,l,i) printf("-+");
printf("\n");
if(s<=d){
er(s-1,0,i){
//
for(int j=0;j<i*2+1;j++)
printf(".");
printf("/");
for(int j=0;j<l;j++)
printf("./");
for(int j=s-1;j>i;j--){
printf("|/");
}
printf("|\n");
//
for(int j=0;j<i*2;j++)
printf(".");
printf("+");
for(int j=0;j<l;j++)
printf("-+");
for(int j=s-1;j>=i;j--){
printf(".+");
}
printf("\n");
}
for(int i=0;i<d-s;i++){
printf("|");
for(int j=0;j<l;j++)
printf(".|");
for(int j=0;j<s;j++)
printf("/|");
printf("\n");
printf("+");
for(int j=0;j<l;j++)
printf("-+");
for(int j=0;j<s;j++)
printf(".+");
printf("\n");
}
for(int i=d-s;i<d;i++){
printf("|");
for(int j=0;j<l;j++)
printf(".|");
for(int j=i;j<d-1;j++)
printf("/|");
printf("/");
for(int j=0;j<w;j++)
printf(".");
printf("\n");
printf("+");
for(int j=0;j<l;j++)
printf("-+");
for(int j=i;j<d-1;j++)
printf(".+");
for(int j=0;j<=w;j++)
printf(".");
printf("\n");
w+=2;
}
}
else{
for(int i=s-1;i>=0;i--){
//
for(int j=0;j<i*2+1;j++)
printf(".");
printf("/");
for(int j=0;j<l;j++)
printf("./");
if(i>=s-d){
for(int j=s-1;j>i;j--){
printf("|/");
}
printf("|\n");
}
else{
//printf("%d",w);
for(int j=d;j>=1;j--)
printf("|/");
//printf("/");
for(int j=0;j<w;j++)
printf(".");
printf("\n");
}
//
for(int j=0;j<i*2;j++)
printf(".");
printf("+");
for(int j=0;j<l;j++)
printf("-+");
if(i>=s-d){
for(int j=s-1;j>=i;j--){
printf(".+");
}
printf("\n");
}
else{
for(int j=d;j>=1;j--)
printf(".+");
for(int j=0;j<=w;j++)
printf(".");
printf("\n");
w+=2;
}
}
for(int i=0;i<d;i++){
printf("|");
for(int j=0;j<l;j++)
printf(".|");
for(int j=i;j<d-1;j++)
printf("/|");
printf("/");
for(int j=0;j<w;j++)
printf(".");
printf("\n");
printf("+");
for(int j=0;j<l;j++)
printf("-+");
for(int j=i;j<d-1;j++)
printf(".+");
for(int j=0;j<=w;j++)
printf(".");
printf("\n");
w+=2;
}
}
}
}