Polynomial and Queries 2
Time limit5sMemory limit512 MB
Given a degree-N polynomial and K query points, evaluate the polynomial at every point modulo 1,030,307.
- Level
Hard8 of 10
- Topics
- Math, Number theory, Divide and conquer, Brute force
- Solved
- No attempts yet
Problem
You are given a polynomial of degree with integer coefficients.
Given integers , write a program that computes .
Input
The first line gives the degree of the polynomial, . ()
The second line gives integers. The -th integer is the coefficient of the polynomial. ()
The third line gives the number of integers, . ()
The fourth line gives . ()
Output
Print lines in total. The -th line contains the remainder of divided by .