mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-30 20:36:26 +00:00
29 lines
504 B
C++
29 lines
504 B
C++
#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;
|
|
}
|