Harry Potter just found out that there were not only $$$7$$$ but $$$8$$$ horcruxes. The vicious Voldemort stored the last one in the middle of a desert. To protect the 8th horcruxes, vicious Voldemort cursed the desert in a way that Harry Potter can only pass it by walking the entire distance which takes him $$$d$$$ days in total. The amount of water that any person can carry while being in the desert is also limited to $$$c$$$ units. As Harry Potter cannot carry enough water by himself, he takes some of his beloved friends with him that he lured into joining the secret club Dumbledore's Army which he founded a few years back during his school time in Hogwarts.
While Harry Potter and each of his friends can carry $$$c$$$ units of water, they need to drink one unit of water per day. At the end of each day, Harry Potter can decide who of his friends will accompany him further to the middle of the desert and who has to return to the origin the next day. When travelling back, his friends use the exact same route as on their forward journey in order not to get lost. Thus, they need the same number of days they travelled so far to get back to the origin.
Harry Potter and any of his friends can pass on an integer amount of water units to any of their peers. However, if any person is sent home, he must be given enough water to reach the origin safely.
Harry Potter does not want to put his friends at danger. Therefore, it is sufficient for him if he reaches the middle of the desert alone to destroy the $$$8$$$th horcrux by himself. Once the horcrux is destroyed, it magically changes to a portkey that takes Harry Potter safely back to Hogwarts.
What is the minimum number of friends that Harry Potter needs to take with him in order to reach the middle of the desert?
The input consists of:
If it is possible to reach the middle of the desert, output one integer indicating the minimum number of friends needed. Otherwise, output impossible.
4 3
1
5 3
impossible
Harry Potter takes $$$1$$$ friend with him. Both start out with $$$3$$$ units of water. After the first day, both have only $$$2$$$ units of water left. Harry Potter takes away one unit of water from his friend so that Harry Potter now has $$$3$$$ units of water and his friend only $$$1$$$ unit of water. On the second day, the friend travels back to the origin. Harry Potter continues walking to the middle of the desert and uses up all his water until he reaches the desert's center at the end of day $$$4$$$.