Lets welcome a new competition year! Please help us to show a text-based welcome dialog to any user who would login. In this simplest dialog, there are two parts called "Title" part and "Body" part. The result would be showed as the following:
+-----------------------+ |This is title X| +-----------------------+ | | | Welcome to NTUJ 2010, | | Kerker. | | | | < OK > | +-----------------------+
The title string is defined by the TITLE variable, it is "This is title" in the example above. Note that the title string should be in one line and should leave at least one whitespace to the "X" button at the rightmost position.
The user name is defined by the USERNAME variable, it is "Kerker" in the example above. There are paddings in the body part to control the reserved whitespaces in both left and right side of the dialog. The padding value is defined in the PADDING variable, and PADDING=1 means that the message in body part should leave exactly 1 whitespace to the left and the rightmost character in the message should leave at least 1 whitespace to the right. For better look-and-feel, you should leave one empty line to each of the top and bottom of body message.
The OK button is shown at the bottom of the dialog, and the message is defined by the OK_MSG variable, it is "OK" in the example above. The button should have the center alignment. More precisely, if we let nL be the number of whitespaces to the left of the button, and let nR be the number of whitespaces to the right of the button, we will have nL<=nR and nR-nL<=1
Note that the body message is left-aligned. In case of longer title string or longer OK-button string, the number of whitespaces between the rightmost character of the body message and the right side of the dialog could be more than PADDING.
The first line contains an integer indicating the number of test cases. For each test case, first line contains an integer n indicating the number of variables to be set. This number will be in the range of 1 to 4. All variables except USERNAME could have default value. In this problem, the default values are: TITLE=Welcome, PADDING=1, OK_MSG=OK. The next n lines will set the variables in an arbitrary order. All test cases are valid, that is, you don't have to handle any invalid variable settings. You may assume that only characters with ASCII code between 32 and 127 will appear in variable settings. There are no empty lines or unnecessary whitespaces in the input file. The length of each line is no more than 80, and the padding value will be a non-negative integer less then 10.
For each test case, please output the text-based dialog similar to the example in the description. Do not print any other empty lines or whitespaces otherwise the vertict of your output could be wrong answer.
Migrated from old NTUJ.
Tmt
No. | Testdata Range | Score |
---|