Gym - 100886F 2015-2016 Petrozavodsk Winter Training Camp, Saratov SU Contest F - Empty Vessels
所有的操作都可以转化为向最大的杯子里倒一整杯的水(模意义下完全背包)#includeusingnamespacestd;#defineFor(i,a,b)for(inti=a;iQ;voidoutput(intk,intdep){if(!~fm[k]){printf("%d\n",dep);return;}if(a[fm[k]]<=k){output(k-a[fm[k]],dep+2);print