Power Eggs

No attempts yetTime limit1sMemory limit256 MB

Problem

Benedict bought KK identical power eggs. He owns a building and suddenly wanted to drop the eggs from different floors. The building has NN floors, numbered 11 through NN.

A power egg breaks only under one condition. There is a value FF such that an egg dropped from floor F+1F+1 or higher breaks, and an egg dropped from floor FF or lower does not. FF is an integer between 00 and NN.

Benedict may drop an egg from any floor he likes, as many times as he likes, until it breaks. An egg that survives can be dropped again, and a broken egg is gone for good. Find the smallest number of drops that pins down FF even in the worst case.

Take a building with 33 floors and a single egg. Benedict has to try floor 11 first, then floor 22 if the egg survives, then floor 33 if it still survives. With one egg he cannot skip a floor, so the worst case costs three drops.

Input

The first line has the number of test cases TT (1T100001 \le T \le 10000).

Each of the next TT lines has the height of the building NN and the number of eggs KK, separated by a single space (1N20000000071 \le N \le 2000000007, 1K321 \le K \le 32).

Output

For each test case, print one line with the minimum number of drops needed to pin down FF.

If that number is greater than 3232, print Impossible instead of a number. Benedict does not have the energy for that many drops.