You are on page 1of 2

ACSL

2006 - 2007 American Computer Science League All-Star # 4


Cross Columns

I I R L I I I X I R L I X I
I I R L I I I X I R L I X I
I I L R I I I X I R L I X I
I I L R I I I X I R L I X figureI #2
I I I I I X I R L I X I
PROBLEM: Given the rules and I X I L R I X I
values for the columns and rows, I X I
figure #1 L R I X I
draw the figure described. The left I X I L R I X I
and right most columns are considered the walls. If the wall is two columns or less in width, use I’s to
construct it. If the wall is more than 2 columns in width use I’s for the exterior sides and X’s for all interior
columns. R’s start at the left wall and are placed one row down and one column to the right. L’s start at
the right wall and are placed one row down and one column to the left. If both letters could occupy the
same cell, place an S in that cell. If a letter reaches a wall or the bottom row, then that becomes the last
row of letters shown. The maximum number of columns and rows will be 50.

INPUT: There will be 10 input lines. Each line will contain 3 integers. The first integer will give the
thickness of the wall. The second integer gives the number of columns between the 2 walls. The third
integer gives the row height of the wall.

OUTPUT: Print the figure described for each input line. The grid lines shown in the examples are not
required. The figure must stay on the screen so as to allow the proctor to check it for correctness. If a
figure scrolls off the screen so as to render checking impossible, it will be graded as incorrect.

SAMPLE INPUT SAMPLE OUTPUT


1. 2, 4, 5 1. figure #1
2. 3, 10, 8 2. figure #2
3. 1, 6, 6 3. figure #3
4. 1, 5, 6 4. figure #4
5. 4, 7, 4 5. figure #5

I R L I I R L I
I R L I I R L I
I R L I I S I
I L R I I L R I
I L R I I L R I
I L R I I I

figure #3 figure #4

I X X I R L I X X I
I X X I R L I X X I
I X X I R L I
ACSL X X I
I X X I S I X X I
2006 - 2007 American Computer Science League All-Star # 4
figure #5
Cross Columns

Test Data
TEST INPUT
1. 2, 3, 3 6. 4, 5, 5
2. 2, 4, 5 7. 5, 1, 3
3. 2, 6, 4 8. 4, 4, 4
4. 3, 5, 3 9. 1, 5, 5
5. 4, 3, 5 10. 2, 8, 6

TEST OUTPUT

1 2 3

I I R L I I I I R L I I I I R L I I
I4 I S I I I I R L5 I I I I R L I I
I I L R I I I I L R I I I I R L I I
I I L R I I I I L R I I
I I I I

I X I R L I X I I X X I R L I X X I
I X I R L I X I I X X I S I X X I
I X I S I X I I X X I L R I X X I
6 I X X I I X X I
I X X I I X X I
I X X I R L I X X I
I X X I R L I X X I
I X X I S I X X I
I X X I L R I X X I
I X X I L R I X X I

7 8

I X X X
I RI S I X
L X
I X
X I
X I
I X X X
I I R LI X X
I X
X I
X I
I X X X
I I L RI X X
I X
X I
X I 10
I R
X X I L L I R I X X I
I R L I I 9I R L I I
I S I I I R L I I
I L R I I I R L I I
I L R I I I R L I I
I I L R I I
I I L R I I

You might also like