Question: C Programming Language Imgur Mirror: https://i.imgur.com/QdJSTXi.png Jojo doesn't like strawberry. One day, Lili give him a cake. She forgot that Jojo doesn't like strawberry. To
C Programming Language

Imgur Mirror: https://i.imgur.com/QdJSTXi.png
Jojo doesn't like strawberry. One day, Lili give him a cake. She forgot that Jojo doesn't like strawberry. To respect her intention, he will eat the cake. His way of eating is very unique. Each time he eats, he chooses a row or a column that does not contain any strawberries and contains at least one cake cell that has not been eaten before, and eats all the cake cells there. He may decide to eat any number of times. Given a rectangular cake, represented as an R x C grid. Each cell either has an strawberry, or is empty Please output the maximum number of cake cells that Jojo can eat. Format Input The input begins with an integer T indicating the number of test cases. In each test case, the first line contains two integers r and c, denoting the number of rows and the number of columns of the cake. The next R lines each contains C characters the j-th character of the i-th line denotes the content of the cell at row i and column j, and is either one of these: character denotes a cake cell with no strawberry S' character denotes a cake cell with an strawberry Format Output Output the maximum number of cake cells that the Jojo can eat. Constraints Sample Input Sample Output Case #1: 8 Explanation # denotes a cake cell that has been eaten by Jojo. Below described the way Jojo eat the cake 1st S. 2nd S# #S
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
