标签:mission ane == gcd sam memory input mem scan
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 19327 Accepted Submission(s): 8044
#include<stdio.h> int gcd(int a,int b){ //递归 if(a%b==0) return b; else return gcd(b,a%b); } int main(){ int n,i,a,b,c; while(~scanf("%d",&n)){ while(n--){ scanf("%d%d",&a,&c); b=2*c; while(gcd(a,b)!=c) b+=c; printf("%d\n",b); } } return 0; }
==
标签:mission ane == gcd sam memory input mem scan
原文地址:http://www.cnblogs.com/ZERO-/p/7134463.html