CF48B Land Lot
Description
Vasya has a beautiful garden where wonderful fruit trees grow and yield fantastic harvest every year. But lately thieves started to sneak into the garden at nights and steal the fruit too often. Vasya can’t spend the nights in the garden and guard the fruit because there’s no house in the garden! Vasya had been saving in for some time and finally he decided to build the house. The rest is simple: he should choose in which part of the garden to build the house. In the evening he sat at his table and drew the garden’s plan. On the plan the garden is represented as a rectangular checkered field $ n×m $ in size divided into squares whose side length is 1. In some squares Vasya marked the trees growing there (one shouldn’t plant the trees too close to each other that’s why one square contains no more than one tree). Vasya wants to find a rectangular land lot $ a×b $ squares in size to build a house on, at that the land lot border should go along the lines of the grid that separates the squares. All the trees that grow on the building lot will have to be chopped off. Vasya loves his garden very much, so help him choose the building land lot location so that the number of chopped trees would be as little as possible.
Input Format
The first line contains two integers $ n $ and $ m $ ( $ 1
Output Format
Print the minimum number of trees that needs to be chopped off to select a land lot $ a×b $ in size to build a house on. It is guaranteed that at least one lot location can always be found, i. e. either $ a
Explanation/Hint
In the second example the upper left square is (1,1) and the lower right is (3,2).