noshin98

uva 10550-1

Dec 15th, 2016
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     long long s,a,b,c,ans;
  5.  
  6.     while(scanf("%lld %lld %lld %lld",&s,&a,&b,&c)==4)
  7.     {
  8.         if(s==0&&a==0&&b==0&&c==0)
  9.             break;
  10.         else
  11.         {
  12.             ans=1080+((s-a+40)%40+(b-a+40)%40+(b-c+40)%40)*9;
  13.             printf("%lld\n",ans);
  14.         }
  15.     }
  16. }
Add Comment
Please, Sign In to add comment