本文共 846 字,大约阅读时间需要 2 分钟。
这题和这题一样。。。。。。只不过多了个数。。。
https://www.cnblogs.com/WTSRUVF/p/9316412.html
#include #include #include #include #include #include #include #include #include #include #include #define rap(a, n) for(int i=1; i<=n; i++)#define MOD 2018#define LL long long#define ULL unsigned long long#define Pair pair #define mem(a, b) memset(a, b, sizeof(a))#define _ ios_base::sync_with_stdio(0),cin.tie(0)//freopen("1.txt", "r", stdin);using namespace std;const int maxn = 10010, INF = 0x7fffffff;LL gcd(LL a, LL b){ return b==0?a:gcd(b, a%b);}int main(){ int T, kase = 0; cin>> T; while(T--) { LL a, b, L; cin>> a >> b >> L; printf("Case %d: ", ++kase); LL c = a * b / gcd(a, b); if(L % c) { cout<< "impossible" <
转载于:https://www.cnblogs.com/WTSRUVF/p/9350242.html