图片说明

观察原式 利用A^K 是0 进行错位相减
所以答案就是E-A

https://ac.nowcoder.com/acm/contest/view-submission?submissionId=43812151