#include using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) int main() { int C, Y; cin >> C >> Y; vector yen = {1, 5, 10, 50, 100, 500, 1000, 2000, 5000, 10000}; vector coin(10, 0); int y = Y; rep(i, 10) { coin[(10-1) - i] = y / yen[(10-1) - i]; y %= yen[(10-1) - i]; } if (Y < C * 100) cout << "can't exchange" << endl; else if (coin[4] >= C) cout << "no exchange" << endl; else { int ret = coin[4]; while (ret < C) ret += 5; cout << ret << endl; } return 0; }