Codeforces Round 767 (Div. 1) D2. Game on Sum (Hard Version)(博弈 期望 dp 贡献)
题目t(tusingnamespacestd;#definerep(i,a,b)for(inti=(a);i=(b);--i)typedeflonglongll;typedefdoubledb;typedefpairP;#definefifirst#definesesecond#definepbpush_back#definedbg(x)cerr>=1)if(n&1)res=1ll*res*x%m