Given a number N less than 10000, calculate total number of permutations of it and also the sum of all permutations including that number itself.
For example, let us take N to be 12. There exists 2 permutations of that number '12' and '21'. Sum of these two permutations is 33. So output will be 2 33.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow.
The first line of each Test case contains a positive number N.
Output in a single line the number of distinct permutations of that number and the sum of all permutations of that number including that number separated by space .
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.