题意:给出一个命题:在b进制下,都有一个数的数位和可以整除x,则这个数可以整除x。给出b和x,问在这种情况下命题是否成立。
#include<iostream>
#include<cstdio>
#include<string>
#include<ctime>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<stack>
#include<climits>
#include<queue>
#include<map>
#include<set>
#include<sstream>
#include<cassert>
#include<bitset>
#include<unordered_map>
using namespace std;
typedef long long LL;
typedef unsigned long long ull;
const int inf=0x3f3f3f3f;
const int N=2e5+100;
int main()
{
#ifndef ONLINE_JUDGE
// freopen("data.in.txt","r",stdin);
// freopen("data.out.txt","w",stdout);
#endif
// ios::sync_with_stdio(false);
int w;
cin>>w;
while(w--)
{
LL a,b;
scanf("%lld%lld",&a,&b);
if((a-1)%b==0)
puts("T");
else
puts("F");
}
return 0;
}