#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int c,y; cin >> c >> y; vectora = {10000,5000,2000,1000,500,100}; int sum = 0,res = 0; for(int i = 0; i < a.size(); i++) { int now = y/a[i]; y %= a[i]; if(a[i] >= 500) sum += now*a[i]/500; else { res = now; } } if(res >= c) { cout << "no exchange" << "\n"; } else { if(sum*5+res < c) { cout << "can't exchange" << "\n"; } else { cout << (c+4)/5*5 << "\n"; } } }