#include using namespace std; int main() { long long c, y; cin >> c >> y; vector yen(10, 0); int kind[] = {1, 5, 10, 50, 100, 500, 1000, 2000, 50000, 10000}; for (int i = 9; i >= 0; i--) { yen[i] = y / kind[i]; y %= kind[i]; } long long sum = 0; for (int i = 0; i < yen.size(); i++) { if (kind[i] >= 100) sum += yen[i] * kind[i]; else yen[i] = 0; } if (sum < c * 100) { cout << "can't exchange" << endl; } else if (yen[4] >= c) { cout << "no exchange" << endl; } else { long long notEnough = c - yen[4]; cout << yen[4] + ((notEnough + 4) / 5) * 5 << endl; } }