Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
9 lines (9 sloc) 196 Bytes
T=input()
for a in range(T):
N=input()
b=[int(next) for next in raw_input().split(' ')]
ans=1
for x in b:
ans*=x**(x-1)
ans*=sum(b)**(N-2)
print int(ans)%1000000007
You can’t perform that action at this time.