Time Limit: 3000ms
Memory Limit: 65536kb
DescriptionNow, you are given three positive A, B, C, your task is to compute the first B digits and the last C digits of the factorial of A.
For example A=5, B=2, C=1. Then A! =120, so you should output 12 0 separated by one blank.
InputThe first line, an integer T, representing T test cases below. (T<=200).
Each test case contains three integers: A (1<=A<=10^8), B (1<=B<=50) and C (1<=C<=100).
Notice: No illegal case is permitted. For example, the condition A=4, B=10, C=10 is not permitted in the input data.
OutputFor each case, output the first B digits and the last C digits of the factorial of A separated by one blank.
2 5 2 1 8 2 2
12 0 40 20