fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int range, n1, n2, n3, totalrotation = 0;
  6. cin >> range >> n1 >> n2 >> n3;
  7. totalrotation += (2*range + n1) + (n1+(range-n2)) + (range - n2 + n3);
  8. cout << totalrotation << endl;
  9. return 0;
  10. }
Success #stdin #stdout 0s 3300KB
stdin
5 1 2 3
stdout
21