mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
16 lines
259 B
C++
16 lines
259 B
C++
|
#include<stdio.h>
|
||
|
int main()
|
||
|
{
|
||
|
int T,n,i;
|
||
|
long long int B;
|
||
|
scanf("%d",&T);
|
||
|
while(T--)
|
||
|
{
|
||
|
scanf("%d%lld",&n,&B);
|
||
|
for(i=0;i<=10000;i++)
|
||
|
if((B*i-n)%9973==0) break;
|
||
|
printf("%d\n",i);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|