#include using namespace std; int main() { int L,R,C,A; A = 1000; cin >> L >> R >> C; for (int i = L; i <=R; i++){ if (A > i * C - i * C / 1000 * 1000) { A = i * C - i * C / 1000 * 1000; } } cout << A << endl; return 0; }