The above problem is also solvable with dynamic programming
f( roll , face , sum ) with three states or with 2 states too
where f( i , j , k ) = number of ways to make k sum ending with jth value in ith roll of dice.
Complexity will be : O( roll * face * sum ) or let say O( N ^ 3 ) with dp
with coefficient we have to calclaulate ( 0 + x + x^2 + x^3 .... X^face ) ^ roll
then again it will be : O(N ^ 3 ) , if we are multiplying two polyinomials in O(N^2) and if we use fft polynomial divide and conq. then it will be O(N^2logN) which is very fast as compared to above.
So if we increase some constraint on the third problem or number of test cases. Then go for fast multiplication ( FFT )