/in/foo.cc: In function 'int main()':
/in/foo.cc:12:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1;i<=n;++i)std::cin>>a[i]>>c[i],cj*=a[i];
~^~~
/in/foo.cc:13:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1;i<=n;++i)b[i]=cj/a[i];
~^~~
/in/foo.cc:14:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1;i<=n;++i)ans=(ans+b[i]*c[i]*Work(b[i],a[i]))%cj;
~^~~