#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, d, s;
while(cin >> a >> b >> c >> d)
{
if(a == 0 && b == 0 && c == 0 && d == 0)
break;
s = 1080;
if(a > b)
s = s + ((a - b) * 9);
else
s = s + ((a - b + 40) * 9);
if(c > b)
s = s + (c - b) *9;
else
s = s + ((c - b + 40) * 9);
if(d < c)
s = s + ((c - d) * 9);
else
s = s + ((c - d + 40) * 9);
cout << s << endl;
}
return 0;
}
using namespace std;
int main()
{
int a, b, c, d, s;
while(cin >> a >> b >> c >> d)
{
if(a == 0 && b == 0 && c == 0 && d == 0)
break;
s = 1080;
if(a > b)
s = s + ((a - b) * 9);
else
s = s + ((a - b + 40) * 9);
if(c > b)
s = s + (c - b) *9;
else
s = s + ((c - b + 40) * 9);
if(d < c)
s = s + ((c - d) * 9);
else
s = s + ((c - d + 40) * 9);
cout << s << endl;
}
return 0;
}
Comments
Post a Comment