#include using namespace std; int main(void) { /*Aw-(C-Ab)のこる C-Abこ移動して (Bw+C-Ab)>> aw >> ab >> bw >> bb >> c >> d; if (c >= ab)p = c - ab; else p = 0; if (bw + p >= d)ans = aw -p + d; else ans = aw + bw; cout << ans << endl; return 0; }