#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { ll c, y; cin >> c >> y; ll t = (y % 500) / 100; if (y / 100 < c) { cout << "can't exchange" << endl; } else if (t >= c) { cout << "no exchange" << endl; } else { ll rem = c - t; Debug(rem, rem % 5, (5 - rem % 5) % 5); cout << (5 - rem % 5) % 5 + rem + t << endl; } return 0; }