- 曹冲养猪
- 2015-08-01 14:49:10 @
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
long long n, a, b;
scanf("%lld%lld%lld",&n,&a,&b);
long long int gcd = a, ans = b;
for(int i=2; i<=n; i++){
scanf("%lld%lld",&a,&b);
while(ans % a != b)
ans += gcd;
gcd *= a;
}
printf("%lld\n",ans);
return 0;
}
0 条评论
目前还没有评论...