Error
|
|
---|---|
@Ibrahim Nash | 5761 |
@blackshadows | 5701 |
@akhayrutdinov | 5111 |
@mb1973 | 4989 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 938 |
@bt8816103042 | 739 |
@SHOAIBVIJAPURE | 428 |
@codeantik | 412 |
@SherlockHolmes3 | 407 |
@neverevergiveup | 348 |
@mahlawatep | 347 |
@shalinibhataniya1097 | 343 |
@murarry3625 | 333 |
@saiujwal13083 | 326 |
@rohitanand | 314 |
Complete Leaderboard |
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.
Input:
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:
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 .
Constraints:
1 <= T <= 1000
1 < N <= 10000
Example:
Input:
2
5
12
Output:
1 5
2 33
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes