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).
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 secondsMemory Limit: 64 MB
Balls for the passed test: 5
Complexity: 55% 87/194
Classes: Dynamic programming
Example
Example input3 2 |
Example output12 |
| ← Gardener-painter | Problems | Degree of symmetry → |
