mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 21:16:27 +00:00
18 lines
268 B
C++
18 lines
268 B
C++
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int a, b, c;
|
|
|
|
int main() {
|
|
cin >> a >> b >> c;
|
|
for (int i = a; i <= b; i++) {
|
|
if (i % c == 0) {
|
|
cout << i << endl;
|
|
exit(0);
|
|
}
|
|
}
|
|
cout << -1 << endl;
|
|
return 0;
|
|
}
|