#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; if (y / 100 < c) { cout << "can't exchange" << endl; } else if ((y % 500) / 100 >= c) { cout << "no exchange" << endl; } else { ll rem = c - (y % 500) / 100; cout << (5 - rem % 5) % 5 + rem << endl; } return 0; }