HDU 5073 Galaxy 2014 Asia AnShan Regional Contest 规律题
推公式#include
#include
#include
#include
#include
usingnamespacestd;
typedeflonglongll;
constintN=50000+3;
lla[N],b[N];
intmain(){
intT,n,m,len;
llx,sum,ans;
scanf("%d",&T);
while(T-->0){
scanf("%d%d",