#include #include #define chmin(x,y) (x) = min((x),(y)) #define chmax(x,y) (x) = max((x),(y)) #define ld long double using namespace std; using namespace atcoder; using ll = long long; const ll mod = 998244353; using mint = modint998244353; //using Graph = vector>>; using Graph = vector>; const vector dx = {1,0,-1,0}, dy = {0,1,0,-1}; ll sqrtll(ll x) { assert(x >= 0); ll hi(x), lo(0); while (hi != lo) { ll y = (hi + lo + 1) / 2; if (y <= x/y) lo = y; else hi = y - 1; } return lo; } int main(){ // input int C,Y; cin >> C >> Y; int bill = Y / 500, coin = (Y % 500) / 100; if(coin >= C) cout << "no exchange" << endl; else if(Y / 100 < C) cout << "can't exchange" << endl; else{ int exc = (C-coin) / 5 + ((C-coin)%5>0); int ans = exc * 5 + coin; cout << ans << endl; } }