Problem D
Veggja Kalli
Languages
en
is

Kalli is quite the carpenter and has a particular penchant
for walls. Today Kalli received a new project. An apartment is
being built, the plans for which are given by
Kalli was asked to break the minimum amount of walls such
that there would be a room of size exactly
Input
The first line of the input contains two integers
The next line contains a string with
Output
A single line containing the minimum number of walls Kalli needs to break to satisfy the requirements should be printed. If no such number exists the program should instead print Neibb.
Scoring
Group |
Points |
Constraints |
1 |
28 |
|
2 |
32 |
|
3 |
40 |
No further constraints |
Sample Input 1 | Sample Output 1 |
---|---|
7 2 #-#-#-# |
Neibb |
Sample Input 2 | Sample Output 2 |
---|---|
8 3 #-###--# |
1 |
Sample Input 3 | Sample Output 3 |
---|---|
4 3 #--# |
Neibb |