Fill The Cube

A company manufactures walls which can be directly implanted at the site. The company uses small square bricks of material C and material D which have similar looks but have huge difference in quality. The company manufactures walls of square shapes only to optimize their costs.

A novice employee created a square wall using bricks of material C and D. However, the client had asked the wall to be made of only high-quality material - material C.

To solve this problem, they will place the wall in a special furnace and heat it such that the material D melts and only material C remains. Material C brick will move down due to gravity if a material D brick below it melts. The new empty space created will be filled by new material C square walls. They also want to use biggest possible C square wall while building the final wall. For this they will position the wall in the furnace in an optimal way i.e. rotate by 90-degrees any number of times, if required, such that the biggest space possible for new material C wall is created. No rotations are possible when the furnace starts heating.

Given the structure of the original wall created by the novice employee, you need to find out the size of the new C square wall which can be fitted in the final wall which will be delivered to the client.

Constraints
1 < N < 100

Input
First Line will provide the size of the original wall N.

Next N lines will provide the type of material (C and D) used for each brick by the novice employee.

Output
Size of the biggest possible C square wall which can be fitted in the final wall.

Time Limit
1


Examples
Example 1

Input

4

C D C D

C C D C

D D D D

C D D D

Output

3

Explanation

If the wall is placed with its left side at the bottom, space for a new C wall of size 2x2 can be created. This can be visualized as follows

D C D D

C D D D

D C D D

C C D C

The melted bricks can be visualized as follows

- - - -

- C - -

C C - -

C C - C

Hence, the maximum wall size that can be replaced is 2x2.

If the wall is placed as it is with its original bottom side at the bottom, space for a new C wall of size 3x3 can be created. Post melting, this can be visualized as follows.

- - - -

C - - -

C - - -

C C C C

Hence, the maximum wall size that can be replaced is 3x3 in this approach.

Since no rotations followed by heating is going to a yield a space greater than 3x3, the output is 3.

Example 2

Input

7

C D D C D D D

C D D C D D D

D D D D D D C

D C D C D D D

D D D C D C D

C D D C D C C

C D C D C C C

Output

5

Explanation

If the wall is placed with its left side at the bottom, a space for new C wall of size 5x5 can be created. This can be visualized as follows

D D C D D C C

D D D D C C C

D D D D D D C

C C D C C C D

D D D D D D C

D D D C D D D

C C D D D C C

When this orientation of the wall is heated, a space for new C wall of size 5x5 is created after the D bricks melt

_ _ _ _ _ _ _

_ _ _ _ _ _ _

_ _ _ _ _ _C

_ _ _ _ _ C C

_ _ _ _ _ C C

C C _ C C C C

C C C C C C C

Whereas, if the rotation was not done, the wall formed after the D bricks melt will be as follows

_ _ _ _ _ _ _

_ _ _ _ _ _ _

_ _ _ C _ _ _

C _ _ C _ _ _

C _ _ C _ _ C

C _ _ C _ C C

C C C C C C C

When this orientation of the wall is heated, a space for new C wall of size 3x3 only is created after the D bricks melt

Hence rotation is important and correct answer is 5x5

Since no rotations followed by heating is going to a yield a space greater than 5x5, the output is 5.
You need to make an actual effort towards solving the problem.

Just being a copy/paste service between your tutor and the forum is not good enough.

See also https://www.cplusplus.com/forum/beginner/272338/
Sir, I tried but couldn't solve that's why I came here... I produced the logic but implementation seems tough ...
@salem c
anyone who could help. I wrote code for rotation but couldn't get what to do next
So post your code so far.
I produced the logic but implementation seems tough
Tell us the logic that you've come up with. We can probably help you refine it and then turn it into code.
shrutichandel wrote:
I produced the logic

Show us then.


shrutichandel wrote:
I wrote code for rotation

That is unnecessary. Think about the problem first.
program main
   implicit none
   integer i, j, N
   integer, allocatable :: rowsum(:), colsum(:)
   character, allocatable :: ch(:)


   read *, N
   allocate( rowsum( N ), colsum( N ), ch(N) )
   rowsum = 0;   colsum = 0

   do i = 1, N
      read *, ch
      rowsum(i) = count( ch == 'C' )
      where ( ch == 'C' ) colsum = colsum + 1
   end do

   print *, max( bestSquare( rowsum ), bestSquare( colsum ) )

   deallocate( rowsum, colsum, ch )


contains

   integer function bestSquare( height )
      integer, intent(in) :: height(:)
      integer N, row, maxgap, gap, i
   
   
      N = size( height )
      bestSquare = N - maxval( height )
      do row = N - bestSquare, 1, -1
         maxGap = 0
         gap = 0
         do i = 1, N
            if ( height(i) < row ) then
               gap = gap + 1
            else
               gap = 0
            end if
            maxGap = max( gap, maxGap )
         end do
         if ( maxGap <= bestSquare ) exit
         bestSquare = bestSquare + 1
      end do
   
   end function bestSquare

