紲星あかりのE - Product of Arithmetic Progression【atcoder】

紲星あかりのE - Product of Arithmetic Progression【atcoder】

この動画の問題: https://atcoder.jp/contests/m-solutions2019/tasks/m_solutions2019_e わしの提出:   https://atcoder.jp/contests/m-solutions2019/submissions/9895751 問題文(引用)以下のような、n項からなる等差数列を考えます。x,x+d,x+2d,…,x+(n−1)dこの数列のすべての項の積はいくつでしょうか? その積を 1,000,003 で割った余りを計算してください。この形式の問いが Q 個与えられます。 i 個目の問いでは、x=xi,d=di,n=ni の場合の答えを計算してください。1≤Q≤1050≤xi,di≤1,000,0021≤ni≤10**9入力中の値はすべて整数である。例:Q=2x=7,d=2,n=4>7*9*11*13%1,000,003=9009x=12345,d=67890, n=2019 >12345*80235*148125*216015*… %1,000,003=916936

http://www.nicovideo.jp/watch/sm36319784