Grid Job Scheduling

Time limit1sMemory limit128 MB

Problem

A company has an N x N grid of one-second jobs. Each cell of the grid is one job.

To start the job at cell (x, y), the jobs at (x, y-1) and (x-1, y) must already be finished, if those cells exist.

The picture shows the jobs that must be completed before the gray cell can be started.

There are K computers available for this work. One computer can perform one job at a time, and every job takes exactly one second. It is not necessary to use all computers every second.

Find the minimum time needed to finish all jobs.

Input

The first line contains two integers N and K.

1 <= N, K <= 10^9

Output

Print the minimum number of seconds needed to finish all jobs.