{"raw_statement":[{"iden":"statement","content":"The world famous scientist Innokentiy has just synthesized the potion of immortality. Unfortunately, he put the flask with this potion on the shelf where most dangerous poisons of all time were kept. Now there are n flasks on this shelf, and the scientist has no idea which of them contains the potion of immortality.\n\nFortunately, Innokentiy has an infinite amount of rabbits. But the scientist doesn't know how exactly these potions affect rabbits. There is the only thing he knows for sure. If rabbit tastes exactly k potions from the flasks on the shelf, it will survive if there was the immortality potion among them and die otherwise. If rabbit tastes the number of potions different from k, the result will be absolutely unpredictable, so the scientist won't make such experiments no matter what.\n\nThe scientist intends to minimize the amount of lost rabbits while searching for the potion of immortality. You should determine how many rabbits he has to sacrifice in the worst case.\n\nThe only line contains two integers separated by space — n and k (1 ≤ n ≤ 2000, 1 ≤ k ≤ n) — the number of flasks on the Innokentiy's shelf and the number of potions Innokentiy will give to a single rabbit to taste.\n\nIf the scientist cannot determine which flusk contains the potion of immortality, output «_-1_». Otherwise, output a single integer — the minimal number of rabbits that Innokentiy will sacrifice in the worst case while searching for the potion of immortality.\n\n"},{"iden":"input","content":"The only line contains two integers separated by space — n and k (1 ≤ n ≤ 2000, 1 ≤ k ≤ n) — the number of flasks on the Innokentiy's shelf and the number of potions Innokentiy will give to a single rabbit to taste."},{"iden":"output","content":"If the scientist cannot determine which flusk contains the potion of immortality, output «_-1_». Otherwise, output a single integer — the minimal number of rabbits that Innokentiy will sacrifice in the worst case while searching for the potion of immortality."},{"iden":"examples","content":"Input3 2Output1Input4 2Output2"}],"translated_statement":null,"sample_group":[],"show_order":[],"formal_statement":"Let $ n, k \\in \\mathbb{Z} $ with $ 1 \\leq k \\leq n $.\n\nDefine the set of flasks $ F = \\{1, 2, \\dots, n\\} $, exactly one of which contains the immortality potion.\n\nA rabbit is administered exactly $ k $ flasks' contents. It survives if and only if the immortality potion is among those $ k $ flasks; it dies otherwise.\n\nThe scientist may design multiple non-overlapping or overlapping tests (each using exactly $ k $ flasks), and observes the survival/death outcome of each rabbit.\n\nLet $ m $ be the minimal number of rabbits (tests) required in the worst case to uniquely identify the single flask containing the immortality potion.\n\nIf no such identification is possible under the constraint that each test uses exactly $ k $ flasks, output $ -1 $.\n\nOtherwise, output $ m $.\n\n**Constraints:**\n- $ 1 \\leq n \\leq 2000 $\n- $ 1 \\leq k \\leq n $\n\n**Objective:**\nDetermine the minimal $ m \\in \\mathbb{N} $ such that there exists a family of $ m $ subsets $ T_1, T_2, \\dots, T_m \\subseteq F $, each of size $ |T_i| = k $, and the mapping $ f: F \\to \\{0,1\\}^m $ defined by\n$$\nf(j) = ( \\mathbf{1}_{j \\in T_1}, \\mathbf{1}_{j \\in T_2}, \\dots, \\mathbf{1}_{j \\in T_m} )\n$$\nis injective.\n\nIf no such family exists, output $ -1 $.","simple_statement":"You have n flasks, one contains an immortality potion.  \nA rabbit dies if it tastes exactly k potions and the immortality potion is among them.  \nIf it tastes any number other than k, the result is unpredictable — so you can't use that.  \nYou must find the flask with the potion using rabbits that each taste exactly k flasks.  \nWhat’s the minimum number of rabbits needed in the worst case?  \nIf it’s impossible, output -1.","has_page_source":false}