Problem B 算术
Description
要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973)= 1,gcd表示最大公约数)。
Input
每组数据有两个数n(0<= n < 9973)和B(1<= B <= 10^9) ,以EOF为结尾。
Output
对应每组数据输出(A/B)%9973。
Sample Input
Sample Output
7922
6060
#include <iostream>
#include <cstdio>
#include <string.h>
using namespace std;
int main()
{
int numcase;
long long n,b;
while(scanf("%lld %lld",&n,&b)!=EOF)
{
int x;
for(int i = 0; i < 9973; ++i)
{
if(( b * i - n ) % 9973 == 0)
{
x = i;
break;
}
}
printf("%d\n",x);
}
return 0;
}