Naive Chef (Python)

In the problem Naive Chef when I write the following code the sample test case’s output and my output was same. But when I submit it was completly wrong except the 1st one of the subtask one. Please help me.

Test = int(input())
for t in range(Test):
  n,a,b = map(int,input().split())
  n_i = list(input())
  n_i = ' '.join(n_i).split()
  n_i = [*set(n_i)]
  for i in range(len(n_i)):
    n_i[i]= int(n_i[i])
  pa = a/len(n_i)
  pb = b/len(n_i)
  x = pa*pb