|
|
back to boardImportant fix! "You may assume that all intermediate values of H and all values of F fit in range [0..100000]" This should be put to problem statement, rather than to input description. Otherwise claim about periodicity is wrong. Consider the following sequence: X1=0, X2=2 A1=0, A2=0, A3=2, A4=0 B1=3, B2=2, C=5 0 2 -1 -2 -4 -8 -16 ... -(2^n) ... It's not periodic, but all coefficients (as well as initial elements) are non-negative. |
|
|