mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-10 06:58:47 +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;
|
||
|
}
|