标签:des style blog color io for strong 数据 sp
Description
Input
Output
Sample Input
Sample Output
1 #include<cstdio> 2 3 int T,n,B,x,y; 4 5 int extend_eculid(int a,int b,int &x,int &y){ 6 if(!b){ 7 x=1;y=0; 8 return a; 9 } 10 int d=extend_eculid(b,a%b,x,y); 11 int t=x;x=y;y=t-a/b*x; 12 return d; 13 } 14 15 int main(){ 16 scanf("%d",&T); 17 while(T--){ 18 scanf("%d%d",&n,&B); 19 int d=extend_eculid(B,9973,x,y); 20 printf("%d\n",((x*n/d%9973)+9973)%9973); 21 } 22 }
标签:des style blog color io for strong 数据 sp
原文地址:http://www.cnblogs.com/kingnight/p/4014763.html