Last active
July 5, 2016 15:52
-
-
Save varundey/62f4276b9763647bf3d5114262d4ba9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def value(k, degree, coefficients): | |
ans = 0 | |
for i in range(degree+1): | |
ans += coefficients[i]*pow(k,i) | |
return ans | |
degree = input() | |
coefficients = map(int,raw_input().split()) | |
t=input() | |
while t!=0: | |
t-=1 | |
print value(input(), degree, coefficients) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment