#include using namespace std; using ll = long long; #define rep(i, n) for(int i = 0; i < n; i++) int main() { int c, y; cin >> c >> y; if(y / 100 < c) { cout << "can't exchange" << endl; return 0; } vector v{10000, 5000, 2000, 1000, 500, 100}, num(6); rep(i, 6) { num[i] = y / v[i]; y -= num[i] * v[i]; } if(num[5] >= c) { cout << "no exchange" << endl; return 0; } int cc = c; cc -= num[5]; int m = cc % 5; if(m) c += 5 - m; cout << c << endl; }