# [TJOI2009]猜数字

Description

Input

Output

Sample Input
3
1 2 3
2 3 5

Sample Output
23

$b_i|n-a_i$，意味着$n\equiv a_i(\%b_i)$，所以我们列个方程
$\begin{cases}n\equiv a_1(\%b_1)\nonumber\\n\equiv a_2(\%b_2)\nonumber\\...\end{cases}$

/*program from Wolfycz*/
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define inf 0x7f7f7f7f
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned int ui;
typedef unsigned long long ull;
inline char gc(){
static char buf[1000000],*p1=buf,*p2=buf;
}
template<typename T>inline T frd(T x){
int f=1; char ch=gc();
for (;ch<'0'||ch>'9';ch=gc())   if (ch=='-')    f=-1;
for (;ch>='0'&&ch<='9';ch=gc()) x=(x<<1)+(x<<3)+ch-'0';
return x*f;
}
int f=1;char ch=getchar();
for (;ch<'0'||ch>'9';ch=getchar())  if (ch=='-')    f=-1;
for (;ch>='0'&&ch<='9';ch=getchar())    x=(x<<1)+(x<<3)+ch-'0';
return x*f;
}
inline void print(int x){
if (x<0)    putchar('-'),x=-x;
if (x>9)    print(x/10);
putchar(x%10+'0');
}
namespace Math{
ll mlt(ll _a,ll _b,ll _p){
ll _c=(ld)_a*_b/_p;
ll _Ans=_a*_b-_c*_p;
if (_Ans<0) _Ans+=_p;
return _Ans;
}
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
void exgcd(ll a,ll b,ll &x,ll &y){
if (!b){x=1,y=0;return;}
exgcd(b,a%b,x,y);
ll t=x; x=y,y=t-a/b*y;
}
ll Ex_GCD(ll a,ll b,ll c){
ll d=gcd(a,b),x,y;
if (c%d)    return -1;
a/=d,b/=d,c/=d;
exgcd(a,b,x,y);
x=(mlt(x,c,b)+b)%b;
return x;
}
}
int A[15],m[15];
int main(){
}