Submission

Status:

[-S][-S][P][-][P][P][P][P][P][P]

Subtask/Task Score:

{0/10}{0/10}{10/10}{0/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}

Score: 70

User: SonnyHappy108

Problemset: โรงงานหุ่นยนต์

Language: cpp

Time: 0.002 second

Submitted On: 2026-04-11 13:10:05

#include <bits/stdc++.h>
using namespace std;
//done : 9
void manu(int &head,int &body,int &colpref,int &money){
	int manum=min(min(head,body),colpref);
	head-=manum;
	body-=manum;
	colpref-=manum;
	money+=manum;
}
int main(){
	int hb,hw,bb,bw,sc,dc;
	int a,b,c,d;
	cin >> hb >> hw >> bb >> bw >> sc >> dc;
	int thb=hb,thw=hw,tbb=bb,tbw=bw,tsc=sc,tdc=dc,tm=0;
	manu(thb,tbb,tsc,tm);
	manu(thw,tbw,tsc,tm);
	manu(thw,tbb,tdc,tm);
	manu(thb,tbw,tdc,tm);
	a=tm;
	tm=0;
	thb=hb,thw=hw,tbb=bb,tbw=bw,tsc=sc,tdc=dc;
	manu(thw,tbw,tsc,tm);
	manu(thb,tbb,tsc,tm);
	manu(thw,tbb,tdc,tm);
	manu(thb,tbw,tdc,tm);
	b=tm;
	tm=0;
	thb=hb,thw=hw,tbb=bb,tbw=bw,tsc=sc,tdc=dc;
	manu(thb,tbb,tsc,tm);
	manu(thw,tbw,tsc,tm);
	manu(thb,tbw,tdc,tm);
	manu(thw,tbb,tdc,tm);
	c=tm;
	tm=0;
	thb=hb,thw=hw,tbb=bb,tbw=bw,tsc=sc,tdc=dc;
	manu(thw,tbw,tsc,tm);
	manu(thb,tbb,tsc,tm);
	manu(thb,tbw,tdc,tm);
	manu(thw,tbb,tdc,tm);
	d=tm;
	cout << max(max(max(a,b),c),d);
}