#include using namespace std; using ll = long long; using llu = long long unsigned; int main() { int C, Y; cin >> C >> Y; if (Y < 100*C) { cout << "can't exchange"; return 0; } int tmp = (Y % 500) / 100; if (C <= tmp) { cout << "no exchange"; return 0; } int ret = ((C - tmp + 4)/5)*5 + tmp; cout << ret << endl; return 0; }