During the first small competition, I couldn't even understand the question. Later I heard the teacher explain it and understood the question, but I still couldn't! Success !!!
#¥ # ¥ # % ¥ % ...... ¥ % ...... &...... & * () & * (% ...... & Amp; % ¥ %
Why! Because at that time, I would not be able to quickly find the power, right, that is, to quickly find the power. The value of this question is to teach me to learn this!
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
Question: Let's give you the first three numbers of a sequence. This sequence is either an equal-difference sequence or an equal-ratio sequence. Let's give you an n and find the nth item of the sequence (haha, let's do it !)
**************************************** **************************************** **************************************** ***************************
#include<stdio.h>#define N 200907__int64 pow(__int64 q,__int64 n){__int64 ans=1;while(n){if(n&1)ans=ans%N*(q%N)%N;n/=2;q=q%N*(q%N)%N;}return ans;}int main(){__int64 t,a,b,c,q,d,n,ans;scanf("%I64d",&t);while(t--){scanf("%I64d%I64d%I64d%I64d",&a,&b,&c,&n);if(2*b==a+c){d=b-a;ans=(a+(n-1)*d%N)%N;}else{q=b/a;ans=a*pow(q,n-1)%N;}printf("%I64d\n",ans);}return 0;}