end program main

I wonder whether this is correct :)

CDCDCCCDDCDDCCDDCDCDCCCDCDDDCCCDDCCCDCDDDDCCDDCCCD
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DDDCDDDDDCDCDDDCCDCDCCDCDCDCDDCDDDDDDCDCCD
CCCDDDCDDCCDDDCCCCDDCCDCDCDDCDCDDCCDCDDDDCCDCCCDDD
DCDCCDCCCCDCCCCDDDCDCDCCCDCDDCCDDCDCCDDCDDCCCDCDDC
CDCCDCDDCDDDCDCDDDCDCCCCDCDDCDCCDDCDDDDCCCCDCCDCDC
CDCDCDCCCDDDCCCDDDDDDCDCDCDDDDCDDCDDCDCDCCCCCCDDCC
DDDCDCDCCDCDDDCCCDDDDDDCDCCCDCCCDDCDDCDCCDDDCCCCCC
CDCDDCCDCCCCCCCDDCDCCCCCCDDDDCCCDDCDCDCCCCDCDDCDDC
DCDDCCCCDDDDCDCCCCCDDDDCDDDDDDDCDCDDCCDDCCCCCCDCDD
DDDCDDDDDCCCCDDCDDDCDCCCCCCCDCCDDCCDDCDCDDDCCCCCCD

Rotate LEFT:
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
-------------C---------C--C--------------------C--
-----C-------C-------C-C--C------------C-------C--
-----C--C----C-------C-C--C------------C---C---C--
-----C--C----C-------C-CCCC------C-----C---C---C--
CC---C--C----C-------C-CCCCC--C--C---C-CC--C---C-C
CC---C--CC---C---C---CCCCCCC--C--C---CCCC--CC-CC-C
CC---CC-CC--CC---C---CCCCCCC--C-CC---CCCC-CCCCCC-C
CC-C-CC-CC--CC---CCC-CCCCCCC--C-CC--CCCCC-CCCCCCCC
CCCC-CCCCC--CCC--CCCCCCCCCCC-CC-CC--CCCCC-CCCCCCCC
CCCC-CCCCC-CCCCC-CCCCCCCCCCC-CC-CC--CCCCC-CCCCCCCC
CCCC-CCCCC-CCCCC-CCCCC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CCCC-----------------------------------
CCCCCCCCCCCCCCCC----------------------------------
CCCCCCCCCCCCCCCC----------------------------------
CCCCCCCCCCCCCCCCCC--------------------------------
CCCCCCCCCCCCCCCCCC--------------------------------
CCCCCCCCCCCCCCCCCC--------------------------------
CCCCCCCCCCCCCCCCCCC-------------------------------
CCCCCCCCCCCCCCCCCCCC------------------------------
CCCCCCCCCCCCCCCCCCCCC-----------------------------
CCCCCCCCCCCCCCCCCCCCC-----------------------------
CCCCCCCCCCCCCCCCCCCCCC----------------------------
CCCCCCCCCCCCCCCCCCCCCC----------------------------
CCCCCCCCCCCCCCCCCCCCCC----------------------------
CCCCCCCCCCCCCCCCCCCCCC----------------------------
CCCCCCCCCCCCCCCCCCCCCC----------------------------
CCCCCCCCCCCCCCCCCCCCCCC---------------------------
CCCCCCCCCCCCCCCCCCCCCCC---------------------------
CCCCCCCCCCCCCCCCCCCCCCC---------------------------
CCCCCCCCCCCCCCCCCCCCCCC---------------------------
CCCCCCCCCCCCCCCCCCCCCCC---------------------------
CCCCCCCCCCCCCCCCCCCCCCCC--------------------------
CCCCCCCCCCCCCCCCCCCCCCCC--------------------------
CCCCCCCCCCCCCCCCCCCCCCCC--------------------------
CCCCCCCCCCCCCCCCCCCCCCCC--------------------------
CCCCCCCCCCCCCCCCCCCCCCCC--------------------------
CCCCCCCCCCCCCCCCCCCCCCCCC-------------------------
CCCCCCCCCCCCCCCCCCCCCCCCC-------------------------
CCCCCCCCCCCCCCCCCCCCCCCCC-------------------------
CCCCCCCCCCCCCCCCCCCCCCCCC-------------------------
CCCCCCCCCCCCCCCCCCCCCCCCC-------------------------
CCCCCCCCCCCCCCCCCCCCCCCCC-------------------------
CCCCCCCCCCCCCCCCCCCCCCCCCC------------------------
CCCCCCCCCCCCCCCCCCCCCCCCCC------------------------
CCCCCCCCCCCCCCCCCCCCCCCCCC------------------------
CCCCCCCCCCCCCCCCCCCCCCCCCC------------------------
CCCCCCCCCCCCCCCCCCCCCCCCCC------------------------
CCCCCCCCCCCCCCCCCCCCCCCCCC------------------------
CCCCCCCCCCCCCCCCCCCCCCCCCC------------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCC-----------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCC-----------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCC-----------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCC----------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCC----------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC---------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC---------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCCC---------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC--------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC--------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC--------------------
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC--------------------
Max: 25
Depends on your interpretation of the problem - there's no "melting" if you do a second rotation because there's no "D" left. The wall just cracks through empty space. The second example given by the OP also does not correspond to this.

