biinfinite

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

A bi-infinite sequence means a sequence that is infinite in both directions. In other words, it means a function whose domain is the set of all integers. The writer of this problem defined their bi-infinite sequence (K_n)_nZ(K\_n)\_{n\in\mathbb Z} and called it "KSA bi-infinite sequence" with a parameter tt where tt is a positive integer. It satisfies the following for all integers nn.

  • K_n=5701.5+0.5(1)nK\_n=5701.5+0.5\cdot(-1)^n if 0n\<t0\le n\<t
  • K_n=_j=1t(t+1j)K_njK\_n=\sum\_{j=1}^t(t+1-j)K\_{n-j}

Write a function biinfinite:

  • input parameter: two int-type objects whose values are tt and nn, respectively, where 1t81\le t\le 8 and n1012|n|\le10^{12}
  • return value: the int-type object whose value is K_nMK_nM\lfloor K\_n\rfloor-M\left\lfloor\frac{K\_n}M\right\rfloor where M=202112210950M=202112210950 and K_nK\_n is the nn-th term of KSA bi-infinite sequence with a parameter tt