#K9271. Taco Grid Operations

    ID: 38258 Type: Default 1000ms 256MiB

Taco Grid Operations

Taco Grid Operations

Problem Statement

Given an n x n grid (initially all cells are 0), you are allowed to perform the following operation any number of times:

  • Select any sub-grid and increment every cell in that sub-grid by 1.

Your goal is to make every cell in the grid equal to a target positive integer m. An optimal strategy is to apply the operation to the entire grid each time. Therefore, the minimum number of operations required is equal to m, which can also be expressed by the formula: $$\text{Operations}=m.$$

Determine this minimum number of operations.

inputFormat

The input consists of a single line containing two space-separated integers n and m, where:

  • n (1 ≤ n ≤ 105): the size of the grid (n x n)
  • m (1 ≤ m ≤ 109): the target value for all grid cells

Note that although n is given, the answer depends solely on m under optimal operations.

outputFormat

Output a single integer that represents the minimum number of operations required to make all grid cells equal to m.

## sample
3 2
2