Many dimensional dice

Problem Name:
Many dimensional dice
Site:CodeForces
Links:
Tags:
Problem setters: