思路
画图找规律
代码区
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
typedef long long ll;
const int Max = 3e5 + 10;
const int inf = 0x3f3f3f3f;
int main()
{
int w1, w2, h1, h2;
while(~scanf("%d%d%d%d", &w1, &h1, &w2, &h2))
{
int sum = 12 + (w1 + h1 + w2 + h2 - 2) * 2;
int ans = sum - 4 - min(w1,w2)*2;
printf("%d\n", ans);
}
return 0;
}