Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 4 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 17 Sep 2017 My Price 7.00

N columns of unit squares

Due to the decreasing quality of students in each new session , all the teachers formed a committee and came up with a decision of changing the seating pattern of students in class.

 

The classroom can be regarded as a rectangle of M rows by N columns of unit squares, where each unit square represents a seat. The teachers decided to set the following rule to prevent cheating. Assume a student is able to see his left, right, upper-left, and upper-right neighbors' answer sheets. The assignment of seats must guarantee that nobody's answer sheet can be seen by any other student.

 

Some seats of the classroom are broken and no student can be made to sit on the broken seat.

 

Your goal is to find the maximum number of students that can be placed in the classroom so that no one can cheat.

 

 

Input

 

The first line of input gives the number of cases, C. C test cases follow. Each case consists of two parts.
The first part is a single line with two integers M and N: The height and width of the rectangular classroom.
The second part will be exactly M lines, with exactly N characters in each of these lines. Each character is either a '.' (the seat is not broken) or 'x' (the seat is broken, lowercase x).

 

Output

 

For each test case, output one line containing "Case #X: Y", where X is the case number, starting from 1, and Y is the maximum possible number of students that can take the exam in the classroom.

 

Constraints

C = 20 1 = M = 80 1 = N = 80

Example

Input: 4 2 3 ... ... 2 3 x.x xxx 2 3 x.x x.x 10 10 ....x..... .......... .......... ..x....... .......... x...x.x... .........x ...x...... ........x. .x...x.... Output: 4 1 2 46

Answers

(5)
Status NEW Posted 17 Sep 2017 05:09 AM My Price 7.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)