This page is still under construction.

Parts of this page are still being built. What you see may change.

The Exam

Time limit1sMemory limit128 MB

Summary
Arrange the numbers 1 to n so the smallest gap between neighbors is as large as possible, and print that gap or NIE when it is below k.
Level

Medium6 of 10

Topics
Math, Greedy
Solved
No attempts yet

Problem

Professor Byteoni is preparing the Bit & Byte Theory exam. He has already written nn questions and gave each one an expected difficulty coefficient. The coefficients are the natural numbers 11 to nn, and no two questions share a coefficient.

Now he is deciding in what order the questions go on the paper. He wants his students to judge the difficulty of every question on their own, so he plans to line the questions up so that the coefficients of two consecutive questions differ by at least kk. He also wants to know how strict such a requirement can get on nn questions.

Input

The first and only input line contains two integers nn and kk (2≤n≤1062 \le n \le 10^6, 1≤k≤n1 \le k \le n): the number of questions the professor prepared and the smallest difference he wants between the coefficients of two consecutive questions.

Output

Print one line with the largest integer dd such that all nn questions can be lined up so that the coefficients of every two consecutive questions differ by at least dd. If that dd is smaller than kk, the professor cannot meet his own requirement, so print the single word NIE (Polish for no) instead.

Examples2

  1. Example 1

    Input
    5 2
    
    Expected output
    2
    
  2. Example 2

    Input
    5 4
    
    Expected output
    NIE