This problem was used in the following GFU competitions:
GFU 2024 D3 Q11
GFU 2024 D2 Q7
As part of the weekly routine that you maintain for peak mental and physical performance, you walk down the street every day to drop off your chef jacket at the dry cleaner instead of having it picked up. This week, you're dropping off several towels and sheets.
Along the way, there is always potential for someone to get in your way, or an event beyond your control to delay you. In order to forecast how long it might take you to get to the dry cleaners, you design a computer program that displays a rough circle made from the letter D (for dry cleaner) whose size is based off of how many delays you encountered per day on average, rounded up to the next whole multiple of two, over the course of the past week.
The side length of the circle (let's be honest, it's a square because you don't know how to program a circle) starts at zero and has no upper bound. For every two average delays per week, the side length increases by one. For example, if you were to go from one delay to four delays, the side length would increase from one to two.
The first input will be a single integer n that indicates the number of data sets that follow. Each data set will represent a seven-day week and will have seven integers ranging from zero to nine for the number of delays experienced per day of the week.
For each data set, output a square made from the character "D" based on the side length formula discussed above. A blank line will be printed after each data set output.
Example Input:
3
2 2 2 2 2 2 2
0 0 0 0 0 0 0
5 1 2 9 7 3 8
Example Output:
D
DDD
D D
DDD