暴力出奇迹,我就知道没取余那么正当,肯定有什么奇淫怪巧,果然5分钟A掉。

HDU1576 A/B

 

#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<vector>
#include<cstring>
using namespace std;
int main()
{
    int n,i,j,T,b;
    cin>>T;
    while(T--){
        scanf("%d%d",&n,&b);
        b=b%9973;n=n%9973;
        for(i=0;i<9972;i++)
         if(n==i*b%9973){
             cout<<i<<endl;
             break;
         }
    }
    return 0;
}

 

相关文章:

  • 2021-11-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2022-02-03
  • 2021-12-11
  • 2021-04-30
  • 2021-06-08
猜你喜欢
  • 2022-12-23
  • 2021-08-11
  • 2022-01-14
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案