#include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int c,y; cin >> c >> y; vector yens = {10000,5000,2000,1000,500,100}; vector count(6,0); int ma = 0; for (int i = 0; i < 6; i++){ count[i] += y/yens[i]; y %= yens[i]; ma += yens[i]/100 * count[i]; } if (count[5] >= c){ cout << "no exchange" << endl; return 0; } if (ma < c){ cout << "can't exchange" << endl; return 0; } int ans = (5 - ((c-count[5])%5))%5 + c; cout << ans << endl; return 0; }