Time Limit: 1000MS
Memory Limit: 10000K
k N-1 C[k] = ∑ A[i] * B[k-i] + ∑ A[i] * B[N+k-i]. i=0 i=k+1here C ? the result of the operation, even also presented in an array - not necessarily sly number. This operation we will denote by <*> symbol. Moreover, there is also module operation over the results of 'Star Multiplication':
(C mod Q) [i] = C[i] mod Q,where Q is a positive integer. We are given a sly number A and a module Q. We need to find such 'inverse sly number' B: (A * B) mod Q = ONE.