Chemistry
시간 제한1초메모리 제한1024 MB
각 시험관은 1단위로 시작하고, a를 b에 부으면 b가 두 배가 된다. 시험관 1에 정확히 k단위가 남도록 붓는 순서를 만들거나, 불가능하면 -1을 출력한다.
문제
Android Vasya attends his Chemistry classes. During the latest semester Vasya's group is studying dry liquids. At the laboratory work on mixing liquids Vasya has got oxygen oxide. An important feature of this substance is its unpredictable consequences after mixing. The liquid is stable only after mixing it in one to one proportion.
Vasya has got test tubes, with one nano liter of oxygen oxide in each. Due to the features of the oxide Vasya pours liquids from test tube to test tube in such a way that the resulting liquid volume in test tube doubles. To set the experiment successfully Vasya needs to make exactly nano liters of the oxide in any of the test tubes. Help him do this.
입력
The only line contains two integers --- and (, ).
출력
Output the sequence of transfers (i. e. pouring from one test tube to another), which results in exactly nano liters of the oxide being in the first test tube. In the first line output the number of transfers of the liquid (). Then in lines output pairs of integers , (), meaning that Vasya needs to pour the oxide from the test tube number to the test tube number . If such sequence doesn't exist output . If there are several solutions output any. It is guaranteed that if there is a sequence of transfers to get nano liters then there is one with no more than transfers.