0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-08 15:58:48 +00:00

T249186 gcd.

https://www.luogu.com.cn/record/80961239
This commit is contained in:
Baoshuo Ren 2022-07-24 15:12:23 +08:00
parent 7bb4dfdc6e
commit 60c822c3e0
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

28
Luogu/T249186/T249186.cpp Normal file
View File

@ -0,0 +1,28 @@
#include <iostream>
#include <cmath>
using std::cin;
using std::cout;
const char endl = '\n';
int t;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> t;
while (t--) {
long long l, r, x;
cin >> l >> r >> x;
int a = static_cast<long long>(std::floor(static_cast<long double>(l) / x)),
b = static_cast<long long>(std::floor(static_cast<long double>(r) / x));
cout << (a == b ? a : 1) << endl;
}
return 0;
}