Problem E
Rust
Languages
en
is

Benni has just started playing the game Rust. This is an
extremely exciting game full of action. But in Rust you can
also build. Benni has been collecting rocks all day so he can
build his own home. He has decided to build a square wall with
dimensions
Benni never realized how hard it would be to pick a spot for
his home. Benni has a map with dimensions
Benni has no idea where he should build his wall. He asks if you can tell him where to build his wall to maximize the total worth of valuables he can possess.
Input
The first line of the input contains two integers
Then
Output
Output a single integers, the maximum total value of the
valuables Benni can gain possession of, assuming he builds his
wall in the optimal spot. If there is no spot for Benni to
build his home then output
Scoring
Group |
Points |
Constraints |
1 |
23 |
|
2 |
27 |
|
3 |
50 |
No further constraints. |
Sample Input 1 | Sample Output 1 |
---|---|
5 3 ..... .5.7. ...#. .9... 2.... |
5 |
Sample Input 2 | Sample Output 2 |
---|---|
5 5 ..... .333. .333. .333. ..... |
27 |
Sample Input 3 | Sample Output 3 |
---|---|
5 5 ....# .333. .333. .333. ..... |
0 |