#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int s;
int a,b,c;
int ans;
while(1){
scanf("%d%d%d%d", &s, &a, &b, &c);
if(s==0 && a==0 && b==0 && c==0)
return 0;
ans = 1080;
ans += ((s-(a-40))%40) * 9;
ans += (((b+40)-a)%40) * 9;
ans += ((b-(c-40))%40) * 9;
printf("%d\n",ans);
}
return 0;
}
| 歡迎光臨 竹園論壇 (http://forum.tfcis.org/) | Powered by Discuz! X3.2 |