fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long long n, a, b, x, x0, fatique = 0;
  8. cin >> n >> a >> b;
  9. cin >> x0;
  10. n--;
  11. while (n--) {
  12. cin >> x;
  13. fatique += min(a * (x - x0), b);
  14. x0 = x;
  15. }
  16. cout << fatique;
  17. }
Time limit exceeded #stdin #stdout 15s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty