#include <stdio.h>
int main()
{
int pw1, pw2, pw3, startNum, sum;
while (1)
{
scanf("%d %d %d %d",&startNum, &pw1, &pw2, &pw3);
if (startNum == 0 && pw1 == 0 && pw2 == 0 && pw3 == 0) break;
sum = 720 + 360;
if (startNum >= pw1) sum += (startNum - pw1) * 9;
else if (startNum < pw1) sum += (startNum + 40 - pw1) * 9;
if (pw1 > pw2) sum += (40 - pw1 + pw2) * 9;
else if (pw1 <= pw2) sum += (pw2 - pw1) * 9;
if (pw2 >= pw3) sum += (pw2 - pw3) * 9;
else if (pw2 <= pw3) sum += (40 - pw3 + pw2) * 9;
printf("%d\n", sum);
}
return 0;
}
回目錄
回首頁
沒有留言 :
張貼留言