DescriptionInputOutput 0/1,概率为1 应输出1/1。Sample Inputinput 1 2 3 1 1 1 1 1 2 2 3 1 input 2 3 1 2 1 1 1 5 1Sample Outputoutput 1 1/12 output 2 1/3Hint 1≤t,n≤1000, 1≤ak ,d≤10, 1≤x1Source