#Lutece1048. Bob's vector
Bob's vector
Migrated from Lutece 1048 Bob's vector
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Bob has a vector with elements, called vector . Now Alice gives him a vector with elements.
Then he gets a new vector , in which $A_i = (B_1 \times X_i+ B_2 \times X_i ^ 2 \cdots +B_{m-1} \times X_i ^{m-1}+B_m \times X_i^m)$ mod .
Now Alice wants to find a peak position in vector , and a peak position is a position whose value is greater than both of its neighbors. You may assume that .
As is known to everyone of you, Bob loves Alice very much. Could you tell Bob the answer to help Bob leave a good impression on Alice.
Input
The frist line contains integers , indicating the size of vector and the size of vector .
The second line contains integers , indicating the element in the vector .
The last line contains integers , indicating the element in the vector .
It is guaranteed that , and .
Output
Print a single integer, which denotes a peak position. If there are multiple solutions, you may print any of them.
Samples
3 2
2 1 3
1 1
1
Note
. So , are both OK
Resources
The 13th UESTC Programming Contest Final