Closed komalvhanmane closed 2 years ago
Nikita Rajendra Miraje Cummins college of engineering for women,Pune Dept-Electronics and Telecommunication,2nd year Can you plz assign this issue to me,I would like to work on this issue.
Name-Gayatri Chaudhari College-Cummins college of engineering ,Pune Department-Computer Department I would like to work on this issue
@GayatriChaudhari1281 I think you have completed 2 PR's So try finding another repo's . we are assigning max 2 issue's per student. :) All the best 👍
Ok. No problem. Thank you
@NikitaMiraje I have assigned you this issue . work on it :)
@komalvhanmane .....I tried solving this issue but i am unable to solve it..... So plz can you unassign me this issue and assign other issues.
@NikitaMiraje Okay No problem .
Name- vishwa dere College-Cummins college of engineering ,Pune Department-Computer Department, TY I would like to work on this issue
@vishwadere I have assigned you this issue . work on it :)
Barbara got really good grades in school last year, so her parents decided to gift her with a pet rabbit. She was so excited that she built a house for the rabbit, which can be seen as a 2D grid with R rows and C columns.
Rabbits love to jump, so Barbara stacked several boxes on several cells of the grid. Each box is a cube with equal dimensions, which match exactly the dimensions of a cell of the grid.
However, Barbara soon realizes that it may be dangerous for the rabbit to make jumps of height greater than 1 box, so she decides to avoid that by making some adjustments to the house. For every pair of adjacent cells, Barbara would like that their absolute difference in height be at most 1 box. Two cells are considered adjacent if they share a common side.
As all the boxes are superglued, Barbara cannot remove any boxes that are there initially, however she can add boxes on top of them. She can add as many boxes as she wants, to as many cells as she wants (which may be zero). Help her determine what is the minimum total number of boxes to be added so that the rabbit's house is safe.
Input The first line of the input gives the number of test cases, T. T test cases follow.
Each test case begins with a line containing two integers R and C.
Then, R lines follow, each with C integers. The j-th integer on i-th line, Gi,j, represents how many boxes are there initially on the cell located at the i-th row and j-th column of the grid.
Output For each test case, output one line containing Case #x: y, where x is the test case number (starting from 1) and y is the minimum number of boxes to be added so that the rabbit's house is safe.
Input : 3 1 3 3 4 3 1 3 3 0 0 3 3 0 0 0 0 2 0 0 0 0
Output : Case # 1: 0 Case # 2: 3 Case # 3: 4