题意:
给你一个10进制的b和x,对于任意的一个b进制的y。如果y每一位的和可以被x整除,且y可以被x整除;或者如果y每一位的和不可以被x整除,且y不可以被x整除。那么就输出T。否则输出F
题解:
代码:
#include<stack>
#include<queue>
#include<map>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define fi first
#define se second
using namespace std;
typedef long long ll;
const int maxn=2e5+10;
ll b,x;
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
scanf("%lld%lld",&b,&x);
if(b%x==1)
{
printf("T\n");
}
else
{
printf("F\n");
}
}
return 0;
}