-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10550 - Combination Lock.cpp
42 lines (34 loc) · 2.01 KB
/
10550 - Combination Lock.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/******************************************************************************
* ▄██████████▄ ▀█████████▄ ▀██████████▄ ▄████████████▄ ▄██████████▄ *
* ▀▀███ ███▀ ███ ███ ███ ▀██▄ ▀███▀ ▀███▀ █▀ ▄███▀ *
* ███ ███ ███ ██ ███ ███ ▄███▀ *
* ▄███▄▄▄██▀ ▄███▄▄▄██▀ ███ ██▀ ███ ███ ▄███▀ *
* ▀▀███▀▀▀██▄ ▀▀███▀▀▀██▄ ▄███▄▄▄▄▄██▀ ███ ███ ▄███▀ *
* ███ ███ ▀▀███▀▀▀▀▀██▄ ███ ███ ▄███▀ *
* ███ ███ ███ ███ ███ ▄███▄ ▄███▄ ▄███▀ ▄█ *
* ▄▄████▀ ▄█████████▀ ▄███ ███▄ ▀████████████▀ ▀██████████▀ *
* *
* *Don't limit your challenges, challenge your limits. *
******************************************************************************/
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int s,a,b,c,res;
int calc(int x, int y){
return (x - y + 40) % 40;
}
void init(){
while(scanf("%d%d%d%d",&s,&a,&b,&c)==4 and (s or a or b or c)){
res = (120 + calc(s, a) + calc(b, a) + calc(b, c)) * 9;
printf("%d\n",res);
}
}
int main(){
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
init();
return 0;
}