Pappu is confused between 6 & 9 . He works in billing department of abc company and his work is to return the remaining amount to the customers. If actual remaining amount is given we need to find the maximum possible extra amount given by the pappu to the customers.
For ex:- actual remaining amount = 56
so, maximum possible extra amount = (59 - 56 ) = 3
For each test case, output the maximum possible extra amount in newline.
• 1 ≤ T ≤ 102
• 1 ≤ N≤ 10000001
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.