Time

10:59:04
11 Feb 2012
ACM-ICPC Thailand Southern Region Programming Contest 2011
Left: 4 hours 1 minutes
End: 11.02.2012 15:00
Leader: Informatimukas
Five for week 22
Left: 11 hours 1 minutes
End: 11.02.2012 22:00
Leader: NuM
Version for print

Paint2D

   You can "select", "copy", "insert" and "move" in another place a figures on the screen of the graphic editor Paint2D.

   You have on the screen portrayal of individual square. What the least quantity of these operations you have to do for building of another rectangle, which size is AxB. The rectangle broke on the squares like individual square. (A is width, B is height).

 

prb18en


Specifications

   Input

   Two numbers A and B. A, B – is natural numbers, no more than 1000.

   Output

   Minimal quantity of operations.


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 5
Complexity: 55% 87/194
Classes: Dynamic programming

Example

Example input

3 2

Example output

12


← Gardener-painter Problems Degree of symmetry →