#27542:


qgd20040229@gmail.com (时年)

School : No School
ID : 170559
IP address : [27.105.55.178]
Last Login :
2021-10-10 23:00:28
c006. 10550 - Combination Lock -- UVa10550 | From: [27.105.55.178] | Post Date : 2021-10-10 23:49

#include <iostream>

using namespace std;

 

int main(){

  int n0, n1, n2, n3;

  while (cin >> n0 >> n1 >> n2 >> n3){

    if (n0 == 0 && n1 == 0 && n2 == 0 && n3 == 0) break;

    int ans =720;

    ans += ((40+n0-n1)%40)*9;

    ans += 360;

    ans += ((40+n2-n1)%40)*9;

    ans += ((40+n2-n3)%40)*9;

    cout << ans <<endl;

  }

}

 
ZeroJudge Forum