#include using namespace std; #define all(v) (v).begin(),(v).end() #define pb(a) push_back(a) #define rep(i, n) for(int i=0;i> c >> y; ll now100 = y % 500; now100 /= 100; if(now100 >= c) { cout << "no exchange" << endl; return 0; } if(y / 100 < c) { cout << "can\'t exchange" << endl; return 0; } c -= now100; cout << ((c + 4) / 5) * 5 + now100 << endl; return 0 ; }