//简单数学题
#include <cstdio>
#include <iostream>

using namespace std;

int main() {
int n;
while (scanf("%d", &n), n) {
int time = 0;
int one, two;
one = 0;
for (int i=0; i<n; ++i) {
scanf ("%d", &two);
if (one < two) time += (two - one) * 6;
else time += (one - two) * 4;
one = two;
}
time += n * 5;
printf ("%d\n", time);
}
return 0;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-25
  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
  • 2021-07-28
猜你喜欢
  • 2022-12-23
  • 2021-12-21
  • 2022-02-12
  • 2021-05-21
  • 2022-12-23
相关资源
相似解决方案