POSAO
시간 제한: 1000ms메모리 제한: 128MB출처: CHC 2012 Junior Croatian Olympiad in Informatics - Exam #2BOJ 3087
이 문제는 본문 이미지 일부가 표시되지 않습니다. 텍스트만으로 풀이가 어려울 수 있습니다.
문제
Little Domagoj has his hands full of work. His jobs are organized in NxN matrix in such a way that each cell represents one job. He can start doing job at cell (x, y) if and only if jobs at cells (x, y-1) and (x-1, y) are done (if they exist).
[이미지 1]
On the picture the required jobs are shown for gray cells.
Domagoj has K computers which he will use for doing jobs. One computer is able to do at most one job in one second. Also, all computers need not be used all the time. Help Domagoj and organize order in which computers will do jobs in least possible time.
입력
In the first line there are two integers N and K (1 ≤ N, K ≤ 109), dimensions of matrix and number of computers.
출력
Print least possible time in which all jobs can be done.
예제
예제 1
입력
3 2
출력
6
예제 2
입력
5 1
출력
25
예제 3
입력
4 4
출력
7
코드를 제출하려면 로그인하세요.