SP15381 BFGCD - Cut The Rope
Description
Budi is a rope seller, He initially has two ropes to sell with length **a** and **b** where **a** and **b** is positive integer less than 10 $ ^{100} $ . One day he meet with strange rich customer, the customer want to buy all rope with equal length only. Budi has an idea to sell all his rope to that customer: cut the rope until all his rope become equal length. Because Budi want maximum profit, he need to minimize the "cut" operation. But the customer doesn't like waiting, so budi must calculate and do "cut" operation quickly. _The customer can wait 60 seconds only, Budi can cut the rope in exactly 10 seconds, so Budi have 50 seconds to calculate number of "cut" operation needed._ Help Budi to calculate number of "cut" operation and length of each rope after cutting process done. But unfortunately your modern calculator isn't working, so the only way to do is using brainf\*\*k calculator, with 8 valid commands only. Will you help Budi?
Input Format
First line of input there is an integer **T**
Next **T** lines there're two positive integer **a** and **b** denoting length of rope that Budi has initially. Separated by a space (ASCII:32).
Each line is terminated with newline character (ASCII:10).
Output Format
For each case, output two number: first number is minimum number of cut operation, and second number is length of each rope after cutting process done.