I think you can only do one "melt" - for which I ended up with an answer of 22.
Last edited on
I think you can only do one "melt"

Agreed. I think that's what this sentence from the OP is trying to say:

No rotations are possible when the furnace starts heating.
@lastchance
There is indeed interpretation involved and after a web search I can't find the original of this question which would remove a few doubts I have on wtf they are describing.

On top of that the examples given have errors.

Putting all that to one side I can replicate @OP's first trial and the sequence I have followed after revising the melt/pack order the 'algorithm' is:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    display(matrix); // data supplied
    std::cout << '\n';
    
    rotate_left(matrix);
    display(matrix);
    std::cout << '\n';
    
    melt(matrix);
    pack(matrix);
    display(matrix);
    max_square(matrix);
    std::cout << '\n';
    
    melt(matrix_copy); // this matrix is a copy of the original supplied
    pack(matrix_copy);
    display(matrix_copy);
    max_square(matrix_copy);
    std::cout << '\n';


Upon which ...


--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
-------------C---------C--C--------------------C--
-----C-------C-------C-C--C------------C-------C--
-----C--C----C-------C-C--C------------C---C---C--
-----C--C----C-------C-CCCC------C-----C---C---C--
CC---C--C----C-------C-CCCCC--C--C---C-CC--C---C-C
CC---C--CC---C---C---CCCCCCC--C--C---CCCC--CC-CC-C
CC---CC-CC--CC---C---CCCCCCC--C-CC---CCCC-CCCCCC-C
CC-C-CC-CC--CC---CCC-CCCCCCC--C-CC--CCCCC-CCCCCCCC
CCCC-CCCCC--CCC--CCCCCCCCCCC-CC-CC--CCCCC-CCCCCCCC
CCCC-CCCCC-CCCCC-CCCCCCCCCCC-CC-CC--CCCCC-CCCCCCCC
CCCC-CCCCC-CCCCC-CCCCCCCCCCCCCC-CC--CCCCC-CCCCCCCC
CCCC-CCCCC-CCCCC-CCCCCCCCCCCCCCCCC--CCCCC-CCCCCCCC
CCCC-CCCCCCCCCCC-CCCCCCCCCCCCCCCCCC-CCCCCCCCCCCCCC
CCCC-CCCCCCCCCCC-CCCCCCCCCCCCCCCCCC-CCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC-CCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
Max: 20

--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--------------------------------------------------
--C-----------------------------------------------
--C-C----------C---------------------------------C
--C-C----------C-------------------------------C-C
--C-C--------C-C--C--------------C------C-C----C-C
--C-C----C---C-C--C--C-C-----CC--C------C-C----CCC
--C-C----C-C-C-C--C--C-CC---CCC--C-----CC-CCC--CCC
--C-C----C-C-C-CC-C--C-CCC--CCC--C-----CC-CCC-CCCC
-CC-C----C-C-C-CC-C--C-CCC--CCC--C-----CCCCCC-CCCC
-CCCC----C-C-C-CC-C--C-CCC--CCC--C--CC-CCCCCCCCCCC
-CCCC-C--CCC-CCCCCC--CCCCC--CCC--C--CC-CCCCCCCCCCC
-CCCCCC--CCC-CCCCCC-CCCCCC--CCC--CCCCC-CCCCCCC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max: 22


... we agree :)



Ah, that's good!

On past form I don't entirely trust this OP's model answers!
@lastchance
PS There was no melt on the second transform of mine originally as that was obviously and explicitly not part of the deal. Where the difference laid was in the re-use of the array of bricks. I used the transformed array and not the original. Doing that, as you can see, gets the 22 rather than the 25. Why non-re-use would be done in the real world is anybody's guess.


(You'll be overwhelmed to know the 'graphical/physical' approach takes about 300 lines rather than your 'logical' (Fortran) approach - I refused to turn my head or the paper and now have some useful rotation transforms for elsewhere as a consolation prize.)
Topic archived. No new replies allowed.