2018 Цикл Интернет-олимпиад для школьников
One day, fate brought Kratos to chariot races, and he decided to try his luck by putting a few coins on the outcome of the race. Of course, the warrior is not going to spend money just like that, and therefore he firmly decided that he would bet only if he could win in any outcome of the competition.
Kratos decided to spend n coins on the bet: he will put some of them on the victory of the chariot of his choice, the rest on his defeat. Initially, only x and y are known - the coefficient by which the bet amount is multiplied when the charioteer wins, and the coefficient by which the bet amount is multiplied when he is defeated. In addition, the player will be reimbursed the full cost of that part of the bet that was spent on the outcome.
That is, for example, if a coins were bet on the chariot's victory, and the chariot really won the race, then Kratos will receive a + x * a coins, and if he loses, then (n - a) + y * (n - a) coins.
The warrior is not very strong in mathematics, so you have to help him understand whether it is possible to distribute the coins so that the amount he receives is strictly higher than the bet for any result of the race. He is also interested what maximum amount he can win at the best outcome for him. If possible, he is interested in all such ways of breaking coins.
First line contains the number of coins n (1 ≤ n ≤
109). Second line contains two real numbers x and y (
10-5 ≤ x, y ≤
104, number of decimal positions does not exceed 5) - the chariot victory and defeat rates.
If it is not possible to distribute the coins in such a way that they are guaranteed to win, print -1.
Otherwise, in the first line print one real number - the maximum possible gain at the best outcome (in this case, with an alternative outcome, Kratos should still remain better off). The absolute or relative error of this number should not exceed
In the second line print the number of partitions k at which the maximum gain is achieved. In each of the following k lines print two numbers a and b - the number of coins bet for a win and the number of coins bet for losing. Splits should not be repeated. The splits must be displayed in ascending order of the amount set for the victory of the charioter. It is guaranteed that the number of such partitions is finite.
6 1 2
8 3 1
12.0000000 1 3 5