Jane Street interview question

30-sided dice problem.